<?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: Return Lat Long from SQL Spatial Geometry Type Query in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/return-lat-long-from-sql-spatial-geometry-type/m-p/67181#M3859</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/82671"&gt;Aaron Greiner&lt;/A&gt;‌, you could possibly wrap your existing SQL query into python with the projected data, then send that collection to ArcGIS for Server's Geometry service to project the features via the script. There is also an amazing github JavaScript library that can transform point coords from one system to another (with datum transformations). &lt;A href="http://proj4js.org/" title="http://proj4js.org/"&gt;Proj4js by proj4js&lt;/A&gt;&amp;nbsp; . However, this means you are going way beyond a SQL query.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Feb 2015 13:17:13 GMT</pubDate>
    <dc:creator>BryanMc</dc:creator>
    <dc:date>2015-02-27T13:17:13Z</dc:date>
    <item>
      <title>Return Lat Long from SQL Spatial Geometry Type Query</title>
      <link>https://community.esri.com/t5/data-management-questions/return-lat-long-from-sql-spatial-geometry-type/m-p/67174#M3852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to use a SQL query to get the Lat Long of points in a point layer in our geodatabase.&amp;nbsp; The&amp;nbsp; STAsText method will return the XY as shown below, but I'd like to get the lat long instead.&amp;nbsp; Is there a method that can do this or is there a conversion I could use in SQL to convert the XY from STAsText?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the query to get the XY:&lt;/P&gt;&lt;P&gt;select SHAPE, [SHAPE].STAsText() XY&lt;/P&gt;&lt;P&gt;from featureclass&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated. Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Feb 2015 17:00:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/return-lat-long-from-sql-spatial-geometry-type/m-p/67174#M3852</guid>
      <dc:creator>AaronGreiner1</dc:creator>
      <dc:date>2015-02-26T17:00:32Z</dc:date>
    </item>
    <item>
      <title>Re: Return Lat Long from SQL Spatial Geometry Type Query</title>
      <link>https://community.esri.com/t5/data-management-questions/return-lat-long-from-sql-spatial-geometry-type/m-p/67175#M3853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Aaron,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you try this in SQL Server:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14249757213289747 jive_text_macro" jivemacro_uid="_14249757213289747"&gt;&lt;P&gt;select shape, shape.STX as LONG, shape.STY as LAT from sde.fc&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Feb 2015 18:35:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/return-lat-long-from-sql-spatial-geometry-type/m-p/67175#M3853</guid>
      <dc:creator>ChristianWells</dc:creator>
      <dc:date>2015-02-26T18:35:30Z</dc:date>
    </item>
    <item>
      <title>Re: Return Lat Long from SQL Spatial Geometry Type Query</title>
      <link>https://community.esri.com/t5/data-management-questions/return-lat-long-from-sql-spatial-geometry-type/m-p/67176#M3854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Christian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the quick reply, unfortunately those only work for sqlGeography types and our data is in sqlGeometry types. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aaron&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Feb 2015 18:42:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/return-lat-long-from-sql-spatial-geometry-type/m-p/67176#M3854</guid>
      <dc:creator>AaronGreiner1</dc:creator>
      <dc:date>2015-02-26T18:42:08Z</dc:date>
    </item>
    <item>
      <title>Re: Return Lat Long from SQL Spatial Geometry Type Query</title>
      <link>https://community.esri.com/t5/data-management-questions/return-lat-long-from-sql-spatial-geometry-type/m-p/67177#M3855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Aaron, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQL Server does also support STX and STY for the geometry type:&lt;/P&gt;&lt;P&gt;&lt;A href="https://msdn.microsoft.com/en-us/library/bb933828.aspx"&gt;STX (geometry Data Type)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In addition, are you looking to convert the Feet units of a Projected Coordinate System to Decimal Degrees?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Feb 2015 18:44:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/return-lat-long-from-sql-spatial-geometry-type/m-p/67177#M3855</guid>
      <dc:creator>ChristianWells</dc:creator>
      <dc:date>2015-02-26T18:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: Return Lat Long from SQL Spatial Geometry Type Query</title>
      <link>https://community.esri.com/t5/data-management-questions/return-lat-long-from-sql-spatial-geometry-type/m-p/67178#M3856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Chris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, I missed that on the geometry type.&amp;nbsp; Yes, I am converting feet units to decimal degrees.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aaron&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Feb 2015 18:49:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/return-lat-long-from-sql-spatial-geometry-type/m-p/67178#M3856</guid>
      <dc:creator>AaronGreiner1</dc:creator>
      <dc:date>2015-02-26T18:49:34Z</dc:date>
    </item>
    <item>
      <title>Re: Return Lat Long from SQL Spatial Geometry Type Query</title>
      <link>https://community.esri.com/t5/data-management-questions/return-lat-long-from-sql-spatial-geometry-type/m-p/67179#M3857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sounds good. Just something to keep in mind with conversions here is that SQL Server doesn't have support for a Transform or Reproject function. &lt;A href="http://gis.stackexchange.com/questions/2723/is-it-possible-to-reproject-spatial-data-using-sql-server" title="http://gis.stackexchange.com/questions/2723/is-it-possible-to-reproject-spatial-data-using-sql-server"&gt;Is it possible to reproject spatial data using SQL Server?&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Feb 2015 19:01:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/return-lat-long-from-sql-spatial-geometry-type/m-p/67179#M3857</guid>
      <dc:creator>ChristianWells</dc:creator>
      <dc:date>2015-02-26T19:01:30Z</dc:date>
    </item>
    <item>
      <title>Re: Return Lat Long from SQL Spatial Geometry Type Query</title>
      <link>https://community.esri.com/t5/data-management-questions/return-lat-long-from-sql-spatial-geometry-type/m-p/67180#M3858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Chris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bummer, so i'll need to find another solution for getting that our of the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Feb 2015 20:47:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/return-lat-long-from-sql-spatial-geometry-type/m-p/67180#M3858</guid>
      <dc:creator>AaronGreiner1</dc:creator>
      <dc:date>2015-02-26T20:47:24Z</dc:date>
    </item>
    <item>
      <title>Re: Return Lat Long from SQL Spatial Geometry Type Query</title>
      <link>https://community.esri.com/t5/data-management-questions/return-lat-long-from-sql-spatial-geometry-type/m-p/67181#M3859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/82671"&gt;Aaron Greiner&lt;/A&gt;‌, you could possibly wrap your existing SQL query into python with the projected data, then send that collection to ArcGIS for Server's Geometry service to project the features via the script. There is also an amazing github JavaScript library that can transform point coords from one system to another (with datum transformations). &lt;A href="http://proj4js.org/" title="http://proj4js.org/"&gt;Proj4js by proj4js&lt;/A&gt;&amp;nbsp; . However, this means you are going way beyond a SQL query.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Feb 2015 13:17:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/return-lat-long-from-sql-spatial-geometry-type/m-p/67181#M3859</guid>
      <dc:creator>BryanMc</dc:creator>
      <dc:date>2015-02-27T13:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: Return Lat Long from SQL Spatial Geometry Type Query</title>
      <link>https://community.esri.com/t5/data-management-questions/return-lat-long-from-sql-spatial-geometry-type/m-p/67182#M3860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Bryan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My intention was to have this live in the database as part of a spatial view without any processing outside the database.&amp;nbsp; I'll likely just use python to extract the view and do the final calculations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Feb 2015 13:30:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/return-lat-long-from-sql-spatial-geometry-type/m-p/67182#M3860</guid>
      <dc:creator>AaronGreiner1</dc:creator>
      <dc:date>2015-02-27T13:30:12Z</dc:date>
    </item>
  </channel>
</rss>

