Skip to main content
Question

How to SELECT all records with Point geometry?

  • December 5, 2024
  • 3 replies
  • 26 views

nicholas
Contributor
Forum|alt.badge.img+11

Hello all,

I have an Oracle Spatial table that contains some records with a Point geometry and some records with a Polygon geometry.

Considering the large number of records, I would like to take advantage of the ability of the Oracle Spatial Reader to perform a SELECT within the Oracle database and return only records with a Point geometry

(This is preferable to Reading all records and then using a GeometryFilter for performance reasons)

How to I write the SELECT statement?

I assume it has something to do with SDO_GEOMETRY, but I just cannot get the syntax correct

3 replies

philipwhitten
Contributor
Forum|alt.badge.img+11

I haven’t used oracle, but from https://docs.oracle.com/database/121/SPATL/point.htm#SPATL529 it looks like:

      WHERE table_alias.field_name.SDO_GTYPE=2001 (e.g. WHERE c.shape.SDO_GTYPE=2001).

 

Something like this should work for a 2 dimensional single point.


nicholas
Contributor
Forum|alt.badge.img+11
  • Author
  • Contributor
  • December 5, 2024

I get an “invalid identifier” error


geomancer
Evangelist
Forum|alt.badge.img+47
  • Evangelist
  • December 5, 2024

Use SQLCreator (instead of the Oracle Spatial Reader) to read data with a SQL command on geometry.

select * from YOUR_TABLE t where t.YOUR_GEOMETRY_COLUMN.sdo_gtype = 2001

Enter your own values for YOUR_TABLE and YOUR_GEOMETRY_COLUMN.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings