<?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: Convert lat-long to WKT spatial reference? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/convert-lat-long-to-wkt-spatial-reference/m-p/508803#M39968</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Randy, how can I take x,y coordinates from featureclass? Because I don`t have xy values in code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 May 2017 08:34:21 GMT</pubDate>
    <dc:creator>JohnMcoy</dc:creator>
    <dc:date>2017-05-02T08:34:21Z</dc:date>
    <item>
      <title>Convert lat-long to WKT spatial reference?</title>
      <link>https://community.esri.com/t5/python-questions/convert-lat-long-to-wkt-spatial-reference/m-p/508786#M39951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&amp;nbsp; arcpy newbie here... sorry if I am asking a basic question.&amp;nbsp; I am looking for help on transforming lat/long decimal degrees to a different spatial reference, specifically a well-known-text (WKT) custom reference that we are using.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have sent a street address to an address locator (findAddressCandidates) and it returns JSON back to me.&amp;nbsp; If the candidate score is near 100, then I parse the JSON to grab the lat/long.&amp;nbsp; That all works fine.&amp;nbsp; But, now I would like to use an insertCursor to add this point to my feature class.&amp;nbsp; I am unclear how I would convert a lat long to the custom spatial ref., WKT? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have been trying many different things in the past few days but nothing works for me.&amp;nbsp; I have tried passing the WKT in the URL for the address locator.&amp;nbsp; It seems like the locator does not recognize the WKT and converts it to the default 4326 spatial reference (not what I want).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FYI.. this is the custom spatial reference that I am using:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #3334ca;"&gt;PROJCS["NAD_1983_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",1840330.965],PARAMETER["False_Northing",527997.6316666666],PARAMETER["Central_Meridian",-92.0],PARAMETER["Standard_Parallel_1",41.15],PARAMETER["Standard_Parallel_2",45.0],PARAMETER["Latitude_Of_Origin",40.15],UNIT["Foot_US",0.3048006096012192]]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, --Rick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Feb 2016 22:34:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-lat-long-to-wkt-spatial-reference/m-p/508786#M39951</guid>
      <dc:creator>RickThiel</dc:creator>
      <dc:date>2016-02-15T22:34:35Z</dc:date>
    </item>
    <item>
      <title>Re: Convert lat-long to WKT spatial reference?</title>
      <link>https://community.esri.com/t5/python-questions/convert-lat-long-to-wkt-spatial-reference/m-p/508787#M39952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you still have to project from your initial coordinate system to your desired on...&lt;/P&gt;&lt;P&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/project.htm" title="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/project.htm"&gt;Project—Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;see the code snippet&lt;/P&gt;&lt;P&gt;However in the geometry classes, WKT etc are read-only properties&lt;/P&gt;&lt;P&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-classes/geometry.htm" title="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-classes/geometry.htm"&gt;Geometry—Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;but once projected, you can get it back out to JSON&lt;/P&gt;&lt;P&gt;but a simpler solution would be just to use the PointGeometry class and snag the point coordinates after&amp;nbsp; they are projected if all you need to know is the values&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Feb 2016 00:00:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-lat-long-to-wkt-spatial-reference/m-p/508787#M39952</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-02-16T00:00:14Z</dc:date>
    </item>
    <item>
      <title>Re: Convert lat-long to WKT spatial reference?</title>
      <link>https://community.esri.com/t5/python-questions/convert-lat-long-to-wkt-spatial-reference/m-p/508788#M39953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Dan for pointing me in the right direction. The example on the ESRI help page shows that when they Project a point, they immediately save it to an output feature class.&amp;nbsp; Is there any way to project the point feature on the fly without having to save it to an output file/db?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, the geo-coder returns a point with coordinates &lt;STRONG&gt;x=-90.079346, y=42.718911&lt;/STRONG&gt;&amp;nbsp; (spatial ref = 4326).&amp;nbsp; Could I take those coordinates and project them on the fly to return the true coordinates that I want?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Feb 2016 22:24:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-lat-long-to-wkt-spatial-reference/m-p/508788#M39953</guid>
      <dc:creator>RickThiel</dc:creator>
      <dc:date>2016-02-17T22:24:46Z</dc:date>
    </item>
    <item>
      <title>Re: Convert lat-long to WKT spatial reference?</title>
      <link>https://community.esri.com/t5/python-questions/convert-lat-long-to-wkt-spatial-reference/m-p/508789#M39954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;of course&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the PointGeometry class &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-classes/pointgeometry.htm" title="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-classes/pointgeometry.htm"&gt;PointGeometry—Help | ArcGIS for Desktop&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a PointGeometry object needs a point (long story), so you are there. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE class="arcpyclass_methodsigtbl" style="margin-bottom: 1.5em; font-size: 0.875em; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif; background-color: white; border: 1px solid #dddddd; color: #4d4d4d;"&gt;&lt;TBODY&gt;&lt;TR style="border-bottom-width: 1px; border-bottom-color: #dddddd;"&gt;&lt;TD style="border-left-width: 1px; border-left-style: solid; border-left-color: #dddddd; border-right-width: 1px; border-right-style: solid; border-right-color: #dddddd; padding: 12px;"&gt;projectAs (spatial_reference, {transformation_name})&lt;/TD&gt;&lt;TD style="border-left-width: 1px; border-left-style: solid; border-left-color: #dddddd; border-right-width: 1px; border-right-style: solid; border-right-color: #dddddd; padding: 12px;"&gt;&lt;P style="font-size: 0.875rem;"&gt;Projects a geometry and optionally applies a geotransformation.&lt;/P&gt;&lt;P style="font-size: 0.875rem; margin-top: 1.71429em;"&gt;To project, the geometry needs to have a spatial reference, and not have an &lt;SPAN class="arcpyref" style="font-family: Consolas, 'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier, monospace; font-weight: bold;"&gt;UnknownCoordinateSystem&lt;/SPAN&gt;. The new spatial reference system passed to the method defines the output coordinate system. If either spatial reference is unknown the coordinates will not be changed. The Z- and measure values are not changed by the &lt;SPAN class="arcpyref" style="font-family: Consolas, 'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier, monospace; font-weight: bold;"&gt;ProjectAs&lt;/SPAN&gt; method.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Feb 2016 22:39:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-lat-long-to-wkt-spatial-reference/m-p/508789#M39954</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-02-17T22:39:11Z</dc:date>
    </item>
    <item>
      <title>Re: Convert lat-long to WKT spatial reference?</title>
      <link>https://community.esri.com/t5/python-questions/convert-lat-long-to-wkt-spatial-reference/m-p/508790#M39955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, I think I understand.&amp;nbsp; But, because I am using a custom projection, won't that be a problem?&amp;nbsp; In the projectAs() method, it says &lt;EM&gt;"&lt;SPAN style="font-size: 10.5pt; font-family: 'Segoe UI','sans-serif'; color: #4d4d4d;"&gt;To project, the geometry needs to have a spatial reference, and not have an &lt;/SPAN&gt;&lt;SPAN class="arcpyref"&gt;&lt;STRONG style="color: #4d4d4d; font-size: 10.5pt; font-family: Consolas;"&gt;UnknownCoordinateSystem&lt;/STRONG&gt;&lt;/SPAN&gt;"&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Feb 2016 22:48:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-lat-long-to-wkt-spatial-reference/m-p/508790#M39955</guid>
      <dc:creator>RickThiel</dc:creator>
      <dc:date>2016-02-17T22:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: Convert lat-long to WKT spatial reference?</title>
      <link>https://community.esri.com/t5/python-questions/convert-lat-long-to-wkt-spatial-reference/m-p/508791#M39956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;but you do have a spatial reference in your example from the geocoder...&amp;nbsp; 4326 by the coordinates.&amp;nbsp; That I presume is what they are coming in as...define it as such, then set the output projection&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Feb 2016 22:52:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-lat-long-to-wkt-spatial-reference/m-p/508791#M39956</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-02-17T22:52:40Z</dc:date>
    </item>
    <item>
      <title>Re: Convert lat-long to WKT spatial reference?</title>
      <link>https://community.esri.com/t5/python-questions/convert-lat-long-to-wkt-spatial-reference/m-p/508792#M39957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since I've been working on something similar the past couple days (not the json part), I'll throw this out there.&amp;nbsp; I'm not sure how you parsed your lat, longs, but this assuming a PtID, long, lat like&lt;/P&gt;&lt;P&gt;ptList = [[104, -148.631196, 64.010037], [102, -147.707779, 63.680584], [103, -147.469019, 63.975227]]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This script will take a structure like that, create a FC in DD, add the x/y as fields for kicks, then project to you desired wkid (mine is 3338, AK Albers).&amp;nbsp; I have also used AlterField (not shown here) on the field POINT_X, POINT_Y so I could use the addxy again in the projected FC (and a bunch of other fields).&amp;nbsp; If you don't have a PtID field,m or you input is a bit different, that will have to be modified.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See if this will help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import os
