SDO_INSIDE, SDO_ANYINTERACT, SDO_JOIN
699131May 5 2009 — edited May 6 2009Hi,
I have two spatial tables which are called "poly_gr" and "poi_gr".
I would like to find the poi's that are in a specified polygon. I have tried sdo_inside, sdo_anyinteract and sdo_join commands, but these commands didn't work correctly for the polygon.
Because the polygon has a complex geometry. When I open the table with MapInfo, I see there are 9 points inside the polygon, but sdo_join and sdo_anyinteract returns 15 points, sdo_inside returns nothing.
When I double click on the polygon in MapInfo these info appers :
total area : 2122 sq km
total perimeter : 72.34 km
line segments : 34115
polygons : 805
When I try the spatial commands with basic polygons (like grid) it works fine.
The commands which I used :
SELECT A.ID,P.ID
FROM TABLE(SDO_JOIN(POLY_GR','GEOLOC','POI_GR','GEOLOC')) J,
POLYGR A,
POI_GR P
WHERE J.ROWID1 = A.ROWID
AND J.ROWID2 = P.ROWID
AND A.ID = 34104009
--------------------------------------------------------------------------------
SELECT A.ID,P.ID
FROM POLY_GR A,
POI_GR P
WHERE A.ID = 34104009
AND SDO_ANYINTERACT(P.GEOLOC,A.GEOLOC) = 'TRUE'
--------------------------------------------------------------------------------
SELECT A.ID,P.ID
FROM POLY_GR A,
POI_GR P
WHERE A.ID = 34104009
AND SDO_INSIDE(P.GEOLOC,A.GEOLOC) = 'TRUE'
--------------------------------------------------------------------------------
By the way I have tried theese...
--Return nothing
SELECT A.ID,P.ID
FROM POLY_GR A,
POI_GR P
WHERE A.ID = 34104009
AND SDO_CONTAINS(P.GEOLOC,A.GEOLOC) = 'TRUE'
--------------------------------------------------------------------------------
--Return nothing
SELECT A.ID,P.ID
FROM POLY_GR A,
POI_GR P
WHERE A.ID = 34104009
AND SDO_RELATE(P.GEOLOC,A.GEOLOC,'mask=inside+overlapbdyintersect+contains) = 'TRUE'
--------------------------------------------------------------------------------
What is the wrong? Any help, any advice will be worderfull. Thanks...