Hi,
The GPSpatialReference datatype within an input parameter invokes a nice user experience to select the sr...
Accessing the GPSpatialReference parameter returns the following sample string:
'GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]];-400 -400 1000000000;-100000 10000;-100000 10000;8.98315284119521E-09;0.001;0.001;IsHighPrecision'
However, my source code is using spatially enabled dataframes (SEDFs). SEDFs deal better with WKIDs than the string above.
So, I see two potential options if I want to keep the gui sr selector:
1) change to another data type that uses the gui sr selector and assigs a WKID, or,
2) Convert that string above to a WKID or something an SEDF will ingest.
Any ideas how to convert that string to WKID, or know a better parameter data type?
Last resort:
1) change datatype to string and collect the WKID directly. Not as end user friendly.
Thank you,
Tyler
Solved! Go to Solution.
I had a couple of thoughts:
1) Notice the behavior of both the GPSpatialReference and GPCoordinateSystem. If you type in:
...the field converts it to the string above. That makes me wonder how to access the same conversion dictionary that the toobox module is using.
2) I posted a general Python topic question of how to best normalize this html table https://developers.arcgis.com/javascript/3/jshelp/gcs.html.
See post at:
Reading html tables is a general topic I would like to get better at so the topic stands alone. However, as it relates to the current situation, the idea would be to read it in and use it as a look up table. The 4326 wkid matched the string exactly.
Thx.
Tyler
Perfect. Thank you!