sdo_contains help [message #570124] |
Mon, 05 November 2012 15:06 |
gentleman777us
Messages: 122 Registered: April 2005
|
Senior Member |
|
|
Objective: given latitude and longitude I need to get the county name and county state from the US_COUNTIES tables which has geometry column of the polygon.
I have the following query:
select county, state
from us_counties usc
where sdo_contains(usc.geom, sdo_geometry(2001,8307,sdo_point_type(-159.7278747,22.0824105,null),null,null)) = 'TRUE';
I get no records
Is there anything wrong with my query.
the geom colum in US_COUNTIES table has spatial index.
Am I missing anything,
Any help is greatly appreciated.
Thanks
|
|
|
|
Re: sdo_contains help [message #570551 is a reply to message #570124] |
Mon, 12 November 2012 03:42 |
_jum
Messages: 577 Registered: February 2008
|
Senior Member |
|
|
You could use the RELATE function from the SDO_GEOM package before/instead of the spatial OPERATOR SDO_CONTINS.
The function doesn't need a spatial index and you get an idea how the geometries interact with the point:
SELECT county, state,
SDO_GEOM.relate (usc.geom, 'DETERMINE', sdo_geometry (2001,8307,sdo_point_type (-159.7278747, 22.0824105, NULL),NULL,NULL), 0.001) rela
FROM us_counties usc;
Excuse - I just see, that's what Barbara suggested.
[Updated on: Mon, 12 November 2012 03:43] Report message to a moderator
|
|
|