import arcpy
from arcpy import env

theWorkspace = r'C:\__temp\test.gdb'
arcpy.env.workspace = theWorkspace&amp;nbsp;&amp;nbsp; #not until final save
arcpy.env.overwriteOutput = True&amp;nbsp;&amp;nbsp;&amp;nbsp; 

# pts with a ID, long, lat
ptList = [[104, -148.631196, 64.010037], [102, -147.707779, 63.680584], [103, -147.469019, 63.975227]]

ptFields = [["PtID", "SHORT", "5", "", ""]]
newFcs = [["newpts", ptFields]]&amp;nbsp;&amp;nbsp;&amp;nbsp; # , ["tmppt2", pt2Fields], ["tmppt3", pt2Fields]]
newFCMySR = "newPtsMySR"

mySR = arcpy.SpatialReference(3338)
geoSR = arcpy.SpatialReference(4269)

for newFC, fields in newFcs:
&amp;nbsp; print(newFC)
&amp;nbsp; if not arcpy.Exists(arcpy.os.path.join(theWorkspace, newFC)):
&amp;nbsp;&amp;nbsp;&amp;nbsp; print("{0} does not exists, creating....".format(newFC))
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CreateFeatureclass_management(theWorkspace, newFC, "POINT", "", "", "", initialSR) 
&amp;nbsp;&amp;nbsp;&amp;nbsp; for addFld in fields:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddField_management(newFC, addFld[0], addFld[1], addFld[2], addFld[3], addFld[4])
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print(" ..added field {0} to {1}".format(addFld[0], newFC))
&amp;nbsp;&amp;nbsp;&amp;nbsp; #listNewFields = arcpy.ListFields(newFC)
&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print("{0} exists".format(newFC))

