<?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: Modify map coordinate system with arcpy.mp? in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/modify-map-coordinate-system-with-arcpy-mp/m-p/700442#M30951</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Done.&amp;nbsp; It looked like I was the first vote.&amp;nbsp; Can you vote for your own idea?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 31 Oct 2016 18:51:55 GMT</pubDate>
    <dc:creator>JoshuaBixby</dc:creator>
    <dc:date>2016-10-31T18:51:55Z</dc:date>
    <item>
      <title>Modify map coordinate system with arcpy.mp?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/modify-map-coordinate-system-with-arcpy-mp/m-p/700433#M30942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there any way to modify a map's coordinate system in ArcGIS Pro using Python?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Oct 2016 15:31:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/modify-map-coordinate-system-with-arcpy-mp/m-p/700433#M30942</guid>
      <dc:creator>BryanChastain</dc:creator>
      <dc:date>2016-10-31T15:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: Modify map coordinate system with arcpy.mp?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/modify-map-coordinate-system-with-arcpy-mp/m-p/700434#M30943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Define Projection or the Project tool are your options ... what are you looking to modify?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Oct 2016 17:41:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/modify-map-coordinate-system-with-arcpy-mp/m-p/700434#M30943</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-10-31T17:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: Modify map coordinate system with arcpy.mp?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/modify-map-coordinate-system-with-arcpy-mp/m-p/700435#M30944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If by "map" you mean &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/arcpy/mapping/mapframe-class.htm"&gt;MapFrame&lt;/A&gt;&lt;/SPAN&gt;, at ArcGIS Pro 1.3 there is no &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;spatialReference&lt;/SPAN&gt; method like there is for a &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-mapping/dataframe-class.htm"&gt;DataFrame&lt;/A&gt;&lt;/SPAN&gt; in ArcMap.&amp;nbsp; If you mean &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/arcpy/mapping/map-class.htm"&gt;Map &lt;/A&gt;&lt;/SPAN&gt;by "map," same issue, no method to access spatial reference.&amp;nbsp; Time to submit an enhancement request and ArcGIS Idea....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Oct 2016 17:50:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/modify-map-coordinate-system-with-arcpy-mp/m-p/700435#M30944</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2016-10-31T17:50:14Z</dc:date>
    </item>
    <item>
      <title>Re: Modify map coordinate system with arcpy.mp?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/modify-map-coordinate-system-with-arcpy-mp/m-p/700436#M30945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My guess is you know you can already manually make the change&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/help/mapping/properties/specify-a-coordinate-system.htm" title="https://pro.arcgis.com/en/pro-app/help/mapping/properties/specify-a-coordinate-system.htm"&gt;Specify a coordinate system—Properties of maps | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(I think if you have a default basemap with a different spatial reference, that will also change to the basemaps spatial reference as default....one way to change it)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as Dan asked, what are you looking to modify? And to add, are you trying to do this once, or on-the-fly. Remember that all your layers may need to be reprojected on the fly as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;some links to look at&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/tool-reference/environment-settings/output-coordinate-system.htm" title="https://pro.arcgis.com/en/pro-app/tool-reference/environment-settings/output-coordinate-system.htm"&gt;Output Coordinate System (Environment setting)—Geoprocessing | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/arcpy/get-started/the-spatial-reference-object.htm" title="https://pro.arcgis.com/en/pro-app/arcpy/get-started/the-spatial-reference-object.htm"&gt;Using the spatial reference class—ArcPy Get Started | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/help/mapping/properties/specify-a-coordinate-system.htm#GUID-010AE52D-19C8-4D40-9585-78E5C55DEBF8" title="https://pro.arcgis.com/en/pro-app/help/mapping/properties/specify-a-coordinate-system.htm#GUID-010AE52D-19C8-4D40-9585-78E5C55DEBF8"&gt;Specify a coordinate system—Properties of maps | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/arcpy/classes/spatialreference.htm" title="https://pro.arcgis.com/en/pro-app/arcpy/classes/spatialreference.htm"&gt;SpatialReference—ArcPy Classes | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Oct 2016 18:19:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/modify-map-coordinate-system-with-arcpy-mp/m-p/700436#M30945</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2016-10-31T18:19:58Z</dc:date>
    </item>
    <item>
      <title>Re: Modify map coordinate system with arcpy.mp?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/modify-map-coordinate-system-with-arcpy-mp/m-p/700437#M30946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/2691"&gt;Rebecca Strauch, GISP&lt;/A&gt;&amp;nbsp;&amp;amp; &lt;A href="https://community.esri.com/people/Dan_Patterson"&gt;Dan_Patterson&lt;/A&gt;, sorry I meant change the spatial reference for either an arcpy.mp.Map or arcpy.mp.MapFrame.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;According to &lt;A href="https://community.esri.com/people/bixb0012"&gt;bixb0012&lt;/A&gt;‌, looks like it's not possible. If that's true, that's a shame. It will be hard to come up with a Python-based workaround for that limitation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Oct 2016 18:28:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/modify-map-coordinate-system-with-arcpy-mp/m-p/700437#M30946</guid>
      <dc:creator>BryanChastain</dc:creator>
      <dc:date>2016-10-31T18:28:46Z</dc:date>
    </item>
    <item>
      <title>Re: Modify map coordinate system with arcpy.mp?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/modify-map-coordinate-system-with-arcpy-mp/m-p/700438#M30947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;add an empty data frame, add a layer in the coordinate system you want... the dataframe coordinate system is now set... add/copy your other layers over and remove the 'seed' layer... done... depends how hard you need to have it done&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Oct 2016 18:34:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/modify-map-coordinate-system-with-arcpy-mp/m-p/700438#M30947</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-10-31T18:34:57Z</dc:date>
    </item>
    <item>
      <title>Re: Modify map coordinate system with arcpy.mp?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/modify-map-coordinate-system-with-arcpy-mp/m-p/700439#M30948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unlike most ArcPy modules, ArcPy Mapping (&lt;A href="http://pro.arcgis.com/en/pro-app/arcpy/mapping/introduction-to-arcpy-mp.htm"&gt;arcpy.mp&lt;/A&gt;) had to be rewritten from the ground up since the UI and structure of ArcGIS Pro is completely different than ArcMap.&amp;nbsp; They will be playing catch up for quite some time, which is why it is important for people to open enhancement requests and create ArcGIS Ideas.&amp;nbsp; There is a lot to port over from ArcMap to ArcGIS Pro, and without user feedback, Esri is left to either do what is easiest first or guess at what users want.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Oct 2016 18:42:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/modify-map-coordinate-system-with-arcpy-mp/m-p/700439#M30948</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2016-10-31T18:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: Modify map coordinate system with arcpy.mp?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/modify-map-coordinate-system-with-arcpy-mp/m-p/700440#M30949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Pro doesn't have data frames. Do you mean a Map? The only way I see to programmatically create a new map is to call the arcpy.mp.ArcGISProject.importDocument() function. However, that would require you to have an mxd pre-authored for any coordinate system the user might want to change to. Then you'd still have to copy over all the existing layers into the new map. Also, if the map had already been used in a MapFrame in a Layout, then you'd really run into some issues...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Oct 2016 18:44:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/modify-map-coordinate-system-with-arcpy-mp/m-p/700440#M30949</guid>
      <dc:creator>BryanChastain</dc:creator>
      <dc:date>2016-10-31T18:44:07Z</dc:date>
    </item>
    <item>
      <title>Re: Modify map coordinate system with arcpy.mp?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/modify-map-coordinate-system-with-arcpy-mp/m-p/700441#M30950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, vote me up!&lt;BR /&gt;&lt;A href="https://community.esri.com/ideas/12767" target="_blank"&gt;https://community.esri.com/ideas/12767&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jun 2021 08:44:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/modify-map-coordinate-system-with-arcpy-mp/m-p/700441#M30950</guid>
      <dc:creator>BryanChastain</dc:creator>
      <dc:date>2021-06-22T08:44:04Z</dc:date>
    </item>
    <item>
      <title>Re: Modify map coordinate system with arcpy.mp?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/modify-map-coordinate-system-with-arcpy-mp/m-p/700442#M30951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Done.&amp;nbsp; It looked like I was the first vote.&amp;nbsp; Can you vote for your own idea?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Oct 2016 18:51:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/modify-map-coordinate-system-with-arcpy-mp/m-p/700442#M30951</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2016-10-31T18:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: Modify map coordinate system with arcpy.mp?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/modify-map-coordinate-system-with-arcpy-mp/m-p/700443#M30952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to do the same thing - set the coordinate system of an ArcGIS Pro Map object using arcpy. Just downloaded ArcGIS Pro 2.2 and there still doesn't seem to be a way. Anybody come across any solutions / workarounds in the last couple of years?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jun 2018 22:12:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/modify-map-coordinate-system-with-arcpy-mp/m-p/700443#M30952</guid>
      <dc:creator>KeithMiller4</dc:creator>
      <dc:date>2018-06-26T22:12:22Z</dc:date>
    </item>
    <item>
      <title>Re: Modify map coordinate system with arcpy.mp?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/modify-map-coordinate-system-with-arcpy-mp/m-p/700444#M30953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It now appears that there is a "Camera" object associated to Map and MapFrame objects.&amp;nbsp; Within the Camera class there is a getExtent() and setExtent() method that returns or sets and Extent object, which has a spatialReference property.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2018 04:17:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/modify-map-coordinate-system-with-arcpy-mp/m-p/700444#M30953</guid>
      <dc:creator>DavidClark1</dc:creator>
      <dc:date>2018-06-29T04:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: Modify map coordinate system with arcpy.mp?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/modify-map-coordinate-system-with-arcpy-mp/m-p/700445#M30954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to read the map objects&amp;nbsp;&lt;SPAN style="background-color: #ffffff; border: 0px;"&gt;spatialReference&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;&amp;nbsp;properties. Picture that it's 2019 and Esri have GIS Software&amp;nbsp;where you can't read spatial reference of a map.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;aprx_object = arcpy.mp.ArcGISProject(aprx)&lt;BR /&gt;m = aprx_object.listMaps()&lt;BR /&gt;for mp in m:&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;ID = 0&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;mapname = mp.name&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;mp_projection = mp.spatialReference() #&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Oct 2019 06:24:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/modify-map-coordinate-system-with-arcpy-mp/m-p/700445#M30954</guid>
      <dc:creator>JosephMcGehan</dc:creator>
      <dc:date>2019-10-23T06:24:58Z</dc:date>
    </item>
    <item>
      <title>Re: Modify map coordinate system with arcpy.mp?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/modify-map-coordinate-system-with-arcpy-mp/m-p/700446#M30955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can 'get' the spatial reference from a map in the project like this:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;aprx &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ArcGISProject&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"c:\esri\project.aprx"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

