<?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: Python API project in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-api-project/m-p/1080159#M61809</link>
    <description>&lt;P&gt;So the first issue is that you should provide wkid's as integers not strings and the second is that find_transformation returns a list of transforms in JSON, but the project function just wants the wkid for the transform.&lt;/P&gt;&lt;P&gt;Here's some code with outputs showing all the projections you were after. It's a bit more complicated than it needs to be because it is getting the transformation using the from and to SR, then programatically extracting the wkid for the transform. It's way easier just to have a cheatsheet with all your wkid's and directly enter the ones you need.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS
from arcgis.geometry import Point, project, find_transformation
gis = GIS('home')

#Create a point in web mercator coordinates
ptwebm = Point({"x" : 17041106.13569748, "y" : -3183137.706970891})
srwebm = 3857

#Project point from Web Mercator to WGS84 (no transformation required)
srout = 4326
result = project(geometries = [ptwebm], in_sr = srwebm, out_sr = srout)
print("Projected Point: " + str(result))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Projected Point: [{'x': 153.08286100000004, 'y': -27.476550999999997, 'spatialReference': {'wkid': 4326, 'latestWkid': 4326}}]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;#Project point from Web Mercator to GDA94
srout = 4283
transforms=find_transformation(in_sr = srwebm, out_sr = srout)
print("Transforms: " + str(transforms))
srtransform=transforms['transformations'][0]['geoTransforms'][0]['latestWkid']
print("Selected Transform Wkid: " + str(srtransform))
result = project(geometries = [ptwebm], in_sr = srwebm, out_sr = srout, transformation = srtransform)
print("Projected Point: " + str(result))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Transforms: {'transformations': [{'geoTransforms': [{'wkid': 8050, 'latestWkid': 1150, 'transformForward': False, 'name': 'GDA_1994_To_WGS_1984'}]}]}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Selected Transform Wkid: 1150&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Projected Point: [{'x': 153.08286100000004, 'y': -27.476550999227037, 'spatialReference': {'wkid': 4283, 'latestWkid': 4283}}]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;#Project point from Web Mercator to MGA Zone 56
srout = 28356
transforms=find_transformation(in_sr = srwebm, out_sr = srout)
print("Transforms: " + str(transforms))
srtransform=transforms['transformations'][0]['geoTransforms'][0]['latestWkid']
print("Selected Transform Wkid: " + str(srtransform))
result = project(geometries = [ptwebm], in_sr = srwebm, out_sr = srout, transformation = srtransform)
print("Projected Point: " + str(result))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Transforms: {'transformations': [{'geoTransforms': [{'wkid': 8050, 'latestWkid': 1150, 'transformForward': False, 'name': 'GDA_1994_To_WGS_1984'}]}]}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Selected Transform Wkid: 1150&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Projected Point: [{'x': 508186.1329199932, 'y': 6960777.826612913, 'spatialReference': {'wkid': 28356, 'latestWkid': 28356}}]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 19 Jul 2021 08:47:10 GMT</pubDate>
    <dc:creator>Tim_McGinnes</dc:creator>
    <dc:date>2021-07-19T08:47:10Z</dc:date>
    <item>
      <title>Python API project</title>
      <link>https://community.esri.com/t5/python-questions/python-api-project/m-p/1080151#M61808</link>
      <description>&lt;P&gt;Could someone please provide an example of how to use this python function. I am unable to get it to work with a transformation. Ideally from Web Mercator to GDA lat long, Web Mercator&amp;nbsp; to WGS84 lat long and Web Mercator&amp;nbsp; to GDA94 MGA56&lt;/P&gt;&lt;P&gt;transformations = geometry.find_transformation(&lt;BR /&gt;in_sr=from_SR,&lt;BR /&gt;out_sr=toSR,&lt;BR /&gt;#extent_of_interest=self.in_extent&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;result = geometry.project(geometries = input_geom, in_sr = from_SR, out_sr = toSR, transform = transformations)&lt;/P&gt;&lt;P&gt;toSR= '4326' #WGS84 or&amp;nbsp;&lt;BR /&gt;toSR= '28356' #MGA 56&lt;/P&gt;&lt;P&gt;from_SR comes from the data and is&amp;nbsp;&lt;/P&gt;&lt;P&gt;spatialReference': {'wkid': 102100, 'latestWkid': 3857} I plug in 3857&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jul 2021 07:14:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-api-project/m-p/1080151#M61808</guid>
      <dc:creator>MeToo2</dc:creator>
      <dc:date>2021-07-19T07:14:38Z</dc:date>
    </item>
    <item>
      <title>Re: Python API project</title>
      <link>https://community.esri.com/t5/python-questions/python-api-project/m-p/1080159#M61809</link>
      <description>&lt;P&gt;So the first issue is that you should provide wkid's as integers not strings and the second is that find_transformation returns a list of transforms in JSON, but the project function just wants the wkid for the transform.&lt;/P&gt;&lt;P&gt;Here's some code with outputs showing all the projections you were after. It's a bit more complicated than it needs to be because it is getting the transformation using the from and to SR, then programatically extracting the wkid for the transform. It's way easier just to have a cheatsheet with all your wkid's and directly enter the ones you need.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS
from arcgis.geometry import Point, project, find_transformation
gis = GIS('home')

#Create a point in web mercator coordinates
ptwebm = Point({"x" : 17041106.13569748, "y" : -3183137.706970891})
srwebm = 3857

#Project point from Web Mercator to WGS84 (no transformation required)
srout = 4326
result = project(geometries = [ptwebm], in_sr = srwebm, out_sr = srout)
print("Projected Point: " + str(result))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Projected Point: [{'x': 153.08286100000004, 'y': -27.476550999999997, 'spatialReference': {'wkid': 4326, 'latestWkid': 4326}}]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;#Project point from Web Mercator to GDA94
srout = 4283
transforms=find_transformation(in_sr = srwebm, out_sr = srout)
print("Transforms: " + str(transforms))
srtransform=transforms['transformations'][0]['geoTransforms'][0]['latestWkid']
print("Selected Transform Wkid: " + str(srtransform))
result = project(geometries = [ptwebm], in_sr = srwebm, out_sr = srout, transformation = srtransform)
print("Projected Point: " + str(result))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Transforms: {'transformations': [{'geoTransforms': [{'wkid': 8050, 'latestWkid': 1150, 'transformForward': False, 'name': 'GDA_1994_To_WGS_1984'}]}]}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Selected Transform Wkid: 1150&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Projected Point: [{'x': 153.08286100000004, 'y': -27.476550999227037, 'spatialReference': {'wkid': 4283, 'latestWkid': 4283}}]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;#Project point from Web Mercator to MGA Zone 56
srout = 28356
transforms=find_transformation(in_sr = srwebm, out_sr = srout)
print("Transforms: " + str(transforms))
srtransform=transforms['transformations'][0]['geoTransforms'][0]['latestWkid']
print("Selected Transform Wkid: " + str(srtransform))
result = project(geometries = [ptwebm], in_sr = srwebm, out_sr = srout, transformation = srtransform)
print("Projected Point: " + str(result))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Transforms: {'transformations': [{'geoTransforms': [{'wkid': 8050, 'latestWkid': 1150, 'transformForward': False, 'name': 'GDA_1994_To_WGS_1984'}]}]}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Selected Transform Wkid: 1150&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Projected Point: [{'x': 508186.1329199932, 'y': 6960777.826612913, 'spatialReference': {'wkid': 28356, 'latestWkid': 28356}}]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jul 2021 08:47:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-api-project/m-p/1080159#M61809</guid>
      <dc:creator>Tim_McGinnes</dc:creator>
      <dc:date>2021-07-19T08:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: Python API project</title>
      <link>https://community.esri.com/t5/python-questions/python-api-project/m-p/1080177#M61810</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Does the following help at all?&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis import geometry
from arcgis.gis import GIS

gis = GIS("home")

point = [{"x": 12797393.0236, 
          "y": -3693437.2067}, 
         {"x": 12303304.0728, 
          "y": -3681207.2822}]

transformations_list = geometry.find_transformation(in_sr = 102100,
                                                    out_sr = 28356)

print(transformations_list)

selected_transform = transformations_list['transformations'][0]['geoTransforms'][0]['wkid']

result = geometry.project(geometries = point,
                          in_sr = 102100,
                          out_sr = 28356,
                          transformation = selected_transform)

print(result)&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 19 Jul 2021 10:23:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-api-project/m-p/1080177#M61810</guid>
      <dc:creator>HamishMorton</dc:creator>
      <dc:date>2021-07-19T10:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: Python API project</title>
      <link>https://community.esri.com/t5/python-questions/python-api-project/m-p/1082610#M61856</link>
      <description>&lt;P&gt;Hi Hamish, thanks for your response. setting out the selected_transformation was a great help. Also clouding matters was a weird corruption error for my global constant for srout (in my code). This initially this was a string and I swear blind was working previously. I changed this to a int (as you had it in your code, but was still being corrupted by time of use). I had to cast this as an int in my function and it now works.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jul 2021 06:10:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-api-project/m-p/1082610#M61856</guid>
      <dc:creator>MeToo2</dc:creator>
      <dc:date>2021-07-26T06:10:56Z</dc:date>
    </item>
  </channel>
</rss>