for newFC, newFields in newFcs:
&amp;nbsp; fldNames = []
&amp;nbsp; iCurFields = ['SHAPE@XY']
&amp;nbsp; for fn in newFields:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print(fn[0])
&amp;nbsp;&amp;nbsp;&amp;nbsp; fldNames.append(fn[0])
&amp;nbsp;&amp;nbsp;&amp;nbsp; iCurFields.append(fn[0])
&amp;nbsp; print("\nField names in lists {0}: {1}".format(newFC,fldNames))
&amp;nbsp; print("&amp;nbsp;&amp;nbsp; and for the cursor: {0}".format(iCurFields))
&amp;nbsp; cursor = arcpy.da.InsertCursor(newFC, iCurFields)
&amp;nbsp; print(" -&amp;gt;working with {0}".format(newFC))

&amp;nbsp; for ptID, x, y in ptList:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print(ptID)
&amp;nbsp;&amp;nbsp;&amp;nbsp; xy = (x, y)
&amp;nbsp;&amp;nbsp;&amp;nbsp; print(xy)
&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor.insertRow([xy, ptID])
&amp;nbsp; 
&amp;nbsp; arcpy.AddXY_management(newFC)

arcpy.Project_management(newFC, newFCMySR, mySR)
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:17:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-lat-long-to-wkt-spatial-reference/m-p/508792#M39957</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2021-12-11T22:17:19Z</dc:date>
    </item>
    <item>
      <title>Re: Convert lat-long to WKT spatial reference?</title>
      <link>https://community.esri.com/t5/python-questions/convert-lat-long-to-wkt-spatial-reference/m-p/508793#M39958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does something like this help:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
