1

Oracle 18c/10.7.1 EGDB:

I have a polyline FC with a feature that has an arc.

enter image description here

I want to count the number of vertices in the line using the SDE.ST_NUMPOINTS() function.

select
    sde.st_numpoints(shape) as num_vertices
from
    a_test_fc


NUM_VERTICES
------------
         302

The line only has 2 vertices. However, the result from SDE.ST_NUMPOINTS() was 302 vertices.

Question:

Why does SDE.ST_NUMPOINTS() add extra vertices to a line with arcs?

I'm guessing that it is densifying the arc. But, I don't understand why it would be doing that since it produces an incorrect result (defeats the purpose of the function).

5
  • 1
    When you store CAD curves in a geodatabase, it stores both the CAD object and a geometry. Only the geometry is exposed by the SDE.ST_Geometry type, so the vertex count reported by ST_NumPoints is correct.
    – Vince
    Jan 31, 2021 at 1:59
  • @Vince Interesting. I haven't been able to find documentation on how CAD features are stored in geodatabase FCs. I keep getting results for actual CAD files (DWGs). Can you give me a hint about what I should be searching?
    – User1974
    Jan 31, 2021 at 2:27
  • Everything about ST_Geometry is documented except how CAD objects interact. They're stored at the end of the binary stream, and are only exposed by undocumented functions.
    – Vince
    Jan 31, 2021 at 2:36
  • @Vince Would one be able to find a listing of ST_GEOEMTRY CAD functions in SDE.PACKAGES if one were so inclined?
    – User1974
    Jan 31, 2021 at 3:30
  • I doubt it, but my clients stopped using Oracle ten years ago, so I've never had to look.
    – Vince
    Jan 31, 2021 at 3:42

1 Answer 1

1

From @Vince:

When you store CAD curves in a geodatabase, it stores both the CAD object and a geometry. Only the geometry is exposed by the SDE.ST_Geometry type, so the vertex count reported by ST_NumPoints is correct.

Everything about ST_Geometry is documented except how CAD objects interact. They're stored at the end of the binary stream, and are only exposed by undocumented functions.

In other words, the CAD portion of the record is stored as an arc, but the geometry (SDE.ST_Geometry) is stored as a segmented approximation of the arc. Only the segmented approximation of the polyline is available to SDE.ST_Geometry functions.

2
  • 1
    There is one quirky part, which is touched on by one of your recent Q/As -- The area and perimeter reported on certain shapes which were created by perfect functions (e.g., SE_shape_generate_circle) report the exact value, not the area/perimeter of the segmented approximation). It appears this is applied to CAD curves as well, so while the vertex count is from the approximation, the length isn't (or, at least, isn't always).
    – Vince
    Feb 3, 2021 at 2:36
  • For reference, here is the documentation for that function ArcSDE SDK 10 C and Java API --> SE_shape_generate_circle.
    – User1974
    Feb 3, 2021 at 2:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.