1

I recently found out how to create specific spatial reference objects and add them to my arcgis python standalone script. sp=arcpy.CreateSpatialReference_management("GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],VERTCS['NAVD_1988',VDATUM['North_American_Vertical_Datum_1988'],PARAMETER['Vertical_Shift',0.0],PARAMETER['Direction',1.0],UNIT['Meter',1.0]];-400 -400 1000000000;-100000 10000;-100000 10000;8.98315284119521E-09;0.001;0.001;IsHighPrecision","#","#","#","#","#","0")

As you can see, this is painfully long and is subject to errors. I would like to know how to go about shortening the input required to make this tool functional. Where can I place well-known ESRI ID's to simplify the inputs.

1 Answer 1

1

You can simply use:

my_sr = arcpy.SpatialReference(my_wkid) 

Then use my_sr however you wish.

ESRI Documentation - ArcPy SpatialReference

9
  • Problem is, i got to define Projected Coordinate System for my Horizontal and Vertical Coordinate System for my elevations. Maybe VERTCS[wkid] would work?? thoughts? I cannot build my feature dataset without clearly defining both. Commented Jul 2, 2015 at 18:42
  • 1
    Didn't notice the need for a VCS. Maybe use the arcpy.SpatialReference('c:/my_fc.prj') method. Create a prj file and load that into the SpatialReference class. I tested it and it appears to work fine. Commented Jul 2, 2015 at 19:28
  • Can you elaborate a little further? I am more of a programmer than GIS proficient. Why wouldn't there be the need for a VCS? Commented Jul 2, 2015 at 20:03
  • VCS allows for GIS recognition of the z-dimension. (Judging from the similar question you previously asked, you'll need it set for elevation purposes.) Commented Jul 2, 2015 at 20:19
  • Oh ok, how would the projection file have both horizontal and vertical references? Commented Jul 2, 2015 at 20:56

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.