Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Point-in-polygon spatial queries
Hello!
I've got Oracle 8i EE installed on a Win NT 4.0 server. I have some
questions about writing spatial queries (I'm brand new to the Oracle
Spatial Cartridge). My company has purchased a ton of data from
MapInfo and loaded several MapInfo tables into our Oracle db. We're at
a point now where we're trying to figure out how to query the data
we've loaded. I need a query that will, when fed a latitude and
longitude, find all polygons in a spatial table that contain that
point. I've looked at the Oracle 8i documentation, and it says that
it's possible to do such a query, but I'm having trouble pulling the
query I need from the doc's examples. For example, suppose I have a
point in space represented by latitude 12.345678 and longitude
87.654321, and suppose I have two tables (one spatial table and its
associated index table) with the following structures:
Table 1: "Spatial_table". Structure:
NPA VARCHAR2(10) NULL, NXX VARCHAR2(10) NULL, NUMB VARCHAR2(10) NULL, PRINX NUMBER NULL, GEOLOC MDSYS.SDO_GEOMETRY NULL Table 2: "Spatial_table_SX_HL12N4$". Structure: SDO_GROUPCODE RAW(14) NULL, SDO_ROWID ROWID NULL, SDO_CODE RAW(14) NULL, SDO_META RAW(14) NULL, SDO_MAXCODE RAW(14) NULL
Could someone please:
1)Let me know if the two tables above, along with a point in space,
give me everything I need to write my query, and
2)send me a query that returns the NPA, NXX, and NUMB columns for all
rows in the spatial_table whose polygons contain the point in space
listed above?
3)Give me the title of a good book that covers the Spatial Cartridge
and Spatial queries in depth?
(In case you're wondering, our MapInfo representative is swamped and
won't be able to help us for at least a few weeks, which is more time
to wait than we have.)
Thanks in advance for any help you can provide. And sorry about the terribly long post.
Thanks,
Vince
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Tue Nov 23 1999 - 14:12:17 CST