<?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 Adjusting properties on the SpatialReference class in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/adjusting-properties-on-the-spatialreference-class/m-p/509850#M40039</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;I'm trying to adjust the SpatialReference using the SpatialReference class, but it doesn't seem to be working. In my example i'm trying to adjust the centralMeridian, but the final output still has the original value of -96.0.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anybody has an idea how to make this work ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; Here is my example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#!/usr/bin/env python&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy, sys&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Output_Spatial_Reference = "PROJCS['North_America_Lambert_Conformal_Conic',GEOGCS['GCS_North_American_1983',DATUM['D_North_American_1983',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Lambert_Conformal_Conic'],PARAMETER['False_Easting',0.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',-96.0],PARAMETER['Standard_Parallel_1',20.0],PARAMETER['Standard_Parallel_2',60.0],PARAMETER['Latitude_Of_Origin',40.0],UNIT['Meter',1.0]];-35214300 -28218500 10000;-100000 10000;-100000 10000;0.001;0.001;0.001;IsHighPrecision"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;sr = arcpy.SpatialReference()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;sr.loadFromString(Output_Spatial_Reference)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;sr.centralMeridian = 10.0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;result = sr.exportToString()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;print "printing result:"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;print result&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Apr 2012 12:57:55 GMT</pubDate>
    <dc:creator>BKuiper</dc:creator>
    <dc:date>2012-04-06T12:57:55Z</dc:date>
    <item>
      <title>Adjusting properties on the SpatialReference class</title>
      <link>https://community.esri.com/t5/python-questions/adjusting-properties-on-the-spatialreference-class/m-p/509850#M40039</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;I'm trying to adjust the SpatialReference using the SpatialReference class, but it doesn't seem to be working. In my example i'm trying to adjust the centralMeridian, but the final output still has the original value of -96.0.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anybody has an idea how to make this work ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; Here is my example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#!/usr/bin/env python&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy, sys&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Output_Spatial_Reference = "PROJCS['North_America_Lambert_Conformal_Conic',GEOGCS['GCS_North_American_1983',DATUM['D_North_American_1983',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Lambert_Conformal_Conic'],PARAMETER['False_Easting',0.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',-96.0],PARAMETER['Standard_Parallel_1',20.0],PARAMETER['Standard_Parallel_2',60.0],PARAMETER['Latitude_Of_Origin',40.0],UNIT['Meter',1.0]];-35214300 -28218500 10000;-100000 10000;-100000 10000;0.001;0.001;0.001;IsHighPrecision"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;sr = arcpy.SpatialReference()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;sr.loadFromString(Output_Spatial_Reference)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;sr.centralMeridian = 10.0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;result = sr.exportToString()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;print "printing result:"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;print result&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Apr 2012 12:57:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/adjusting-properties-on-the-spatialreference-class/m-p/509850#M40039</guid>
      <dc:creator>BKuiper</dc:creator>
      <dc:date>2012-04-06T12:57:55Z</dc:date>
    </item>
    <item>
      <title>Re: Adjusting properties on the SpatialReference class</title>
      <link>https://community.esri.com/t5/python-questions/adjusting-properties-on-the-spatialreference-class/m-p/509851#M40040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;have you tried &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;sr.centralMeridianInDegrees = 10.0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Apr 2012 14:25:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/adjusting-properties-on-the-spatialreference-class/m-p/509851#M40040</guid>
      <dc:creator>markdenil</dc:creator>
      <dc:date>2012-04-06T14:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: Adjusting properties on the SpatialReference class</title>
      <link>https://community.esri.com/t5/python-questions/adjusting-properties-on-the-spatialreference-class/m-p/509852#M40041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;have you tried &lt;BR /&gt;sr.centralMeridianInDegrees = 10.0&lt;BR /&gt;?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Good idea, but that doesn't work as well.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried two different approaches, but it doesn't seem to work. Anybody has some ideas on what is going wrong?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;here is my updated script&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;#!/usr/bin/env python

import arcpy, sys

