<?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: Extract Spatial Reference of Shapefile Using API for Python in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/extract-spatial-reference-of-shapefile-using-api/m-p/1261342#M8403</link>
    <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous User&amp;nbsp;&lt;/P&gt;&lt;P&gt;The below assumes the shapefile is available in AGOL.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Clubdebambos_0-1677231592173.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/63641iE24639A1D730218C/image-size/large?v=v2&amp;amp;px=999" role="button" title="Clubdebambos_0-1677231592173.png" alt="Clubdebambos_0-1677231592173.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Use the shapefile item id&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Clubdebambos_1-1677231650908.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/63642i3209C87D2C46EA1D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Clubdebambos_1-1677231650908.png" alt="Clubdebambos_1-1677231650908.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS

## connect to agol
agol = GIS("Your AGOL URL", "username", "password")

## access the shapefile item
item = agol.content.get("shapefile_item_id_in_agol")

## print the spatial reference
print(item["spatialReference"])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 24 Feb 2023 09:41:17 GMT</pubDate>
    <dc:creator>Clubdebambos</dc:creator>
    <dc:date>2023-02-24T09:41:17Z</dc:date>
    <item>
      <title>Extract Spatial Reference of Shapefile Using API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/extract-spatial-reference-of-shapefile-using-api/m-p/1261034#M8399</link>
      <description>&lt;P&gt;Hello Esri Community,&lt;/P&gt;&lt;P&gt;I'm working on a project where a user submits a shapefile to a website and among other things, the spatial reference of that shapefile will be stored.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any way I can extract the spatial reference of that submitted shapefile? Since we're not using ArcMap nor ArcPro, we can't use arcpy unfortunately - It must be done through API for Python.&lt;/P&gt;&lt;P&gt;Attached below is a sample zipped shapefile that I'm currently working on.&lt;/P&gt;&lt;P&gt;Any help on this is greatly appreciated!&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mina&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2023 18:04:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/extract-spatial-reference-of-shapefile-using-api/m-p/1261034#M8399</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2023-02-23T18:04:35Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Spatial Reference of Shapefile Using API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/extract-spatial-reference-of-shapefile-using-api/m-p/1261342#M8403</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous User&amp;nbsp;&lt;/P&gt;&lt;P&gt;The below assumes the shapefile is available in AGOL.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Clubdebambos_0-1677231592173.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/63641iE24639A1D730218C/image-size/large?v=v2&amp;amp;px=999" role="button" title="Clubdebambos_0-1677231592173.png" alt="Clubdebambos_0-1677231592173.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Use the shapefile item id&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Clubdebambos_1-1677231650908.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/63642i3209C87D2C46EA1D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Clubdebambos_1-1677231650908.png" alt="Clubdebambos_1-1677231650908.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS

## connect to agol
agol = GIS("Your AGOL URL", "username", "password")

## access the shapefile item
item = agol.content.get("shapefile_item_id_in_agol")

## print the spatial reference
print(item["spatialReference"])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2023 09:41:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/extract-spatial-reference-of-shapefile-using-api/m-p/1261342#M8403</guid>
      <dc:creator>Clubdebambos</dc:creator>
      <dc:date>2023-02-24T09:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Spatial Reference of Shapefile Using API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/extract-spatial-reference-of-shapefile-using-api/m-p/1262693#M8430</link>
      <description>&lt;P&gt;Isn't the projection info found in the&amp;nbsp;SitesForDemo_NAD83_Snapped.prj file that's packaged up in the zip file? I guess without arcpy you would have to temporarily unzip that file and read thru it to locate:&amp;nbsp;PROJCS ["NAD_1983_2011_UTM_Zone_11N"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, there's nothing that says/guarantees that what is being uploaded will contain that .prj file and you would have to handle that in your code.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 20:18:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/extract-spatial-reference-of-shapefile-using-api/m-p/1262693#M8430</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2023-02-28T20:18:08Z</dc:date>
    </item>
  </channel>
</rss>

