<?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 A Spatial View to calculate XY coordinates in Geodatabase Questions</title>
    <link>https://community.esri.com/t5/geodatabase-questions/a-spatial-view-to-calculate-xy-coordinates/m-p/769979#M860</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a points layer with X,Y fields, each time I add a point I should perform "calculate geometry" to calculate the coordinates of the new points.&lt;/P&gt;&lt;P&gt;Is there a way to handle this automatically via a spatial view in SQL Server using a certain geometry function?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is appreciated!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Feb 2016 10:17:36 GMT</pubDate>
    <dc:creator>HaniDraidi</dc:creator>
    <dc:date>2016-02-12T10:17:36Z</dc:date>
    <item>
      <title>A Spatial View to calculate XY coordinates</title>
      <link>https://community.esri.com/t5/geodatabase-questions/a-spatial-view-to-calculate-xy-coordinates/m-p/769979#M860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a points layer with X,Y fields, each time I add a point I should perform "calculate geometry" to calculate the coordinates of the new points.&lt;/P&gt;&lt;P&gt;Is there a way to handle this automatically via a spatial view in SQL Server using a certain geometry function?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is appreciated!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Feb 2016 10:17:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/a-spatial-view-to-calculate-xy-coordinates/m-p/769979#M860</guid>
      <dc:creator>HaniDraidi</dc:creator>
      <dc:date>2016-02-12T10:17:36Z</dc:date>
    </item>
    <item>
      <title>Re: A Spatial View to calculate XY coordinates</title>
      <link>https://community.esri.com/t5/geodatabase-questions/a-spatial-view-to-calculate-xy-coordinates/m-p/769980#M861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is typically done using a SQL trigger that listens for incoming geometries either from editing a map document or inserting geometries with SQL.&amp;nbsp; When using a native DBMS spatial type such as SQL Server Geometry or Postgres' PostGIS type, constructor functions and spatial operator functions are provided that allow one to query different spatial properties.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For instance, in SQL Server we can use the&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;shape.Lat, shape.Long&lt;/PRE&gt;&lt;P&gt;functions for Geography types or&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;shape.X and shape.Y&lt;/PRE&gt;&lt;P&gt;for Geometry types on a spatial column called "shape".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a simple SQL Server Geography example using shape.Lat and shape.Long. to update columns called "latitude" and "longitude" with their respective values.&amp;nbsp; This sample is provided AS IS and must be properly tested before implementing in a production environment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;CREATE&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;TRIGGER&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;gis&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;Insert_xy_if_geometry_fc&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;ON&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;gis&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;Landmark_fc&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;AFTER&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;INSERT&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;UPDATE&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;AS&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;UPDATE&lt;/SPAN&gt; pt
&lt;SPAN class="keyword token"&gt;SET&lt;/SPAN&gt; pt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;latitude &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; i&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Shape&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Lat
&amp;nbsp; &lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;pt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;longitude &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; i&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Shape&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Long
&lt;SPAN class="keyword token"&gt;FROM&lt;/SPAN&gt; Landmark_fc &lt;SPAN class="keyword token"&gt;AS&lt;/SPAN&gt; pt
&lt;SPAN class="keyword token"&gt;INNER&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;JOIN&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="keyword token"&gt;SELECT&lt;/SPAN&gt; objectid
&amp;nbsp; &lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;Shape
&amp;nbsp; &lt;SPAN class="keyword token"&gt;FROM&lt;/SPAN&gt; inserted
&amp;nbsp; &lt;SPAN class="keyword token"&gt;WHERE&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Shape &lt;SPAN class="operator token"&gt;IS&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;NOT&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;NULL&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;AS&lt;/SPAN&gt; i &lt;SPAN class="keyword token"&gt;ON&lt;/SPAN&gt; i&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;objectid &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; pt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;objectid&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;RETURN&lt;/SPAN&gt;
GO
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&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;/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;&lt;A href="https://msdn.microsoft.com/en-us/library/bb933806.aspx" title="https://msdn.microsoft.com/en-us/library/bb933806.aspx" rel="nofollow noopener noreferrer" target="_blank"&gt;Lat (geography Data Type)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://msdn.microsoft.com/en-us/library/bb933958.aspx" title="https://msdn.microsoft.com/en-us/library/bb933958.aspx" rel="nofollow noopener noreferrer" target="_blank"&gt;Long (geography Data Type)&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:35:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/a-spatial-view-to-calculate-xy-coordinates/m-p/769980#M861</guid>
      <dc:creator>KenGalliher1</dc:creator>
      <dc:date>2021-12-12T08:35:30Z</dc:date>
    </item>
  </channel>
</rss>