# WGS 1984 : (4326) Lat/Lon
x = -89.384171
y = 43.074743
# xy = Wisconsin Capitol

sr = arcpy.SpatialReference(r'C:\path2file\custom.prj') # your projection file

ptGeometry = arcpy.PointGeometry(arcpy.Point(x,y),arcpy.SpatialReference(4326)).projectAs(sr)

print ptGeometry.JSON
print x, y
print ptGeometry.firstPoint.X, ptGeometry.firstPoint.Y
# converted xy = 2538768.50758 1604492.87376&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:17:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-lat-long-to-wkt-spatial-reference/m-p/508793#M39958</guid>
      <dc:creator>RandyBurton</dc:creator>
      <dc:date>2021-12-11T22:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: Convert lat-long to WKT spatial reference?</title>
      <link>https://community.esri.com/t5/python-questions/convert-lat-long-to-wkt-spatial-reference/m-p/508794#M39959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Randy,&amp;nbsp; thanks for that.&amp;nbsp; I think I'll go back to my process and see if I can use that instead of the projection process I've been doing.&amp;nbsp; Only reason I was doing that was to get the coords.&amp;nbsp; You way is nice and clean. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Feb 2016 00:23:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-lat-long-to-wkt-spatial-reference/m-p/508794#M39959</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2016-02-19T00:23:06Z</dc:date>
    </item>
    <item>
      <title>Re: Convert lat-long to WKT spatial reference?</title>
      <link>https://community.esri.com/t5/python-questions/convert-lat-long-to-wkt-spatial-reference/m-p/508795#M39960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you know the reference numbers, you can use this instead:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# WGS 1984 : (4326) Lat/Lon
# WGS 1984 Web Mercator (auxiliary sphere) : (102100) or (3857)
ptGeometry = arcpy.PointGeometry(arcpy.Point(x,y),arcpy.SpatialReference(4326)).projectAs(arcpy.SpatialReference(3857))&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:17:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-lat-long-to-wkt-spatial-reference/m-p/508795#M39960</guid>
      <dc:creator>RandyBurton</dc:creator>
      <dc:date>2021-12-11T22:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: Convert lat-long to WKT spatial reference?</title>
      <link>https://community.esri.com/t5/python-questions/convert-lat-long-to-wkt-spatial-reference/m-p/508796#M39961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rick ...&lt;/P&gt;&lt;P&gt;if you want to weigh in here anytime... the suggestions are piling up... I will whip in a numpy solution if this isn't closed soon &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/silly.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Feb 2016 01:34:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-lat-long-to-wkt-spatial-reference/m-p/508796#M39961</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-02-19T01:34:20Z</dc:date>
    </item>
    <item>
      <title>Re: Convert lat-long to WKT spatial reference?</title>
      <link>https://community.esri.com/t5/python-questions/convert-lat-long-to-wkt-spatial-reference/m-p/508797#M39962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Randy's solution was great for me (I do use the SR #'s) except since they were just one points I used .centroid instead of .startpoint.&amp;nbsp;&amp;nbsp; this saved two projections/addXY/AlterField on 3 different files for me.&amp;nbsp;&amp;nbsp;&amp;nbsp; This is why I really like geonet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If anyone has a simple solution using the geometry for converting the long, lat values to DDM and DMS (into new fields) other than using the &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/convert-coordinate-notation.htm" title="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/convert-coordinate-notation.htm"&gt;Convert Coordinate Notation—Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; which works great and adds the new fields, but to a new FC each time (3 times x 3 files in my case), I would love to see it.&amp;nbsp; I may just do the conversion/formatting in a and add the values to my [ ].&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dan....simple Numpy suggestion perhaps? DD&amp;nbsp; (negative long in my case) -&amp;gt; DDM and DMS?&amp;nbsp; I can fire this off to a new question if needed, but I know there are already thread on the conversion (and I have snippets already)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Feb 2016 02:05:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-lat-long-to-wkt-spatial-reference/m-p/508797#M39962</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2016-02-19T02:05:55Z</dc:date>
    </item>
    <item>
      <title>Re: Convert lat-long to WKT spatial reference?</title>
      <link>https://community.esri.com/t5/python-questions/convert-lat-long-to-wkt-spatial-reference/m-p/508798#M39963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Getting off topic a little... Rebecca, you could write a function.&amp;nbsp; For DD to DMS, something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def dd2dms(dd,xy):
