Determine if line has true curves via SQL (SDE.ST_GEOMETRY in Oracle)

671
2
02-03-2022 06:24 AM
Status: Open
Bud
by
Notable Contributor

Currently, it's not possible to determine if a SDE.ST_GEOMETRY line has true curves via SQL.

For example, select lines where the SHAPE contains at least one true curve:

Bud_0-1643897738553.png

Could ESRI consider adding a function to SDE.ST_GEOMETRY (Oracle) for this purpose?

Something like:

  • SDE.ST_HasCurves()

Thanks.

2 Comments
Bud
by

In the meantime, I wonder if this would be a possible workaround:

1. Create a field in the feature class called HAS_CURVES.

2. Populate the field in real-time/when a user creates or modifies a feature -- using a Calculation Attribute Rule.

  • Compare $feature.shape_length, which is the true length, including true curves
    vs.
    Length($feature), which is the pre-densified length, where true curves have been converted into straight segments.
    https://i.stack.imgur.com/ilJrg.png

  • If there is a difference between those two values, then that tells us that the line has curves. Use a Calculation Attribute Rule to set the HAS_CURVES field to "Y".

3. That field would be available to SQL. So we could query on it as needed.

Disclaimer: It's possible that comparing the those lengths might not work in all scenarios (due to rounding complications, etc.). Testing would be needed. As the idea suggests, it would be a lot more robust to have a SDE.ST_HasCurves() function in ST_GEOMETRY.


Related: 

Idea: hasCurve Arcade geometry property
Calculate length of line without using length function (and without densifying curves)
Select SDE.ST_GEOMETRY polylines that have arcs?

Bud
by

An untested idea from a colleague:

Since the data is stored in the st_geometry field you might be able to interrogate it for a flag value that indicates a true curve (slightly hacky, but might work) or look at the size of the blob and compare that to the number of points in the shape.  There should be a correlation between the number of points and the size of the blob (but the points are compressed, so it isn’t 1:1), but if it’s greatly larger than what the size for the point array storage needs, it’s likely there is additional info in the blob (like true curves, annotation, or dimensions).