# using existing string
Output_Spatial_Reference = "PROJCS['North_America_Lambert_Conformal_Conic',GEOGCS['GCS_North_American_1983',DATUM['D_North_American_1983',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Lambert_Conformal_Conic'],PARAMETER['False_Easting',0.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',-96.0],PARAMETER['Standard_Parallel_1',20.0],PARAMETER['Standard_Parallel_2',60.0],PARAMETER['Latitude_Of_Origin',40.0],UNIT['Meter',1.0]];-35214300 -28218500 10000;-100000 10000;-100000 10000;0.001;0.001;0.001;IsHighPrecision"

sr = arcpy.SpatialReference()
sr.loadFromString(Output_Spatial_Reference)
sr.centralMeridian = -10.0
sr.centralMeridianInDegrees = -10.0
result = sr.exportToString()

print "printing result:"
print result

# using factory code

sr = arcpy.SpatialReference()
sr.factoryCode = 102009
sr.centralMeridian = -10.0
sr.centralMeridianInDegrees = -10.0
sr.create()

result = sr.exportToString()

print "printing result:"
print result&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;btw: i'm using Desktop 10.1 Prerelease, ArcObjects SDK .NET 10.1 Prerelease and ArcGIS Runtime BETA 2.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:19:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/adjusting-properties-on-the-spatialreference-class/m-p/509852#M40041</guid>
      <dc:creator>BKuiper</dc:creator>
      <dc:date>2021-12-11T22:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: Adjusting properties on the SpatialReference class</title>
      <link>https://community.esri.com/t5/python-questions/adjusting-properties-on-the-spatialreference-class/m-p/509853#M40042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It seems that another user had the same problem in 2007, but no solution is given&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.esri.com/Thread.asp?c=93&amp;amp;f=984&amp;amp;t=231893"&gt;http://forums.esri.com/Thread.asp?c=93&amp;amp;f=984&amp;amp;t=231893&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Apr 2012 12:30:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/adjusting-properties-on-the-spatialreference-class/m-p/509853#M40042</guid>
      <dc:creator>BKuiper</dc:creator>
      <dc:date>2012-04-09T12:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: Adjusting properties on the SpatialReference class</title>
      <link>https://community.esri.com/t5/python-questions/adjusting-properties-on-the-spatialreference-class/m-p/509854#M40043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Found another post. This might exactly explain it:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/32731-Modify-Spatial-Reference-Object"&gt;http://forums.arcgis.com/threads/32731-Modify-Spatial-Reference-Object&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;parameters are documented as read/write but are exactly only read. I guess the arcpy team should update the documentation or help me provide a working example.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Apr 2012 12:39:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/adjusting-properties-on-the-spatialreference-class/m-p/509854#M40043</guid>
      <dc:creator>BKuiper</dc:creator>
      <dc:date>2012-04-09T12:39:48Z</dc:date>
    </item>
    <item>
      <title>Re: Adjusting properties on the SpatialReference class</title>
      <link>https://community.esri.com/t5/python-questions/adjusting-properties-on-the-spatialreference-class/m-p/509855#M40044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;So can anybody from the arcpy team confirm my findings?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It seems that these settings are only read-only, although they are marked read/write in the documentation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It would be really helpful if these settings where actually read/write.&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>Tue, 10 Apr 2012 15:59:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/adjusting-properties-on-the-spatialreference-class/m-p/509855#M40044</guid>
      <dc:creator>BKuiper</dc:creator>
      <dc:date>2012-04-10T15:59:23Z</dc:date>
    </item>
    <item>
      <title>Re: Adjusting properties on the SpatialReference class</title>
      <link>https://community.esri.com/t5/python-questions/adjusting-properties-on-the-spatialreference-class/m-p/509856#M40045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How has such an old problem persisted to Arc Pro documentation? Can anyone from Esri answer this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Apr 2019 22:12:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/adjusting-properties-on-the-spatialreference-class/m-p/509856#M40045</guid>
      <dc:creator>MarcHunter1</dc:creator>
      <dc:date>2019-04-04T22:12:24Z</dc:date>
    </item>
  </channel>
</rss>

