<?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: SQL not intersect when projection is 3857 in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/sql-not-intersect-when-projection-is-3857/m-p/1016703#M5734</link>
    <description>&lt;P&gt;Wild guess... web mercator is not recommended for any geometry calculations like distance or area, so it doesn't surprise me that it would be the last choice to use for a projected coordinate system.&amp;nbsp; Can you use another one ? (eg utm etc)&lt;/P&gt;</description>
    <pubDate>Thu, 14 Jan 2021 00:09:03 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2021-01-14T00:09:03Z</dc:date>
    <item>
      <title>SQL not intersect when projection is 3857</title>
      <link>https://community.esri.com/t5/developers-questions/sql-not-intersect-when-projection-is-3857/m-p/1016618#M5733</link>
      <description>&lt;P&gt;Using sql when I try to intersect a polygon with coordinates, when the projection is 3857 the intersect does NOT work, when the projection is 4326 wgs it works fine. The only difference between the FCs is the SRID. I projected FC&amp;nbsp;PARCELS_TX 3857 to FC&amp;nbsp;PARCELS_TX_WGS as a new FC and ran the same sql code and it returned a row as expected.&lt;/P&gt;&lt;P&gt;Below code using 4326 the intersect works&lt;/P&gt;&lt;P&gt;SET @lat = 32.288675&lt;BR /&gt;SET @long = -98.278444&lt;BR /&gt;DECLARE @g geometry = geometry::Point(@long, @lat, 4326)&lt;/P&gt;&lt;P&gt;/****** Script for SelectTopNRows command from SSMS ******/&lt;BR /&gt;select [Poly_MPARCELAPN]&lt;BR /&gt;,[Pt_STZIP4]&lt;BR /&gt;,[Pt_XCOORD]&lt;BR /&gt;,[Pt_YCOORD]&lt;BR /&gt;,[Shape]&lt;BR /&gt;FROM [GISDB].[dbo].[PARCELS_TX_WGS]&lt;BR /&gt;where @g.STIntersects(Shape) = 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;##################################&lt;/P&gt;&lt;P&gt;3857&lt;/P&gt;&lt;P&gt;Same code over table projected at 3857 does not return a result. It should return the same result as 4326&lt;/P&gt;&lt;P&gt;SET @lat = 32.288675&lt;BR /&gt;SET @long = -98.278444&lt;BR /&gt;DECLARE @g geometry = geometry::Point(@long, @lat, 3857)&lt;/P&gt;&lt;P&gt;/****** Script for SelectTopNRows command from SSMS ******/&lt;BR /&gt;select [Poly_MPARCELAPN]&lt;BR /&gt;,[Pt_STZIP4]&lt;BR /&gt;,[Pt_XCOORD]&lt;BR /&gt;,[Pt_YCOORD]&lt;BR /&gt;,[Shape]&lt;BR /&gt;FROM [GISDB].[dbo].[PARCELS_TX]&lt;BR /&gt;where @g.STIntersects(Shape) = 1&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2021 22:00:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/sql-not-intersect-when-projection-is-3857/m-p/1016618#M5733</guid>
      <dc:creator>KurtRadamaker</dc:creator>
      <dc:date>2021-01-13T22:00:40Z</dc:date>
    </item>
    <item>
      <title>Re: SQL not intersect when projection is 3857</title>
      <link>https://community.esri.com/t5/developers-questions/sql-not-intersect-when-projection-is-3857/m-p/1016703#M5734</link>
      <description>&lt;P&gt;Wild guess... web mercator is not recommended for any geometry calculations like distance or area, so it doesn't surprise me that it would be the last choice to use for a projected coordinate system.&amp;nbsp; Can you use another one ? (eg utm etc)&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2021 00:09:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/sql-not-intersect-when-projection-is-3857/m-p/1016703#M5734</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-01-14T00:09:03Z</dc:date>
    </item>
    <item>
      <title>Re: SQL not intersect when projection is 3857</title>
      <link>https://community.esri.com/t5/developers-questions/sql-not-intersect-when-projection-is-3857/m-p/1016720#M5735</link>
      <description>Those are not valid 3857 coordinates. 3857 coordinates are in meters, not degrees.&lt;BR /&gt;</description>
      <pubDate>Thu, 14 Jan 2021 01:01:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/sql-not-intersect-when-projection-is-3857/m-p/1016720#M5735</guid>
      <dc:creator>NathanRaley</dc:creator>
      <dc:date>2021-01-14T01:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: SQL not intersect when projection is 3857</title>
      <link>https://community.esri.com/t5/developers-questions/sql-not-intersect-when-projection-is-3857/m-p/1016874#M5736</link>
      <description>&lt;P&gt;Some more details now that I am not posting from my phone:&lt;/P&gt;&lt;P&gt;3857 in SQL Server uses Meters as its unit, 4326 uses decimal degrees.&amp;nbsp; The coordinates you posted are not the same coordinates between the two, you would have to convert the geometry to a 3857 geometry, or convert from the decimal degrees to meters.&amp;nbsp; Also, any geometry defined as a specific SRID within SQL Server will be excluded from any geospatial query you are performing against it when the geometry is in a different spatial reference.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2021 15:17:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/sql-not-intersect-when-projection-is-3857/m-p/1016874#M5736</guid>
      <dc:creator>NathanRaley</dc:creator>
      <dc:date>2021-01-14T15:17:41Z</dc:date>
    </item>
  </channel>
</rss>

