How do I get a WKID or WKT from a spatial reference name?

4645
3
05-15-2013 12:28 PM
Labels (1)
JeremyBridges
Occasional Contributor
Anyone know how to get the WKID or WKT from a spatial reference name ("WGS_1984_Web_Mercator_Auxiliary_Sphere")?  Of course, I've got this list:

http://sampleserver3.arcgisonline.com/ArcGIS/SDK/REST/pcs.html

But, that doesn't give me a programmatic approach (besides typing all of these into an enum).

Some background: our application gets this spatial reference name from the JSON of an ArcGIS Online Item.  Instead of being in the usual format that contains the WKID, it just gives the spatial reference name.  Here's an example:

http://www.arcgis.com/sharing/rest/content/items/f14e50d8e42648c8b47a4ed7eed6b92d/?f=json

Do I need to build this for myself?
0 Kudos
3 Replies
JeremyBridges
Occasional Contributor
A colleague of mine pointed me to a place in ArcObjects that does this.  There's an enum called esriSRProjCS3Type that contains all of the coordinate systems, matching names to WKID's.  But, because we're trying to stick to Runtime, we don't have access to this type.  Is there anything similar in the Runtime API's?
0 Kudos
AnttiKajanus1
Occasional Contributor III
I think that you need to create the enumeration yourself.

If there is another solutions, I would like to know that too.
0 Kudos
MatthewBrown1
Occasional Contributor
I have noticed that the deployment has a 'Additional Projection Engine Transformations' option that creates the folder \ArcGISRuntime10.1.1\LocalServer32\pedata\gdaldata (among others) with some .wkt and .csv files that you might be able to access programmatically.

Depending on your workflow, arcpy might also be useful:
http://resources.arcgis.com/en/help/main/10.1/index.html#//018z0000000v000000
0 Kudos