Select to view content in your preferred language

oracle sql query for fetching data from table with in a polygon st_geometry datatype based on coordinate

1223
1
11-25-2020 12:37 PM
AdeebFarhan
Emerging Contributor

We have a featureclass containing city names and it’s border as polygon shape.The column is st_geometry. We are trying to fetch the city based on the coordinates using the below st geometry query. Even though the coordinates are exactly with in the border the query is not fetching any records.

select NAME1 from GTSOWNER.CM_BOUNDARY3_PG  where sde.st_within (sde.st_point(45.576579,26.460792,32637),shape)=1;

Tried with multiple options without any luck

The database is oracle. the arcGIs version is 10.2

Adeeb

Data type from ArcCatelogData type from ArcCatelogSpatial ReferenceSpatial ReferenceSample Data in TableSample Data in Table

0 Kudos
1 Reply
DavidPike
MVP Frequent Contributor

do you have a spatial index on the shape field?

or possibly:

select NAME1 from GTSOWNER.CM_BOUNDARY3_PG a  where sde.st_within (sde.st_point(45.576579,26.460792,32637), a.shape)=1;