&amp;nbsp;&amp;nbsp;&amp;nbsp; is_positive = dd &amp;gt;= 0
&amp;nbsp;&amp;nbsp;&amp;nbsp; dd = abs(dd)
&amp;nbsp;&amp;nbsp;&amp;nbsp; m,s = divmod(dd*3600,60)
&amp;nbsp;&amp;nbsp;&amp;nbsp; d,m = divmod(m,60)
&amp;nbsp;&amp;nbsp;&amp;nbsp; if is_positive:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if xy == 'lat' : nsew = ' N'
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else : nsew = ' E'
&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if xy == 'lat' : nsew = ' S'
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else : nsew = ' W'
&amp;nbsp;&amp;nbsp;&amp;nbsp; return str(int(d))+' '+str(int(m))+' '+str(round(s,1))+ nsew

print 61.217176, -149.889006
print dd2dms(61.217176,'lat'), dd2dms(-149.889006,'lon')
# 61 13 1.8 N 149 53 20.4 W&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:17:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-lat-long-to-wkt-spatial-reference/m-p/508798#M39963</guid>
      <dc:creator>RandyBurton</dc:creator>
      <dc:date>2021-12-11T22:17:27Z</dc:date>
    </item>
    <item>
      <title>Re: Convert lat-long to WKT spatial reference?</title>
      <link>https://community.esri.com/t5/python-questions/convert-lat-long-to-wkt-spatial-reference/m-p/508799#M39964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rebecca, you probably haven't had time to scroll around the Numpy Repository, but I have this in there&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/thread/160941"&gt;Converting Decimal Degrees to DMS format&lt;/A&gt; (there is a zip as well) &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Feb 2016 07:03:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-lat-long-to-wkt-spatial-reference/m-p/508799#M39964</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-02-19T07:03:20Z</dc:date>
    </item>
    <item>
      <title>Re: Convert lat-long to WKT spatial reference?</title>
      <link>https://community.esri.com/t5/python-questions/convert-lat-long-to-wkt-spatial-reference/m-p/508800#M39965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Rebecca,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I started going down the same route you chose, by creating a temp GDB to store the new projected coordinates.&amp;nbsp; Late yesterday, I finally got a good result!&amp;nbsp; Yeah!&amp;nbsp; I was going to reply to your suggestion, but I was too tired last night and I went home instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, I see the suggestion from your fellow Alaskan, &lt;A href="https://community.esri.com/migrated-users/34565"&gt;Randy Burton&lt;/A&gt;​ this morning and it seems like a much cleaner way to go. I think that is what I will use.&amp;nbsp; Time to rip out some code...&amp;nbsp; &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;A href="https://community.esri.com/migrated-users/3116"&gt;Dan Patterson&lt;/A&gt;​ &lt;A href="https://community.esri.com/migrated-users/2691"&gt;Rebecca Strauch, GISP&lt;/A&gt;​ and &lt;A href="https://community.esri.com/migrated-users/34565"&gt;Randy Burton&lt;/A&gt;​ for all of your help and attention.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Take care, --Rick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Feb 2016 14:22:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-lat-long-to-wkt-spatial-reference/m-p/508800#M39965</guid>
      <dc:creator>RickThiel</dc:creator>
      <dc:date>2016-02-19T14:22:30Z</dc:date>
    </item>
    <item>
      <title>Re: Convert lat-long to WKT spatial reference?</title>
      <link>https://community.esri.com/t5/python-questions/convert-lat-long-to-wkt-spatial-reference/m-p/508801#M39966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Randy!&amp;nbsp; That's exactly what I was looking for! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nice touch using the Wisconsin Capitol.&amp;nbsp; &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&amp;nbsp; Rebecca's lat/long examples were SO confusing to me!&amp;nbsp; Haha.&amp;nbsp; I mean, -147.707779, 63.680584, what is that???&amp;nbsp; Sara Palin's house? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Take care everybody!&amp;nbsp; Thanks again!&amp;nbsp; -_Rick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Feb 2016 14:25:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-lat-long-to-wkt-spatial-reference/m-p/508801#M39966</guid>
      <dc:creator>RickThiel</dc:creator>
      <dc:date>2016-02-19T14:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: Convert lat-long to WKT spatial reference?</title>
      <link>https://community.esri.com/t5/python-questions/convert-lat-long-to-wkt-spatial-reference/m-p/508802#M39967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Dan/Randy.&amp;nbsp; I'll check out the code snippets, I'm sure one (or both) will work for me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Feb 2016 19:31:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-lat-long-to-wkt-spatial-reference/m-p/508802#M39967</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2016-02-22T19:31:40Z</dc:date>
    </item>
    <item>
      <title>Re: Convert lat-long to WKT spatial reference?</title>
      <link>https://community.esri.com/t5/python-questions/convert-lat-long-to-wkt-spatial-reference/m-p/508803#M39968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Randy, how can I take x,y coordinates from featureclass? Because I don`t have xy values in code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 May 2017 08:34:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-lat-long-to-wkt-spatial-reference/m-p/508803#M39968</guid>
      <dc:creator>JohnMcoy</dc:creator>
      <dc:date>2017-05-02T08:34:21Z</dc:date>
    </item>
    <item>
      <title>Re: Convert lat-long to WKT spatial reference?</title>
      <link>https://community.esri.com/t5/python-questions/convert-lat-long-to-wkt-spatial-reference/m-p/508804#M39969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using a search cursor, you can loop through the points in a feature class, read the geometry and convert to longitude/latitude.&amp;nbsp; Something like this:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SearchCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"MyPointLayer"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"OID@"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"SHAPE@XY"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &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;"Feature {}:"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row&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="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; px&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; py &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; row&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;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &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;"{}, {}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;px&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; py&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;# WGS 1984 : (4326) Lat/Lon&amp;nbsp; &lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;# WGS 1984 Web Mercator (auxiliary sphere) : (102100) or (3857)&amp;nbsp; &lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ptGeometry &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;PointGeometry&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Point&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;px&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;py&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SpatialReference&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;3857&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;projectAs&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SpatialReference&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;4326&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; ptGeometry&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;firstPoint&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;X&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; ptGeometry&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;firstPoint&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Y‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This code may be helpful in getting the spatial reference information for the point feature:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;SR &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Describe&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"MyPointLayer"&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="keyword token"&gt;print&lt;/SPAN&gt; SR&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; SR&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;factoryCode‍‍‍&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:17:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-lat-long-to-wkt-spatial-reference/m-p/508804#M39969</guid>
      <dc:creator>RandyBurton</dc:creator>
      <dc:date>2021-12-11T22:17:29Z</dc:date>
    </item>
    <item>
      <title>Re: Convert lat-long to WKT spatial reference?</title>
      <link>https://community.esri.com/t5/python-questions/convert-lat-long-to-wkt-spatial-reference/m-p/508805#M39970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you explain, how to separate coordinates in different columns ? Now I have coordinates like this(photo). I want 4 different columns Point X Point Y in WGS1984 and POINT X POINT Y in WGS 1984 Web Mercator..&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/349386_pastedImage_2.png" style="width: auto; height: auto;" /&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/349387_pastedImage_3.png" style="width: auto; height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 May 2017 06:31:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-lat-long-to-wkt-spatial-reference/m-p/508805#M39970</guid>
      <dc:creator>JohnMcoy</dc:creator>
      <dc:date>2017-05-03T06:31:01Z</dc:date>
    </item>
  </channel>
</rss>

