<?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>idea Construct ST_Geometry from ST_Points in ArcGIS Enterprise Ideas</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-ideas/construct-st-geometry-from-st-points/idi-p/1183842</link>
    <description>&lt;P&gt;If I understand correctly, it's not possible to&amp;nbsp;construct an ST_Geometry from ST_Point values.&lt;/P&gt;&lt;P&gt;For example, if I want to extract the&amp;nbsp;first segment of a polyline using ST_GEOMETRY functions:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_0-1655451874237.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/43695i24C06D88C35BED82/image-size/large?v=v2&amp;amp;px=999" role="button" title="Bud_0-1655451874237.png" alt="Bud_0-1655451874237.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;...it would be nice if I could do something like this:&lt;/P&gt;&lt;PRE&gt;select&lt;BR /&gt;    sde.st_geometry(&lt;BR /&gt;        sde.st_pointn(shape,1), &lt;BR /&gt;        sde.st_pointn(shape,2)  &lt;BR /&gt;    ,26917) as shape&lt;BR /&gt;from&lt;BR /&gt;    my_lines&lt;BR /&gt;&lt;BR /&gt;Error:&lt;BR /&gt;ORA-06553: PLS-306: wrong number or types of arguments in call to 'ST_GEOMETRY'&lt;/PRE&gt;&lt;P&gt;But instead, I think I need to go to the effort of extracting the X and Y coordinates of each ST_POINT vertex as numbers, then concatenate them together in a WKT string:&lt;/P&gt;&lt;PRE&gt;select
    'linestring('||
        sde.st_x(sde.st_pointn(shape,1))||' ' ||  
        sde.st_y(sde.st_pointn(shape,1))||', ' ||  
        sde.st_x(sde.st_pointn(shape,2))||' ' ||  
        sde.st_y(sde.st_pointn(shape,2))||')'
    as wkt,
    sde.st_geometry('linestring('||
        sde.st_x(sde.st_pointn(shape,1))||' ' ||  
        sde.st_y(sde.st_pointn(shape,1))||', ' ||  
        sde.st_x(sde.st_pointn(shape,2))||' ' ||  
        sde.st_y(sde.st_pointn(shape,2))||')'
    ,26917) as shape
from
    my_lines&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_1-1655452617322.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/43696i60252DD1765C64EA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Bud_1-1655452617322.png" alt="Bud_1-1655452617322.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;That's pretty painful and inefficient. Especially in cases where we're dealing with many vertices (and multi-part geometries).&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Idea: Could Esri give us a way to construct ST_Geometries from ST_Points, instead of extracting &amp;amp; concatenating XYs as WKT?&lt;/P&gt;&lt;P&gt;For example, enhance the ST_Geometry() constructor function to allow ST_Points as arguments. Or give us an aggregate function for aggregating features together, similar to what we have with other datatypes like SDO_Geometry.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Fri, 17 Jun 2022 08:10:15 GMT</pubDate>
    <dc:creator>Bud</dc:creator>
    <dc:date>2022-06-17T08:10:15Z</dc:date>
    <item>
      <title>Construct ST_Geometry from ST_Points</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-ideas/construct-st-geometry-from-st-points/idi-p/1183842</link>
      <description>&lt;P&gt;If I understand correctly, it's not possible to&amp;nbsp;construct an ST_Geometry from ST_Point values.&lt;/P&gt;&lt;P&gt;For example, if I want to extract the&amp;nbsp;first segment of a polyline using ST_GEOMETRY functions:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_0-1655451874237.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/43695i24C06D88C35BED82/image-size/large?v=v2&amp;amp;px=999" role="button" title="Bud_0-1655451874237.png" alt="Bud_0-1655451874237.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;...it would be nice if I could do something like this:&lt;/P&gt;&lt;PRE&gt;select&lt;BR /&gt;    sde.st_geometry(&lt;BR /&gt;        sde.st_pointn(shape,1), &lt;BR /&gt;        sde.st_pointn(shape,2)  &lt;BR /&gt;    ,26917) as shape&lt;BR /&gt;from&lt;BR /&gt;    my_lines&lt;BR /&gt;&lt;BR /&gt;Error:&lt;BR /&gt;ORA-06553: PLS-306: wrong number or types of arguments in call to 'ST_GEOMETRY'&lt;/PRE&gt;&lt;P&gt;But instead, I think I need to go to the effort of extracting the X and Y coordinates of each ST_POINT vertex as numbers, then concatenate them together in a WKT string:&lt;/P&gt;&lt;PRE&gt;select
    'linestring('||
        sde.st_x(sde.st_pointn(shape,1))||' ' ||  
        sde.st_y(sde.st_pointn(shape,1))||', ' ||  
        sde.st_x(sde.st_pointn(shape,2))||' ' ||  
        sde.st_y(sde.st_pointn(shape,2))||')'
    as wkt,
    sde.st_geometry('linestring('||
        sde.st_x(sde.st_pointn(shape,1))||' ' ||  
        sde.st_y(sde.st_pointn(shape,1))||', ' ||  
        sde.st_x(sde.st_pointn(shape,2))||' ' ||  
        sde.st_y(sde.st_pointn(shape,2))||')'
    ,26917) as shape
from
    my_lines&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_1-1655452617322.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/43696i60252DD1765C64EA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Bud_1-1655452617322.png" alt="Bud_1-1655452617322.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;That's pretty painful and inefficient. Especially in cases where we're dealing with many vertices (and multi-part geometries).&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Idea: Could Esri give us a way to construct ST_Geometries from ST_Points, instead of extracting &amp;amp; concatenating XYs as WKT?&lt;/P&gt;&lt;P&gt;For example, enhance the ST_Geometry() constructor function to allow ST_Points as arguments. Or give us an aggregate function for aggregating features together, similar to what we have with other datatypes like SDO_Geometry.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jun 2022 08:10:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-ideas/construct-st-geometry-from-st-points/idi-p/1183842</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2022-06-17T08:10:15Z</dc:date>
    </item>
  </channel>
</rss>

