POST
|
Not to be insulting, but that seems like a major pain lol. It is helpful in that it shows what would go into defining the .prj file, but for just the StatePlane projections in the U.S. alone, there are 121 different features. I would not want to have to do this for all of them. I was hoping for an easy solution, but it seems as if adding a WKID field to the attribute table of the reference projection maps, adding the WKIDs for each of the projection systems, and referencing them with a SearchCursor in ArcPy is the best option for this type of workflow.
... View more
04-27-2016
01:47 PM
|
1
|
10
|
862
|
POST
|
It also seems to work with UTM Zones greater than 10. If you were to run your test again with the NAD 1983 UTM Zone 10N projection, it should work correctly. Such as: vs.
... View more
04-27-2016
09:39 AM
|
1
|
1
|
2365
|
POST
|
It's very odd. I am not sure as to why the UTM ids don't work if the SpatialReferece object is assigned their name rather than their WKID. I was hoping to avoid creating a dictionary in Python for the UTM zones and their respective WKID numbers. I wasn't sure that they were sequential, but that will work.
... View more
04-27-2016
09:27 AM
|
0
|
0
|
2365
|
POST
|
I did try this, I know that putting an 'r' in front of a string indicates to Python to read the string as a literal, rather than reading in special characters. i.e. Writing a string with "\n" in it will tell Python to print to the next line, etc. I also ran a few tests with underscores vs. spaces But unfortunately, it did not solve the issue.
... View more
04-27-2016
09:25 AM
|
0
|
0
|
2363
|
POST
|
I am attempting to write a Python script that uses a general reference map of the NAD 1983 UTM Zones to automate the selection of an appropriate map projection for a specific area. I have completed the script up until the point at which I need to create a SpatialReference object that contains the appropriate projection. I have been getting a 999999 general runtime error whenever I try to assign the SpatialReference object the value of "NAD 1983 UTM Zone 9N" or lower, but past "NAD 1983 UTM Zone 10N", it works. This screenshot is the result of a test script in which I import ArcPy, and then try to initialize a SpatialReference object with the respective values mentioned above. In the second run, I printed the SpatialReference object's name in order to test to make sure that the value was assigned correctly. Am I missing something here, or is this a known issue with assigning the names of projections to SpatialReference objects? I would otherwise use the WKID for the projection, but the reference map that I am using only contains a field for the name of the projection. Edit: I am using general reference maps for both the NAD 1983 UTM Zones as well as the USA State Plane Zones NAD83 in order to find an appropriate projection for an input dataset. I first find the centroid of the dataset, and then select by location from the reference projection maps. From the responses here and my own testing, it seems as if trying to assign SpatialReference objects the projections by name does not work for certain types of projections. Namely, the NAD 1983 UTM Zone 1-9 projections. I have also yet to find a U.S. State Plane projection in which the SpatialReference object does not give an error when attempting to assign the projection by name. The solution seems to be to assign the SpatialReference object by WKID. but this could be quite cumbersome if the assignment of projection WKIDs does not follow an intuitive pattern and you're working with hundreds of reference projections.
... View more
04-27-2016
01:34 AM
|
0
|
25
|
9390
|
Title | Kudos | Posted |
---|---|---|
1 | 04-27-2016 09:39 AM | |
1 | 04-27-2016 01:47 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|