maps &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; aprx&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;listMaps&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

map &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; maps&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;dir&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;map&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; 

&lt;SPAN class="comment token"&gt;#...&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;dir&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;getDefinition&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"V2"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;spatialReference&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and, while you cannot 'set' the spatial reference using 'arcpy', you can with a few additional libraries:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; xml&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;etree&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ElementTree &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; ET
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; tempfile
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; os
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; shutil
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; zipfile &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; ZipFile

&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"setting spatial reference"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
output_project &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"MASTER"&lt;/SPAN&gt;
out_dir &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;dirname&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;__file__&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

new_aprx_path &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;out_dir&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; output_project &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"_Project"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; output_project&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;".aprx"&lt;/SPAN&gt;
tempDirMod &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; tempfile&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mkdtemp&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"tempDirMod:"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tempDirMod&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; ZipFile&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;new_aprx_path&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'r'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; zipObj&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
   &lt;SPAN class="comment token"&gt;# Extract all the contents of aprx (zip file) in temporary directory&lt;/SPAN&gt;
   zipObj&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;extractall&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tempDirMod&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

aprx &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ArcGISProject&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;new_aprx_path&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
maps &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; aprx&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;listMaps&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; m &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; maps&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    extracted_map_CIM_path &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; m&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;getDefinition&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"V2"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;uRI &lt;SPAN class="comment token"&gt;#i.e. 'CIMPATH=map11/map11.xml' --&amp;gt; "C:\admin\create_query_layers\MASTER_Project\MASTER\map11\map11.xml"&lt;/SPAN&gt;
    xml_path &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; extracted_map_CIM_path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;split&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"="&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
    this_map_xml &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tempDirMod&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; xml_path&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    
    tree &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ET&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;parse&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;this_map_xml&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    root &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; tree&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;getroot&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
       
    DefaultExtent &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; root&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;find&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"DefaultExtent"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    Xmin &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ET&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SubElement&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;DefaultExtent&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"XMin"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    Xmin&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"-180"&lt;/SPAN&gt;
    Ymin &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ET&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SubElement&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;DefaultExtent&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"YMin"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    Ymin&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"-90"&lt;/SPAN&gt;
    Xmax &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ET&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SubElement&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;DefaultExtent&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"XMax"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    Xmax&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"180"&lt;/SPAN&gt;
    Ymax &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ET&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SubElement&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;DefaultExtent&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"YMax"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    Ymax&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"90"&lt;/SPAN&gt;
    SpatialReference &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ET&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SubElement&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;DefaultExtent&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"SpatialReference"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    SpatialReference&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;set&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"xsi:type"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"typens:GeographicCoordinateSystem"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    WKT &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ET&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SubElement&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SpatialReference&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"WKT"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    WKT&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"GEOGCS[&amp;amp;quot;GCS_WGS_1984&amp;amp;quot;,DATUM[&amp;amp;quot;D_WGS_1984&amp;amp;quot;,SPHEROID[&amp;amp;quot;WGS_1984&amp;amp;quot;,6378137.0,298.257223563]],PRIMEM[&amp;amp;quot;Greenwich&amp;amp;quot;,0.0],UNIT[&amp;amp;quot;Degree&amp;amp;quot;,0.0174532925199433],AUTHORITY[&amp;amp;quot;EPSG&amp;amp;quot;,4326]]"&lt;/SPAN&gt; 
    XOrigin &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ET&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SubElement&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SpatialReference&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"XOrigin"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    XOrigin&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"-400"&lt;/SPAN&gt;
    YOrigin &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ET&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SubElement&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SpatialReference&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"YOrigin"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    YOrigin&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"-400"&lt;/SPAN&gt;
    XYScale &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ET&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SubElement&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SpatialReference&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"XYScale"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    XYScale&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"999999999.99999988"&lt;/SPAN&gt;
    ZOrigin &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ET&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SubElement&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SpatialReference&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"ZOrigin"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    ZOrigin&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"-100000"&lt;/SPAN&gt;
    ZScale &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ET&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SubElement&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SpatialReference&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"ZScale"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    ZScale&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"10000"&lt;/SPAN&gt;
    MOrigin &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ET&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SubElement&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SpatialReference&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"MOrigin"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    MOrigin&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"-100000"&lt;/SPAN&gt;
    MScale &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ET&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SubElement&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SpatialReference&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"MScale"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    MScale&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"10000"&lt;/SPAN&gt;
    XYTolerance &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ET&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SubElement&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SpatialReference&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"XYTolerance"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    XYTolerance&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"8.983152841195215e-09"&lt;/SPAN&gt;
    ZTolerance &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ET&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SubElement&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SpatialReference&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"ZTolerance"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    ZTolerance&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"0.001"&lt;/SPAN&gt;
    MTolerance &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ET&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SubElement&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SpatialReference&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"MTolerance"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    MTolerance&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"0.001"&lt;/SPAN&gt;
    HighPrecision &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ET&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SubElement&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SpatialReference&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"HighPrecision"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    HighPrecision&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"true"&lt;/SPAN&gt;
    LeftLongitude &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ET&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SubElement&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SpatialReference&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"LeftLongitude"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    LeftLongitude&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"-180"&lt;/SPAN&gt;
    WKID &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ET&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SubElement&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SpatialReference&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"WKID"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    WKID&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"4326"&lt;/SPAN&gt;
    LatestWKID &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ET&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SubElement&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SpatialReference&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"LatestWKID"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    LatestWKID&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"4326"&lt;/SPAN&gt;
    
    &lt;SPAN class="comment token"&gt;#IMPORTANT NOTE: if you have no spatial reference in your map yet you will want to append a new Element to the xml (as below).  Otherwise do as above with DefaultExtent where you would find the SpatialRefrence Node and overwrite existing data.&lt;/SPAN&gt;
    SpatialReference2 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;ET&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Element&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"SpatialReference"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    SpatialReference2&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;set&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"xsi:type"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"typens:GeographicCoordinateSystem"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    WKT &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ET&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SubElement&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SpatialReference2&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"WKT"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    WKT&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"GEOGCS[&amp;amp;quot;GCS_WGS_1984&amp;amp;quot;,DATUM[&amp;amp;quot;D_WGS_1984&amp;amp;quot;,SPHEROID[&amp;amp;quot;WGS_1984&amp;amp;quot;,6378137.0,298.257223563]],PRIMEM[&amp;amp;quot;Greenwich&amp;amp;quot;,0.0],UNIT[&amp;amp;quot;Degree&amp;amp;quot;,0.0174532925199433],AUTHORITY[&amp;amp;quot;EPSG&amp;amp;quot;,4326]]"&lt;/SPAN&gt; 
    XOrigin &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ET&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SubElement&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SpatialReference2&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"XOrigin"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    XOrigin&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"-400"&lt;/SPAN&gt;
    YOrigin &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ET&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SubElement&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SpatialReference2&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"YOrigin"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    YOrigin&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"-400"&lt;/SPAN&gt;
    XYScale &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ET&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SubElement&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SpatialReference2&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"XYScale"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    XYScale&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"999999999.99999988"&lt;/SPAN&gt;
    ZOrigin &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ET&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SubElement&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SpatialReference2&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"ZOrigin"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    ZOrigin&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"-100000"&lt;/SPAN&gt;
    ZScale &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ET&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SubElement&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SpatialReference2&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"ZScale"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    ZScale&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"10000"&lt;/SPAN&gt;
    MOrigin &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ET&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SubElement&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SpatialReference2&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"MOrigin"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    MOrigin&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"-100000"&lt;/SPAN&gt;
    MScale &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ET&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SubElement&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SpatialReference2&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"MScale"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    MScale&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"10000"&lt;/SPAN&gt;
    XYTolerance &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ET&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SubElement&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SpatialReference2&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"XYTolerance"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    XYTolerance&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"8.983152841195215e-09"&lt;/SPAN&gt;
    ZTolerance &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ET&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SubElement&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SpatialReference2&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"ZTolerance"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    ZTolerance&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"0.001"&lt;/SPAN&gt;
    MTolerance &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ET&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SubElement&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SpatialReference2&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"MTolerance"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    MTolerance&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"0.001"&lt;/SPAN&gt;
    HighPrecision &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ET&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SubElement&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SpatialReference2&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"HighPrecision"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    HighPrecision&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"true"&lt;/SPAN&gt;
    LeftLongitude &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ET&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SubElement&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SpatialReference2&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"LeftLongitude"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    LeftLongitude&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"-180"&lt;/SPAN&gt;
    WKID &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ET&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SubElement&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SpatialReference2&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"WKID"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    WKID&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"4326"&lt;/SPAN&gt;
    LatestWKID &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ET&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SubElement&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SpatialReference2&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"LatestWKID"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    LatestWKID&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"4326"&lt;/SPAN&gt;
    root&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;append&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SpatialReference2&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="comment token"&gt;#convert xml byte string to string &lt;/SPAN&gt;
    new_xml &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; str&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ET&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;tostring&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;root&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'utf-8'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="comment token"&gt;#write xml over top old file&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; open&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;this_map_xml&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"w"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; xmlW&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="comment token"&gt;#xml 'wrangler' replaces stubborn escaping and quotation types&lt;/SPAN&gt;
        xmlW&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;write&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;new_xml&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;replace&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"&amp;amp;amp;"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"&amp;amp;"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;replace&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'"'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"'"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;


&lt;SPAN class="comment token"&gt;##Delete reference to aprx&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;del&lt;/SPAN&gt; aprx

&lt;SPAN class="comment token"&gt;#rezip everything.   &lt;/SPAN&gt;
shutil&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;make_archive&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;out_dir&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; output_project &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"_Project"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; output_project&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"zip"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; tempDirMod&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;


new_aprx_path_with_sr &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;out_dir&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; output_project &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"_Project"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; output_project &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"_withSR"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;".aprx"&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# rename the .zip file to .aprx&lt;/SPAN&gt;
os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;rename&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;out_dir&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; output_project &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"_Project"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; output_project &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;".zip"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; new_aprx_path_with_sr&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#end set spatial ref&lt;/SPAN&gt;

‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;* i pulled this from a larger project i'm working on and it hasn't been tested in the above state and may need tweeks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:29:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/modify-map-coordinate-system-with-arcpy-mp/m-p/700446#M30955</guid>
      <dc:creator>MaxSquires</dc:creator>
      <dc:date>2021-12-12T05:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: Modify map coordinate system with arcpy.mp?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/modify-map-coordinate-system-with-arcpy-mp/m-p/1059634#M41118</link>
      <description>&lt;P&gt;This is an old thread, but it led me to believe this wasn't possible for a long time.&amp;nbsp; After looking over documentation, I was able to use arcpy to set the spatial reference on the map object.&lt;/P&gt;&lt;P&gt;Something like this works for me:&lt;/P&gt;&lt;DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;mapx&lt;/SPAN&gt;&lt;SPAN&gt;.spatialReference&amp;nbsp;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;arcpy&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;SpatialReference&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;prjFile&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;where mapx is a map object.&amp;nbsp; Hope that helps someone.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 19 May 2021 19:47:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/modify-map-coordinate-system-with-arcpy-mp/m-p/1059634#M41118</guid>
      <dc:creator>RyanDavis1</dc:creator>
      <dc:date>2021-05-19T19:47:51Z</dc:date>
    </item>
    <item>
      <title>Re: Modify map coordinate system with arcpy.mp?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/modify-map-coordinate-system-with-arcpy-mp/m-p/1125186#M48945</link>
      <description>&lt;P&gt;Thanks Ryan, your reply to an old thread saved my bacon!&lt;/P&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:04:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/modify-map-coordinate-system-with-arcpy-mp/m-p/1125186#M48945</guid>
      <dc:creator>DaveTaylor011</dc:creator>
      <dc:date>2021-12-12T03:04:15Z</dc:date>
    </item>
    <item>
      <title>Re: Modify map coordinate system with arcpy.mp?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/modify-map-coordinate-system-with-arcpy-mp/m-p/1128141#M49266</link>
      <description>&lt;P&gt;Thanks for the answer Ryan. This is what my code looks like. Where DEM is the filepath for a layer you want your map to match CRS of.&lt;BR /&gt;&lt;BR /&gt;aprx = arcpy.mp.ArcGISProject("CURRENT")&lt;BR /&gt;mapx = aprx.activeMap&lt;BR /&gt;mapx.spatialReference = arcpy.Describe(DEM).spatialReference&lt;/P&gt;</description>
      <pubDate>Tue, 21 Dec 2021 20:26:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/modify-map-coordinate-system-with-arcpy-mp/m-p/1128141#M49266</guid>
      <dc:creator>ArtK</dc:creator>
      <dc:date>2021-12-21T20:26:45Z</dc:date>
    </item>
  </channel>
</rss>

