<?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: Transform XY coordinate to WGS84 lat, long in a spatially enabled dataframe in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/transform-xy-coordinate-to-wgs84-lat-long-in-a/m-p/1099816#M6664</link>
    <description>&lt;P&gt;This is really interesting &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/43250"&gt;@MehdiPira1&lt;/a&gt;&amp;nbsp;, thank you!&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to do something similar where the SDF doesn't exist as a feature layer? Basically I would like to work with my data only in my notebook as i have a number of data analysis to do before I publish out a "final" dataset to a feature layer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was building on the work in this post -&amp;nbsp;&lt;A title="ArcGIS API for Python - geometry.project" href="https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-api-for-python-geometry-project/td-p/837659" target="_self"&gt;ArcGIS API for Python - geometry.project&lt;/A&gt;&amp;nbsp;as below, but it would be great rather than transform the coordinates in this way, we could transform the SHAPE to lat/long without the need for an "existing" dataset or feature layer.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;input_geoms = [{"x": -17568824.55, "y": 2428377.35}, {"x": -17568456.88, "y": 2428431.352}]
result = project(geometries=input_geoms, in_sr=3857, out_sr=4326)
result&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 20 Sep 2021 09:40:07 GMT</pubDate>
    <dc:creator>markjones6</dc:creator>
    <dc:date>2021-09-20T09:40:07Z</dc:date>
    <item>
      <title>Transform XY coordinate to WGS84 lat, long in a spatially enabled dataframe</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/transform-xy-coordinate-to-wgs84-lat-long-in-a/m-p/1099575#M6657</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;As part of my python script, I have a spatially enabled data frame with ~1000 points in OSGB (EPSG:27700) X,Y which i would like to convert to WGS84 lat, long.&amp;nbsp; Is there a way, using the ArcGIS API for Python, to transform the OSGB XY coordinates to Lat/Long?&amp;nbsp; Or to transform the SHAPE field of the SDF from OSGB to WGS84?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Sat, 18 Sep 2021 00:46:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/transform-xy-coordinate-to-wgs84-lat-long-in-a/m-p/1099575#M6657</guid>
      <dc:creator>markjones6</dc:creator>
      <dc:date>2021-09-18T00:46:44Z</dc:date>
    </item>
    <item>
      <title>Re: Transform XY coordinate to WGS84 lat, long in a spatially enabled dataframe</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/transform-xy-coordinate-to-wgs84-lat-long-in-a/m-p/1099587#M6658</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/249381"&gt;@markjones6&lt;/a&gt;&amp;nbsp;is there any reason why you can't just use arcpy.&lt;/P&gt;&lt;PRE&gt;arcpy.management.Project(in_dataset, out_dataset)&lt;/PRE&gt;&lt;P&gt;to repoject from OSGB to WGS84?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Sep 2021 06:23:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/transform-xy-coordinate-to-wgs84-lat-long-in-a/m-p/1099587#M6658</guid>
      <dc:creator>David_Brooks</dc:creator>
      <dc:date>2021-09-18T06:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: Transform XY coordinate to WGS84 lat, long in a spatially enabled dataframe</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/transform-xy-coordinate-to-wgs84-lat-long-in-a/m-p/1099642#M6660</link>
      <description>&lt;P&gt;Is it possible to use arcpy.management.Project whilst keeping all the data as a SDF?&amp;nbsp; My input data only exists in a SDF and I'd like to keep the output as a SDF to perform some additional processing before exporting out to a feature class.&lt;/P&gt;</description>
      <pubDate>Sat, 18 Sep 2021 23:52:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/transform-xy-coordinate-to-wgs84-lat-long-in-a/m-p/1099642#M6660</guid>
      <dc:creator>markjones6</dc:creator>
      <dc:date>2021-09-18T23:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: Transform XY coordinate to WGS84 lat, long in a spatially enabled dataframe</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/transform-xy-coordinate-to-wgs84-lat-long-in-a/m-p/1099732#M6662</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/249381"&gt;@markjones6&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;The following script projects an SDF into a WGS84 lat long SDF:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis import GIS
gis = GIS('AGOL or Portal url', 'username', 'password')
# let's say you create an SDF from a feature layer first
item = gis.content.search("title: featureLyr")[0]
flayer = item.layers[0]
fset = flayer.query()
# project using WGS84 epsg code in the feature set
sdf_WGS84 = flayer.query(out_sr=4326).sdf
sdf_WGS84.head()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Now if you check the SHAPE you should see the coordinates in lat and long format.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MehdiPira1_1-1632102830560.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/23345i2F0D1FD78361E853/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MehdiPira1_1-1632102830560.png" alt="MehdiPira1_1-1632102830560.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;------------------------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Please give a like if you find it helpful. If it answered your question please accept as solution.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Sep 2021 02:01:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/transform-xy-coordinate-to-wgs84-lat-long-in-a/m-p/1099732#M6662</guid>
      <dc:creator>MehdiPira1</dc:creator>
      <dc:date>2021-09-20T02:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: Transform XY coordinate to WGS84 lat, long in a spatially enabled dataframe</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/transform-xy-coordinate-to-wgs84-lat-long-in-a/m-p/1099816#M6664</link>
      <description>&lt;P&gt;This is really interesting &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/43250"&gt;@MehdiPira1&lt;/a&gt;&amp;nbsp;, thank you!&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to do something similar where the SDF doesn't exist as a feature layer? Basically I would like to work with my data only in my notebook as i have a number of data analysis to do before I publish out a "final" dataset to a feature layer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was building on the work in this post -&amp;nbsp;&lt;A title="ArcGIS API for Python - geometry.project" href="https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-api-for-python-geometry-project/td-p/837659" target="_self"&gt;ArcGIS API for Python - geometry.project&lt;/A&gt;&amp;nbsp;as below, but it would be great rather than transform the coordinates in this way, we could transform the SHAPE to lat/long without the need for an "existing" dataset or feature layer.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;input_geoms = [{"x": -17568824.55, "y": 2428377.35}, {"x": -17568456.88, "y": 2428431.352}]
result = project(geometries=input_geoms, in_sr=3857, out_sr=4326)
result&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Sep 2021 09:40:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/transform-xy-coordinate-to-wgs84-lat-long-in-a/m-p/1099816#M6664</guid>
      <dc:creator>markjones6</dc:creator>
      <dc:date>2021-09-20T09:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: Transform XY coordinate to WGS84 lat, long in a spatially enabled dataframe</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/transform-xy-coordinate-to-wgs84-lat-long-in-a/m-p/1100163#M6670</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/249381"&gt;@markjones6&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Then the code snippet below is the way to follow:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis import geometry

# access the SHAPE field in your SDF and create a list
shape_list=[row.rings[0] for row in rows.SHAPE]
# do the projection on the list
for shape in shape_list:
    result = geometry.project(geometries=shape, in_sr=3857, out_sr=4326)
    print(result)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bear in mind that this is based on the format below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MehdiPira1_1-1632188447031.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/23435i497ED28AB695CD74/image-size/large?v=v2&amp;amp;px=999" role="button" title="MehdiPira1_1-1632188447031.png" alt="MehdiPira1_1-1632188447031.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;if you couldn't get it to work, I need to see a sample of your SDF to check the format.&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Sep 2021 01:43:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/transform-xy-coordinate-to-wgs84-lat-long-in-a/m-p/1100163#M6670</guid>
      <dc:creator>MehdiPira1</dc:creator>
      <dc:date>2021-09-21T01:43:57Z</dc:date>
    </item>
    <item>
      <title>Re: Transform XY coordinate to WGS84 lat, long in a spatially enabled dataframe</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/transform-xy-coordinate-to-wgs84-lat-long-in-a/m-p/1103259#M6691</link>
      <description>&lt;P&gt;Hi, sorry for taking a while to reply, but thank you for your advice, it led me to a solution that's worked for my purposes.&lt;/P&gt;&lt;P&gt;What I did was to create a dictionary from my x,y columns and use the following to transform from OSGB to WGS84:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;gis = GIS()
wgs84_coords_dict = project(geometries = osgb_coords_dict, in_sr=27700, out_sr=4326, transformation=1314)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;This creates a new coordinate dictionary - &lt;EM&gt;&lt;STRONG&gt;wgs84_coords_dict&lt;/STRONG&gt;, which can then by merged with the remainder of the dataframe.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Sep 2021 20:06:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/transform-xy-coordinate-to-wgs84-lat-long-in-a/m-p/1103259#M6691</guid>
      <dc:creator>markjones6</dc:creator>
      <dc:date>2021-09-29T20:06:38Z</dc:date>
    </item>
  </channel>
</rss>

