<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ArcMap 10 - Change coordinate system in mxd file in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/arcmap-10-change-coordinate-system-in-mxd-file/m-p/252172#M8643</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Did you finally find a way out ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm exactly in the same situation as you are. Around 12000 MXDs that must be moved from one coordonate system to another.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I also intend to reproject on the fly thousands of shape files and rasters.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For this, I rely on a Python script. It's already able to convert shapes and rasters, but I havn't found the clue so far for mxd.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Your message gave me some hope.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As if that wasn't enougth, I run a 9.3 version of ArcMap. Arcpy is available since ArcMap 10 isn't it ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please let me know if you got through this, it could help me a lot.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 31 May 2010 15:36:15 GMT</pubDate>
    <dc:creator>LaurentDupont</dc:creator>
    <dc:date>2010-05-31T15:36:15Z</dc:date>
    <item>
      <title>ArcMap 10 - Change coordinate system in mxd file</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcmap-10-change-coordinate-system-in-mxd-file/m-p/252169#M8640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I want to change the coordinate system in the Data Frame Properties through arcpy.mapping.MapDocument()&amp;nbsp; using python.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]1052[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's the code I came up with:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;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
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;SPAN&gt;This code works ONLY if I first open the mxd file and hit the clear button (see image above).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If the coordinate system isn't cleared first, the code runs through without error but doesn't change the coordinate system.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Not sure if this is a bug or not? (If it's not a bug, I can find or figure out any way to clear the coordinate system through scripting).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyone have any experience with this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 May 2010 13:38:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcmap-10-change-coordinate-system-in-mxd-file/m-p/252169#M8640</guid>
      <dc:creator>RDHarles</dc:creator>
      <dc:date>2010-05-26T13:38:01Z</dc:date>
    </item>
    <item>
      <title>Re: ArcMap 10 - Change coordinate system in mxd file</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcmap-10-change-coordinate-system-in-mxd-file/m-p/252170#M8641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;How about this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;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&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:29:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcmap-10-change-coordinate-system-in-mxd-file/m-p/252170#M8641</guid>
      <dc:creator>JasonScheirer</dc:creator>
      <dc:date>2021-12-11T12:29:58Z</dc:date>
    </item>
    <item>
      <title>Re: ArcMap 10 - Change coordinate system in mxd file</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcmap-10-change-coordinate-system-in-mxd-file/m-p/252171#M8642</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks, Jason.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Unfortunately, that code still doesn't work, if there is already a coordinate system saved in the mxd.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It did work though after I cleared the coordinate system and saved off the mxd (same as what was happening originally).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I find really surprising is that the following code also works (as long as the mxd contains no previous coordinate system). It appears it is reading the new .prj files?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;A simple "open and save":&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy, sys
mxd = arcpy.mapping.MapDocument("base.mxd")
mxd.save()
del mxd&lt;/PRE&gt;&lt;SPAN&gt;Maybe these details will help:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm reprojecting directories (each containing an mxd) full of shapefiles that were previously in Lat/Long WGS84.&amp;nbsp; I've reprojected them to a State Plane coordinate system.&amp;nbsp; All I want now is for the Data Frame Properties in the mxd to match the new State Plane coordinate system.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:30:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcmap-10-change-coordinate-system-in-mxd-file/m-p/252171#M8642</guid>
      <dc:creator>RDHarles</dc:creator>
      <dc:date>2021-12-11T12:30:01Z</dc:date>
    </item>
    <item>
      <title>Re: ArcMap 10 - Change coordinate system in mxd file</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcmap-10-change-coordinate-system-in-mxd-file/m-p/252172#M8643</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Did you finally find a way out ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm exactly in the same situation as you are. Around 12000 MXDs that must be moved from one coordonate system to another.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I also intend to reproject on the fly thousands of shape files and rasters.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For this, I rely on a Python script. It's already able to convert shapes and rasters, but I havn't found the clue so far for mxd.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Your message gave me some hope.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As if that wasn't enougth, I run a 9.3 version of ArcMap. Arcpy is available since ArcMap 10 isn't it ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please let me know if you got through this, it could help me a lot.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 May 2010 15:36:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcmap-10-change-coordinate-system-in-mxd-file/m-p/252172#M8643</guid>
      <dc:creator>LaurentDupont</dc:creator>
      <dc:date>2010-05-31T15:36:15Z</dc:date>
    </item>
    <item>
      <title>Re: ArcMap 10 - Change coordinate system in mxd file</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcmap-10-change-coordinate-system-in-mxd-file/m-p/252173#M8644</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Nope, still haven't gotten it to work (if coordinate system is already present in the mxd).&amp;nbsp; And yes,&amp;nbsp; you need the arcpy module (Arc10) to do this.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jun 2010 12:07:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcmap-10-change-coordinate-system-in-mxd-file/m-p/252173#M8644</guid>
      <dc:creator>RDHarles</dc:creator>
      <dc:date>2010-06-01T12:07:43Z</dc:date>
    </item>
    <item>
      <title>Re: ArcMap 10 - Change coordinate system in mxd file</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcmap-10-change-coordinate-system-in-mxd-file/m-p/252174#M8645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;this script works correctly,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;in the scripts before are two problems.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Problem 1:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;df.spatialRefence = prj&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;correct is df.spatialReference = prj&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Problem 2:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;false is prjFile = r"D:\Programme\ArcGIS\Desktop10.0\Coordinate Systems\Projected Coordinate Systems\UTM\Europe\ETRS 1989 UTM Zone 32N.prj"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;correct is prjFile = r"E:\home\MXD_DE_NEU\ETRS_1989_UTM_Zone_32N.prj"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy, sys&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mxd = arcpy.mapping.MapDocument(r"E:\home\MXD_DE_NEU\_MXD_DE\k8_2000_de.mxd")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;outMXD = r"E:\home\MXD_DE_NEU\_MXD_DE\k8_2000_de_test.mxd"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;prjFile = r"E:\home\MXD_DE_NEU\ETRS_1989_UTM_Zone_32N.prj"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;# Read in the coordinate system definition prj = arcpy.SpatialReference(prjFile)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;prj = arcpy.SpatialReference(prjFile)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;print prj.name&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;df = arcpy.mapping.ListDataFrames(mxd)[0]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;print df.spatialReference.name&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;df.spatialReference = prj&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;print "New Spatial Reference:" + df.spatialReference.name&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mxd.save(outMXD)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;del mxd&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Oct 2010 06:16:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcmap-10-change-coordinate-system-in-mxd-file/m-p/252174#M8645</guid>
      <dc:creator>FrankLoy</dc:creator>
      <dc:date>2010-10-04T06:16:58Z</dc:date>
    </item>
    <item>
      <title>Re: ArcMap 10 - Change coordinate system in mxd file</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcmap-10-change-coordinate-system-in-mxd-file/m-p/252175#M8646</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I was just having the same issue and this works with ut having to save a new file.&amp;nbsp; Thanks for posting this it helped me!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import os, arcpy&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mxd = arcpy.mapping.MapDocument("C://HDR//AKDatadrivenpages//DATADRIVEN_Map.mxd")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;sr = arcpy.SpatialReference(r"C:\Program Files\ArcGIS\Desktop10.0\Coordinate Systems\Projected Coordinate Systems\UTM\NAD 1927\NAD 1927 UTM Zone 10N.prj")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;df = arcpy.mapping.ListDataFrames(mxd)[0]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;print df.spatialReference.name&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;df.spatialReference = sr&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;print df.spatialReference.name&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.RefreshActiveView&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mxd.save()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;del mxd&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And this sets the SR to be the same as a different dataframe.&amp;nbsp; For some reason using Data Drvien Pages there is no way to set the overview maps SR. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import os, arcpy&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mxd = arcpy.mapping.MapDocument("C://HDR//AKDatadrivenpages//DATADRIVEN_Map.mxd")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;df0 = arcpy.mapping.ListDataFrames(mxd)[0]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;df1 = arcpy.mapping.ListDataFrames(mxd)[1]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;print df0.spatialReference.name&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;df0.spatialReference = df1.spatialReference&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;print df0.spatialReference.name&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.RefreshActiveView&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mxd.save()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;del mxd&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 May 2012 20:41:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcmap-10-change-coordinate-system-in-mxd-file/m-p/252175#M8646</guid>
      <dc:creator>LledSmith</dc:creator>
      <dc:date>2012-05-23T20:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: ArcMap 10 - Change coordinate system in mxd file</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcmap-10-change-coordinate-system-in-mxd-file/m-p/252176#M8647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Jason's code is working for me. The intial SR was UTM 11 N and I was able to change it to California state plane.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;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
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm on Win XP, ArcGIS 10.0 SP3.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:30:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcmap-10-change-coordinate-system-in-mxd-file/m-p/252176#M8647</guid>
      <dc:creator>NobbirAhmed</dc:creator>
      <dc:date>2021-12-11T12:30:04Z</dc:date>
    </item>
  </channel>
</rss>

