<?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 SDO_GEOMETRY FC should constrain geometry type using spatial index parameter in ArcGIS Enterprise Ideas</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-ideas/sdo-geometry-fc-should-constrain-geometry-type/idi-p/1276218</link>
    <description>&lt;P&gt;When an SDO_GEOMETRY feature class is created using Catalog in ArcGIS Pro, a spatial index is automatically created:&lt;/P&gt;&lt;PRE&gt;CREATE INDEX "INFRASTR"."A7437_IX1" ON "INFRASTR"."A_TEST_SDO_GEOM_LINE_FC" ("SHAPE") &lt;BR /&gt;    INDEXTYPE IS "MDSYS"."SPATIAL_INDEX" ;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;Idea:&lt;/P&gt;&lt;P&gt;Could the auto-created spatial indexes be enhanced so that they constrain the column to only accept the correct geometry type? (in this case, lines)&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;A href="https://docs.oracle.com/en/database/oracle/oracle-database/23/spatl/indexing-querying-spatial-data.html#GUID-0A054242-4FCC-4DBB-97FC-E375DE9773EE" target="_self" rel="nofollow noopener noreferrer"&gt;5.1.2 Constraining Data to a Geometry Type&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;When you create or rebuild a spatial index, you can ensure that all geometries that are in the table or that are inserted later are of a specified geometry type. To constrain the data to a geometry type in this way, use the&amp;nbsp;&amp;nbsp;&lt;FONT face="courier new,courier"&gt;layer_gtype&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;keyword in the PARAMETERS clause of the&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://docs.oracle.com/en/database/oracle/oracle-database/23/spatl/sql-indexing-spatial-data.html#GUID-BB6D7C9E-277B-4F49-BDD4-539CFE88D12C" target="_blank" rel="noopener nofollow noreferrer"&gt;CREATE INDEX&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;or&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://docs.oracle.com/en/database/oracle/oracle-database/23/spatl/sql-indexing-spatial-data.html#GUID-9DBFA670-1F9D-49CB-8D68-66F1C31C1677" target="_blank" rel="noopener nofollow noreferrer"&gt;ALTER INDEX REBUILD&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;statement, and specify a value from the Geometry Type column of the Valid SDO_GTYPE Values table described in&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://docs.oracle.com/en/database/oracle/oracle-database/23/spatl/spatial-datatypes-metadata.html#GUID-4D84CE67-67E4-4A84-8255-C586E765A94B" target="_blank" rel="noopener nofollow noreferrer"&gt;SDO_GTYPE&lt;/A&gt;&lt;SPAN&gt;.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Like this:&lt;/P&gt;&lt;PRE&gt;CREATE INDEX "INFRASTR"."A7437_IX1" ON "INFRASTR"."A_TEST_SDO_GEOM_LINE_FC" ("SHAPE") &lt;BR /&gt;    INDEXTYPE IS "MDSYS"."SPATIAL_INDEX&lt;FONT color="#0000FF"&gt;_V2 PARAMETERS('layer_gtype=&lt;STRONG&gt;line&lt;/STRONG&gt;');&lt;BR /&gt;&lt;FONT color="#999999"&gt;    --SPATIAL_INDEX_&lt;STRONG&gt;V2&lt;/STRONG&gt; is optional/just a best practice.&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;Otherwise, it's possible to insert features that aren't lines using SQL.&lt;/P&gt;&lt;PRE&gt;--ArcGIS isn't designed to handle multiple geometry types in the same geometry column.&lt;BR /&gt;&lt;BR /&gt;INSERT INTO a_test_sdo_geom_line_fc (objectid, shape) &lt;BR /&gt;    VALUES (sde.gdb_util.next_rowid('INFRASTR', 'A_TEST_SDO_GEOM_LINE_FC'), &lt;BR /&gt;            sdo_geometry('&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;POINT&lt;/STRONG&gt;&lt;/FONT&gt; (30 10)', 26917));&lt;BR /&gt;&lt;BR /&gt;1 row inserted.&lt;/PRE&gt;&lt;P&gt;&lt;EM&gt;Inserting features using SQL into an un-versioned table is a valid usage pattern, as per the docs:&amp;nbsp;&lt;A href="https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/editing-nonversioned-geodatabase-data-in-oracle-using-sql.htm" target="_self"&gt;Editing nonversioned geodatabase data in Oracle using SQL&lt;/A&gt;.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Constraining the SDO_GEOEMTRY column to the correct FC geometry type would have the following benefits:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Avoid developers accidently inserting the wrong geometry type into the column. While that usage pattern is rare, it seems like a simple constraint like this could go a long way in terms of preventing future headaches. And if properly constrained, is one less thing to troubleshoot when dealing with data problems.&lt;/LI&gt;&lt;LI&gt;The SDO_GEOMETRY docs say constraining the geometry type can improve spatial query performance in some scenarios.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;BR /&gt;Could ArcGIS Pro be enhanced so that spatial indexes in SDO_GEOMETRY FCs include the GTYPE parameter -- to constrain the SDO_GEOMETRY geometry type so that it's consistent with the FC geometry type?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Related:&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-pro-ideas/catalog-recognize-non-gdb-sdo-geometry-geometry/idi-p/1276162" target="_self"&gt;SDO_GEOMETRY table — Catalog should recognize geometry type (point, line, polygon) when constrained by spatial index parameter&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 06 Apr 2023 22:30:36 GMT</pubDate>
    <dc:creator>Bud</dc:creator>
    <dc:date>2023-04-06T22:30:36Z</dc:date>
    <item>
      <title>SDO_GEOMETRY FC should constrain geometry type using spatial index parameter</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-ideas/sdo-geometry-fc-should-constrain-geometry-type/idi-p/1276218</link>
      <description>&lt;P&gt;When an SDO_GEOMETRY feature class is created using Catalog in ArcGIS Pro, a spatial index is automatically created:&lt;/P&gt;&lt;PRE&gt;CREATE INDEX "INFRASTR"."A7437_IX1" ON "INFRASTR"."A_TEST_SDO_GEOM_LINE_FC" ("SHAPE") &lt;BR /&gt;    INDEXTYPE IS "MDSYS"."SPATIAL_INDEX" ;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;Idea:&lt;/P&gt;&lt;P&gt;Could the auto-created spatial indexes be enhanced so that they constrain the column to only accept the correct geometry type? (in this case, lines)&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;A href="https://docs.oracle.com/en/database/oracle/oracle-database/23/spatl/indexing-querying-spatial-data.html#GUID-0A054242-4FCC-4DBB-97FC-E375DE9773EE" target="_self" rel="nofollow noopener noreferrer"&gt;5.1.2 Constraining Data to a Geometry Type&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;When you create or rebuild a spatial index, you can ensure that all geometries that are in the table or that are inserted later are of a specified geometry type. To constrain the data to a geometry type in this way, use the&amp;nbsp;&amp;nbsp;&lt;FONT face="courier new,courier"&gt;layer_gtype&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;keyword in the PARAMETERS clause of the&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://docs.oracle.com/en/database/oracle/oracle-database/23/spatl/sql-indexing-spatial-data.html#GUID-BB6D7C9E-277B-4F49-BDD4-539CFE88D12C" target="_blank" rel="noopener nofollow noreferrer"&gt;CREATE INDEX&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;or&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://docs.oracle.com/en/database/oracle/oracle-database/23/spatl/sql-indexing-spatial-data.html#GUID-9DBFA670-1F9D-49CB-8D68-66F1C31C1677" target="_blank" rel="noopener nofollow noreferrer"&gt;ALTER INDEX REBUILD&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;statement, and specify a value from the Geometry Type column of the Valid SDO_GTYPE Values table described in&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://docs.oracle.com/en/database/oracle/oracle-database/23/spatl/spatial-datatypes-metadata.html#GUID-4D84CE67-67E4-4A84-8255-C586E765A94B" target="_blank" rel="noopener nofollow noreferrer"&gt;SDO_GTYPE&lt;/A&gt;&lt;SPAN&gt;.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Like this:&lt;/P&gt;&lt;PRE&gt;CREATE INDEX "INFRASTR"."A7437_IX1" ON "INFRASTR"."A_TEST_SDO_GEOM_LINE_FC" ("SHAPE") &lt;BR /&gt;    INDEXTYPE IS "MDSYS"."SPATIAL_INDEX&lt;FONT color="#0000FF"&gt;_V2 PARAMETERS('layer_gtype=&lt;STRONG&gt;line&lt;/STRONG&gt;');&lt;BR /&gt;&lt;FONT color="#999999"&gt;    --SPATIAL_INDEX_&lt;STRONG&gt;V2&lt;/STRONG&gt; is optional/just a best practice.&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;Otherwise, it's possible to insert features that aren't lines using SQL.&lt;/P&gt;&lt;PRE&gt;--ArcGIS isn't designed to handle multiple geometry types in the same geometry column.&lt;BR /&gt;&lt;BR /&gt;INSERT INTO a_test_sdo_geom_line_fc (objectid, shape) &lt;BR /&gt;    VALUES (sde.gdb_util.next_rowid('INFRASTR', 'A_TEST_SDO_GEOM_LINE_FC'), &lt;BR /&gt;            sdo_geometry('&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;POINT&lt;/STRONG&gt;&lt;/FONT&gt; (30 10)', 26917));&lt;BR /&gt;&lt;BR /&gt;1 row inserted.&lt;/PRE&gt;&lt;P&gt;&lt;EM&gt;Inserting features using SQL into an un-versioned table is a valid usage pattern, as per the docs:&amp;nbsp;&lt;A href="https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/editing-nonversioned-geodatabase-data-in-oracle-using-sql.htm" target="_self"&gt;Editing nonversioned geodatabase data in Oracle using SQL&lt;/A&gt;.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Constraining the SDO_GEOEMTRY column to the correct FC geometry type would have the following benefits:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Avoid developers accidently inserting the wrong geometry type into the column. While that usage pattern is rare, it seems like a simple constraint like this could go a long way in terms of preventing future headaches. And if properly constrained, is one less thing to troubleshoot when dealing with data problems.&lt;/LI&gt;&lt;LI&gt;The SDO_GEOMETRY docs say constraining the geometry type can improve spatial query performance in some scenarios.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;BR /&gt;Could ArcGIS Pro be enhanced so that spatial indexes in SDO_GEOMETRY FCs include the GTYPE parameter -- to constrain the SDO_GEOMETRY geometry type so that it's consistent with the FC geometry type?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Related:&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-pro-ideas/catalog-recognize-non-gdb-sdo-geometry-geometry/idi-p/1276162" target="_self"&gt;SDO_GEOMETRY table — Catalog should recognize geometry type (point, line, polygon) when constrained by spatial index parameter&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2023 22:30:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-ideas/sdo-geometry-fc-should-constrain-geometry-type/idi-p/1276218</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2023-04-06T22:30:36Z</dc:date>
    </item>
  </channel>
</rss>

