<?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: [Oracle] Get single (non collection) geometry from ST_AGGR_UNION in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/oracle-get-single-non-collection-geometry-from-st/m-p/504085#M3457</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I figured out that I can get the &lt;EM&gt;MULTILINESTRING&lt;/EM&gt; text and just:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;replace the &lt;EM&gt;MULTILINESTRING&lt;/EM&gt; for &lt;EM&gt;LINESTRING&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;do some adjustments&lt;/LI&gt;&lt;LI&gt;construct a linestring from text&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;This is how my query looks like:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;SELECT MAX(OBJECTID) OBJECTID, ID_LOGRADOURO, COUNT(OBJECTID) COUNT_TRECHOS, SDE.ST_GEOMETRY_OPERATORS.ST_ASTEXT_F(SDE.ST_LINEFROMTEXT(replace(replace(replace(replace(SDE.ST_GEOMETRY_OPERATORS.ST_ASTEXT_F(SDE.ST_AGGR_UNION(SHAPE)),'((','('),'),(',','),'))',')'),'MULTILINESTRING','LINESTRING'), 587)) SHAPE
FROM GRF_TRECHO_LIN_24
GROUP BY ID_LOGRADOURO
ORDER BY ID_LOGRADOURO;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 22:07:05 GMT</pubDate>
    <dc:creator>PlinioSantos</dc:creator>
    <dc:date>2021-12-11T22:07:05Z</dc:date>
    <item>
      <title>[Oracle] Get single (non collection) geometry from ST_AGGR_UNION</title>
      <link>https://community.esri.com/t5/developers-questions/oracle-get-single-non-collection-geometry-from-st/m-p/504084#M3456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an oracle database (11g R2) which each register is a piece of one street. For instance:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;SELECT ID_LOGRADOURO, SDE.ST_GEOMETRY_OPERATORS.ST_ASTEXT_F(SHAPE)
FROM GRF_TRECHO_LIN_24
ORDER BY ID_LOGRADOURO;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;Where ID_LOGRADOURO identifies uniquely an street.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;&lt;IMG alt="Capturar1.PNG" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/115857_Capturar1.PNG" style="width: 620px; height: 177px;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I'm trying to select a union of all pieces of the same streets in one geometry:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;SELECT MAX(OBJECTID) OBJECTID, ID_LOGRADOURO, COUNT(OBJECTID) COUNT, SDE.ST_GEOMETRY_OPERATORS.ST_ASTEXT_F(SDE.ST_AGGR_UNION(SHAPE))
FROM GRF_TRECHO_LIN_24
GROUP BY ID_LOGRADOURO
ORDER BY ID_LOGRADOURO;&lt;/PRE&gt;&lt;P&gt;&lt;IMG alt="Capturar2.PNG" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/115858_Capturar2.PNG" style="width: 620px; height: 155px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Realise that the aggregate function returns a multilinestring if the stree if composed by more than one piece.&lt;/P&gt;&lt;P&gt;I'm looking for a way to get a linestring regardless the street has one or more pieces. How can I do that?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:07:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/oracle-get-single-non-collection-geometry-from-st/m-p/504084#M3456</guid>
      <dc:creator>PlinioSantos</dc:creator>
      <dc:date>2021-12-11T22:07:02Z</dc:date>
    </item>
    <item>
      <title>Re: [Oracle] Get single (non collection) geometry from ST_AGGR_UNION</title>
      <link>https://community.esri.com/t5/developers-questions/oracle-get-single-non-collection-geometry-from-st/m-p/504085#M3457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I figured out that I can get the &lt;EM&gt;MULTILINESTRING&lt;/EM&gt; text and just:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;replace the &lt;EM&gt;MULTILINESTRING&lt;/EM&gt; for &lt;EM&gt;LINESTRING&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;do some adjustments&lt;/LI&gt;&lt;LI&gt;construct a linestring from text&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;This is how my query looks like:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;SELECT MAX(OBJECTID) OBJECTID, ID_LOGRADOURO, COUNT(OBJECTID) COUNT_TRECHOS, SDE.ST_GEOMETRY_OPERATORS.ST_ASTEXT_F(SDE.ST_LINEFROMTEXT(replace(replace(replace(replace(SDE.ST_GEOMETRY_OPERATORS.ST_ASTEXT_F(SDE.ST_AGGR_UNION(SHAPE)),'((','('),'),(',','),'))',')'),'MULTILINESTRING','LINESTRING'), 587)) SHAPE
FROM GRF_TRECHO_LIN_24
GROUP BY ID_LOGRADOURO
ORDER BY ID_LOGRADOURO;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:07:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/oracle-get-single-non-collection-geometry-from-st/m-p/504085#M3457</guid>
      <dc:creator>PlinioSantos</dc:creator>
      <dc:date>2021-12-11T22:07:05Z</dc:date>
    </item>
  </channel>
</rss>

