How do i write a SQL query (using Oracle Spatial) to find the number of features available inside a polygon (geofence);
The features could be either points, lines or a polygon itself.
Thanks.
Try that statement:
select count(*) from geometry_table t where SDO_RELATE(t.geom_column, geofence, 'mask=INSIDE') = 'TRUE'
/
It is mandetory that the first parameter of SDO_RELATE
is the geometry column with a spatial index.