import arcpy, sys mxd = arcpy.mapping.MapDocument("base.mxd") prjList = "q:/python/prj/" # Read in the coordinate system definition prj = arcpy.SpatialReference(prjList+sys.argv[1]+".prj") # Get the code (e.g. 2288 = "NAD_1983_StatePlane_California_VI_FIPS_0406_Feet") code = prj.PCSCode df = arcpy.mapping.ListDataFrames(mxd)[0] sr = df.spatialReference sr.PCSCode = code df.spatialRefence = sr mxd.save() del mxd
import arcpy mxd = arcpy.mapping.MapDocument(r"D:\dataframesr\df_sr.mxd") df = arcpy.mapping.ListDataFrames(mxd)[0] prjfile = r"D:\dataframesr\ca_fips.prj" sr = arcpy.SpatialReference(prjfile) df.spatialReference = sr mxd.save() del mxd
import arcpy, sys mxd = arcpy.mapping.MapDocument("base.mxd") mxd.save() del mxd
import arcpy, sys mxd = arcpy.mapping.MapDocument("base.mxd") prjList = "q:/python/prj/" # Read in the coordinate system definition prj = arcpy.SpatialReference(prjList+sys.argv[1]+".prj") df = arcpy.mapping.ListDataFrames(mxd)[0] df.spatialRefence = prj mxd.save() del mxd
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.