Spatial query help
Can anyone help, I'm trying to run the following query but all columns are returning nulls. I know there is data for the first 2 tables but the third table contains no data. In a live situation sometimes the table will contain data, sometimes it wont, how can I get it to the return the data that is there? Normally would do an outer join but can you do that with the sdo_relate operator? Tried various nvl and decodes too.
thanks !
select p.ident PRN, wqz.ident WQZ_ID, nvl(ced.ident,'dont know')
from property p, wqzone wqz, ced
where sdo_relate(wqz.geometry,p.geometry,'MASK=ANYINTERACT QUERYTYPE=WINDOW') = 'TRUE'
and sdo_relate(ced.geometry,p.geometry,'MASK=ANYINTERACT QUERYTYPE=WINDOW') = 'TRUE'
and p.ident = 765432
If you want to join the whole "property" table, you can try to run the select below.
I don't know how many rows you must quering. On my tables this query works fine up to 1000 records.
good job, regards
Carl
select
p.ident PRN, wqz.ident WQZ_ID, nvl(ced.ced_ident,'dont know')
from property p, wqzone wqz
, (select B.ident p_ident, A.ident ced_ident from ced A, property B
where sdo_relate(A.geometry, B.geometry,
'MASK=ANYINTERACT QUERYTYPE=WINDOW') = 'TRUE') ced
where p.ident = ced.p_ident (+)
and sdo_relate(wqz.geometry,p.geometry
,'MASK=ANYINTERACT QUERYTYPE=WINDOW') = 'TRUE'
Similar Messages
-
SSRS - SQL Server Spatial Query
Hi, I was hoping someone could help me.
I'm creating an SSRS report with Map and importing points via SQL Server Spatial query. I have a db table with 8,000 points bu the import only ever brings in the first 2,000 queried (no matter what the filter is). Is there a limitation in SSRS that can be
changed via a configuration setting?
Many thanks in advance for any help on this,
Steve.Really appreciate you coming back so quick Olaf.
No its a straightforward query (select AccountNum, Name, Address, Longitude, Lattitude, UrbanArea, County, MI_STYLE, MI_PRINX, SP_GEOMETRY from <table>)
Just to give the whole picture. I had 8,000 points in MapInfo version 10. I imported them to SQL Server 2012 via MapInfo Easy Loader.
The SQL Server spatial points import to SSRS and the Bing overlay map works great (so they import to correct space) but its only a subset of the points that import. I can pick any subset using the WHERE clause but I cannot get all 8,000 points.
I was hoping there was a configuration setting somewhere in SSRS that was causing the problem. -
Index problem in a spatial query
I try to run following query in SQL Plus:
SELECT A.objectid FROM TABBDG A, TABREG B
WHERE A.objectid = 68 AND B.regionname = 'Hong2'
AND SDO_RELATE(A.geoloc, B.geoloc, 'mask=INSIDE querytype = WINDOW') = 'TRUE';
To find out weather or not objectid = 68 is inside of region (='Hong2"). I got following error messages:
ERROR at line 1:
ORA-13226: interface not supported without a spatial index
ORA-06512: at "MDSYS.MD", line 1723
ORA-06512: at "MDSYS.MDERR", line 8
ORA-06512: at "MDSYS.SDO_3GL", line 57
ORA-06512: at line 1
But when I try to add an index to table TABREG, I got following error:
ERROR at line 1:
ORA-29879: cannot create multiple domain indexes on a column list using same indextype
Seem to me that the index was already there. Can any one help me? Thanks.I found out the reason of problem. I used an old version of EasyLoader (4.5?). When I get the latest EasyLoader V6.5, there is no problem any more to run spatial query. You can get lates EasyLoader V6.5 from MapInfo or from me at: [email protected]
Thanks for all help. -
Spatial Query, Use Multiple Cores
Basic question, is SQL 2012 running on Windows 2008 R2 64 bit expected to use multiple cores to execute it's tasks?
I have a table of points, 480, that has 3 empty columns that are being updated from 3 separate tables of polygons via a spatial join based on an intersection (STIntersects) of the point and polygons. All of the data is in 4326 and all tables have spatial
indexes.
The server running this query has 32 logical cores, but only 1 core is used and it is maxed out. It takes 53 seconds to complete the update. I have over a million points that need this done. I want to assume that if SQL can access more cores it will complete
faster.
I've looked at the actual execution plan and there is a 99% cost on the spatial query.
update A
set CONGRESS_DISTRICT = B.DISTRICT, HOUSE_DISTRICT = C.DISTRICT, SENATE_DISTRICT = D.DISTRICT
from [LegislativeMapData2014].[dbo].[CNRM_INFORCE_EXTRACT093014_COMBINED_GEOCODED] A
inner join [LegislativeMapData2014].[dbo].[CONGRESS_2014] B
on A.FEATURE_SHAPE.STIntersects(B.FEATURE_SHAPE) = 1
inner join [LegislativeMapData2014].[dbo].[HOUSE_2014] C
on A.FEATURE_SHAPE.STIntersects(C.FEATURE_SHAPE) = 1
inner join [LegislativeMapData2014].[dbo].[SENATE_2014] D
on A.FEATURE_SHAPE.STIntersects(D.FEATURE_SHAPE) = 1
Is there anything I can do to improve the performance of the query? Do I need to hint the indexes? Or something else?
ThanksHi,
updating millions of records could lock your resource and other users may have trouble connecting or reading data.
In some cases, variable table is your friend, insert the data you needed to a variable table before issuing the update.
with that, you may need to have (nolock) on each table. eg.
[LegislativeMapData2014].[dbo].[CONGRESS_2014] (nolock)
Regards,
gioVhan
Please remember to mark the replies as answers if they help and unmark them if they provide no help. -
hi, there.
I am working Oracle Spatial 9.0.1 and I have a problem about the
performance of spaital query, can someone help me resolve it?
/*query 1*/
select t1.line_seg
from spatial_list_Traj
where sdo_within_distance(convert_trajseg_to_lineseg
(t1.line_seg), MDSYS.SDO_GEOMETRY(2003, NULL, NULL,
MDSYS.SDO_ELEM_INFO_ARRAY(1, 1003, 3), MDSYS.SDO_ORDINATE_ARRAY
(212.117, 352.613, 221.617, 362.708)), 'querytype=filter
distance=0.5') = 'TRUE';
/* query 2*/
select t1.line_seg
from spatial_list_traj
where object_id = 1 and sdo_within_distance
(convert_trajseg_to_lineseg(t1.line_seg), MDSYS.SDO_GEOMETRY
(2003, NULL, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1, 1003, 3),
MDSYS.SDO_ORDINATE_ARRAY(212.117, 352.613, 221.617,
362.708)), 'querytype=filter distance=0.5') = 'TRUE';
there are about 120,000 rows in the spatial_list_Traj table and
query 1 takes only 1 second to finish, which is a good result
but if I add another condition, like query 2, the time cost is
still 1 second. I thought it can be much faster since there is
only 48 rows whose object_id is 1. what I expected it to do was
for the optimizer to filter out the rows that match
the 'object_id = 1' criteria and then do a spatial query on the
filtered data.
PS: there are two indices--a b-tree index on column 'object_id'
and of course, a functional spatial index on column 'line_seg',
which is a R-tree.
thanks in advance
Hu CaoHi Hu,
The second query is probably not using the spatial index. The
spatial index indexes the whole table based on spatial
relationships, so even though you may have filtered out all but
48 rows, the spatial index has to be applied to all of the rows.
In this case, it is probable that all of the rows returned with
object_id=1 are being geometrically compared with your query
window, which may account for the extra time.
You may want to try a hint to tell the optimizer not to use the
index on object_id, i.e.
SELECT /*+NO_INDEX(spatial_list_traj object_id_index_name)*/
Hope this helps,
dan -
Spatial Query across schemas. one version enabled table another not -Hanged
Hi,
I am executing a PL/sql procedure where a Spatial query run across two schemas. One table(in x schema) is version enabled and second table(in y schema) is Unversioned. Add to that complexity I am running the procedure from third user logon. I think I have enough previleges, as I won't get any error message.
But, Procedure worked fine when there is no table is version enabled. It started giving problem when one table got version enabled.
I have tried by setting " DBMS_WM.Gotoworkspace('LIVE');" before running spatial query. But still no luck, process just hangs on the spatial query.
I tried by using physical name of the Table (table1_LT) which is making it to work. But, as per Workspace manager guide, applications, programs should NOT use, this physical tables(because it is not the correct way on versioned table).
1. How can I hint to my query, to use a table from only live version?
2. Why Query is hanging forever (even tried by leaving it over night....)
Normally it used to take one or two minutes(before versioning..)
I have posted it Workspace manager forum, But No Luck (people seems to be shy away after seeing "Spatial query" )
Any help is highly appriciatedHi,
I will need to know more details about the specific query you are performing. So, please do the following:
1. list the actual query that you are using
2. generate an explain plan of the query both before and after the table was version enabled. use @?/rdbms/admin/utlxpls or anything that generates the predicate information.
3. also, give any pertinent details about the table(size of the table, number of rows expected to be returned, column types in the table, etc).
Based on that, I will see if I can suggest a possible hint that may be able to improve the performance of your query.
Regards,
Ben -
Ora-13226 when performing spatial query on view
Hi,
in my database I have a view with spatial column. The view is based on UNION ALL select. When I try to run spatial query on the view, the database returns ora-13226 error. When I recreate the view to consist only one select (without UNION ALL) the spatial query return correct result. Could you pls help me how to do a spatial query on spatial view whose definition contains UNION ALL select?
Thanks
AndrewHi,
it's quite simple:
create view test_view as
select id, geometry from table_a
union all
select id, geometry from table_b;
When I try for example:
select *
from test_view
where sdo_relate(geometry, (select geometry from table_c where id=1316),'mask=anyinteract') = 'TRUE';
it throws ora-13226 error.
Interesting is that following query where the geometry is directly included runs well:
select *
from test_view
where sdo_relate(geometry, MDSYS.SDO_GEOMETRY (....),'mask=anyinteract') = 'TRUE';
also when I recreate the test_view as
create view test_view as
select id, geometry from table_a;
then also the first query (with inner select) returns no error.
It's a little bit strange isn't it?
Andrew -
ORA-13199 Error on a spatial query
Hi,
I am getting following Error on a spatial query (on version 11.1.0.7)
"ORA-13199: Dimensionalities of geometry (GTYPE 3003) and diminfo (2) do not match.
ORA-06512: at "MDSYS.MD", line 1723
ORA-06512: at "MDSYS.MDERR", line 17
ORA-06512: at "MDSYS.SDO_CS", line 2809
ORA-06512: at "MDSYS.SDO_3GL", line 182 "
The same query used to work fine on 10.2.
My query looks like
Select Sfilt.GEOMETRY FROM
(Select TA.GEOMETRY FROM LANDPLAN.TOPOAREA TA, TEST.PLAN PL
WHERE PL.PLAN_ID = 12345 AND TA.LOC_CODE = 7
AND SDO_FILTER(TA.GEOMETRY,PL.GEOMETRY) = 'TRUE'
) Sfilt
,TEST.PLAN PL2 WHERE
PL2.PLAN_ID = 12345 AND
SDO_RELATE(PL2.GEOMETRY, sfilt.GEOMETRY, 'mask=anyinteract') = 'TRUE';
in the above data TEST.PLAN table is 2D table and LANDPLAN.TOPOAREA is 3D table and both are indexed.
Any help appriciated..Siva,
Thank you for your response. Now I have tried by increasing the DIMINFO (rebuiding the index) to three.
Now it shows below error..
ORA-29902: error in executing ODCIIndexStart() routine
ORA-13243: specified operator is not supported for 3- or higher-dimensional R-tree
ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 416
I didn't reason now...for clarity
Can I have 3d layer with 2d index's ?
If Yes, can Spatial query work using these 2d index's against other 2d layer and 3d layers ? -
Hello, I have this problem,
I use php for read data from oracle table,
all works right, I have any problem whith varchar number type data, but when I must read geometry data like
(type MDSYS.SDO_GEOMETRY)
I can't display it on the web page.
esemple of spatial query that I use:
select GEOMETRY_1
from table_a
where
ID = 970;
If I use sql plus I have this result
SDO_GEOMETRY(3001, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 0, 6000, 4, 1, 1), SDO_ORDINATE_ARRAY(1, -0, -
0, 580094, 4998494, -1))
but blank page when I use php sentence.
I use PHP Version 4.4.0
modules load are:
extension=php_sdo.dll
extension=php_oci8.dll
But I don't know which other module I need and also which php function to use for read array of array. at the moment I use @OCIFetchInto.
Someone can help me?
My English is very bad please reply easy.
Thanks for all!
AngeloThank you very much CJ.
Now there isn't any problems: you and this link (Re: PHP and spatial data and Adamo Bozzetti helped me
I have used SDO_UTIL.GETVERTICES
my complete php script is:
$conn = @OCILogon("xxxxxx", "xxxxx", "xxxxx") or die
( "Non riesco a connettermi al server $host ");
$query = "select
TABLE_A.tipo_via,
TABLE_A.nome_via,
c.codice_via,
t.X,
t.Y
from TABLE B c, TABLE_A , TABLE(SDO_UTIL.GETVERTICES(c.geometry1)) t
where c.codice_via = 830
and c.codice_via = TABLE_A.id_via
$istruzione = @OCIParse($conn, $query);
@OCIExecute($istruzione);
$nrows = @OCIFetchInto($istruzione, $results);
$trovati = 0;
while(@OCIFetchInto($istruzione, $results))
$trovati++;
?>
<table border width="800" >
<tr>
<td align="center" width="80" bgcolor ="#aaffee"><?echo trim($results[0]);?></td>
<td align="center" width="150" bgcolor ="#eeffee"><?echo trim($results[1]);?></td>
<td align="center" width="50" bgcolor ="#eeffee"><?echo trim($results[2]);?></td>
<td align="center" width="50" bgcolor ="#eeffee"><?echo trim($results[3]);?></td>
<td align="center" width="50" bgcolor ="#eeffee"><?echo trim($results[4]);?></td>
</tr>
</table>
<?
} //fine While
@OCIFreeStatement($istruzione);
@OCILogOff($conn); -
Simple Spatial Query caused ORA-03113: end-of-file on communication channel
I try to run a simple spatial query to find the ID's which inside the specified circle
select n.ID,n.FEATURE_ID
from NC_MANGROVE n
where sdo_relate(n.shape,
mdsys.sdo_geometry(2003,null,null,
mdsys.sdo_elem_info_array(1,1003,4),
mdsys.sdo_ordinate_array(848948,834940,848908,834980,848908,834900)),
'mask=ANYINTERACT querytype=WINDOW')='TRUE';
but it end up of ORA-03113: end-of-file on communication channel
Then I try another query, which I think do the similar thing
select n.ID,n.FEATURE_ID
from NC_MANGROVE n
where sdo_within_distance(n.shape,
mdsys.sdo_geometry(2001,null,mdsys.sdo_point_type(848908,834900,null),null,null),
'distance=40')='TRUE';
but same error occurs.
Is it the SQL*net configure problem. I am using Oracle 8.1.7 for both client and server.
Please help
TommyDoes SDO_FILETER Queries work fine? If so there is already reported bug and patch for that on Metalink site. Get all the patches for 8.17 spatial and install those.
-
Combined flat (regular) and Spatial query
DB: Oracle 8.1.7.2.1 (8i Release 3, patch 81721)
I performed a spatial query on the results of a regular query, in the form of:
Select count(*) from
(select * from myTable where key=...)
WHERE (MDSYS.SDO_RELATE("GEOLOC",
MDSYS.SDO_GEOMETRY(2003,NULL,null,
MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,3),
MDSYS.SDO_ORDINATE_ARRAY(-118.83939716391866,
29.951783100000025, -100.20650379608135,
40.52319191999998)),
'mask=ANYINTERACT layer_gtype=POINT
querytype = WINDOW')='TRUE');
The first flat query results in a small number of records and takes minimum time if run separately.
Select count(*) from
(select * from myTable where key=...)
However, when appended the spatial join condition, it takes a long time, same as querying from the whole dataset without the first flat query. I tried to optimize the spatial index and it did not help much.
Why isn't the spatial query taking advantage of the flat query? Can I somehow force it to do so to improve the performance? (This is a dynamic query in an application.)
Thanks.Hi
I have a similar problem and i'd like to know if anyone have got a solution.
We are developing a vehicle localization system.
The amount of data it's about 6 million positions per year.
The queries to the data could be the actual location of the vehicle (100 vehicles) or historical locations.
For historical location we have partitioned the table an index by date (each week), and for actual location we have created a bitmap index based on field L_ULTIMA.
Allwais the queries are filtered by alfanumeric conditions more restrictive then spatial (range of dates or last_location).
When runnin alfanumeric queries over a subset of une million rows, it takes only few seconds (even less) but when including spatial conditions (SDO_RELATE to a rectangle) it takes more than one minute.
We have tried different hints to force the use of bitmap index but in all cases the execution plan uses de spatial index.
It's there any way to combine spatial and flat indexes?
SELECT
COUNT(*)
FROM SLFP_LOCALIZACIONES A
WHERE sdo_relate(A.geom, mdsys.sdo_geometry(2003,NULL,NULL,
mdsys.sdo_elem_info_array(1,1003,3),
mdsys.sdo_ordinate_array(159657,3978069, 546051,4116358)),
'mask=anyinteract querytype=window') = 'TRUE';
COUNT(*)
899073
Transcurrido: 00:02:126.34
SELECT /*+ INDEX_COMBINE(A SLFP_LOCALI_ULTIMA_I) */
COUNT(*)
FROM SLFP_LOCALIZACIONES A
WHERE sdo_relate(A.geom, mdsys.sdo_geometry(2003,NULL,NULL,
mdsys.sdo_elem_info_array(1,1003,3),
mdsys.sdo_ordinate_array(159657,3978069, 546051,4116358)),
'mask=anyinteract querytype=window') = 'TRUE' AND
A.L_ULTIMA = 1;
COUNT(*)
102
Transcurrido: 00:02:121.00
SELECT COUNT(*) FROM SLFP_LOCALIZACIONES WHERE L_ULTIMA = 1
COUNT(*)
104
Transcurrido: 00:00:00.72
SQL> SELECT /*+ INDEX_COMBINE(A SLFP_LOCALI_ULTIMA_I) */
2 COUNT(*)
3 FROM SLFP_LOCALIZACIONES A
4 WHERE N_X >= 159657 AND
5 N_X <= 546051 AND
6 N_Y >= 3978069 AND
7 N_Y <= 4116358 AND
8 A.L_ULTIMA = 1;
COUNT(*)
102
Transcurrido: 00:00:00.59 -
Oracle spatial query SDO_LRS with php
Hello, I have this problem,
I use php for read data from oracle table.
I know I can't show on web page the result of SDO_ORDINATE_ARRAY
Christopher Jones has written that I must use SDO_UTIL.GETVERTICES like as
select
t.X,
t.Y
from table_a, TABLE(SDO_UTIL.GETVERTICES(table_a.GEOMETRY_1)) t
where
id_num = 970;
But now I must read a projection point ordinate of a point with respect to a geometric segment
and the same problem come back.
esemple of spatial query that I use:
SELECT
SDO_LRS.PROJECT_PT(geometry,
SDO_GEOMETRY(3301, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 1, 1), SDO_ORDINATE_ARRAY(580094.69, 4998493.68, NULL)) )
FROM
TABLE_B
WHERE
ID_CODE = 970;
If I use sql plus I have this result
SDO_LRS.PROJECT_PT(GEOMETRY,SD(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM
SDO_GEOMETRY(3301, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 1, 1), SDO_ORDINATE_ARRAY(
580093,325, 4998497,57, 45,2254405))
Which is exacly the query for extract these coordinates?
Someone can help me?
My English is very bad please reply easy.
Thanks for all!
AngeloHello thanks for all to everyboby.
I put the same question on Forum /Category/Database/Spatial and I have received this reply
from Brian Camire, this query worked well.
SELECT
T.X,
T.Y
FROM
TABLE
SELECT
SDO_UTIL.GETVERTICES
SDO_LRS.PROJECT_PT
GEOMETRY,
SDO_GEOMETRY
3301,
NULL,
NULL,
SDO_ELEM_INFO_ARRAY(1, 1, 1),
SDO_ORDINATE_ARRAY(580093.859, 4998493.5, NULL)
FROM
TABLE_B
WHERE
ID_CODE = 970
) T;
Best regards
Angelo. -
Memory Leak During Spatial Query
Platform:
Oracle 8.1.7 EE with Spatial
Windows NT 4.0
I'm seeing a memory leak that I have determined has something to do with spatial. Here is the PL/SQL code that generates the leak:
DECLARE
v_id NUMBER(16);
v_longitude NUMBER(15,10);
v_latitude NUMBER(15,10);
v_wirecenter_name VARCHAR2(11);
CURSOR c_Source IS
SELECT id, longitude, latitude
FROM prospects_geocode_info;
CURSOR c_WC IS
SELECT wc.wirecenter_name
FROM ion_info.ion_wirecenters wc
WHERE mdsys.sdo_relate(wc.geoloc,
mdsys.sdo_geometry(2001,
8265,
mdsys.sdo_point_type(v_longitude,
v_latitude,
NULL),
NULL,
NULL),
'mask=contains querytype=window') = 'TRUE';
BEGIN
open c_Source;
loop
fetch c_Source into v_id, v_longitude, v_latitude;
exit when c_Source%NOTFOUND;
if v_longitude is not NULL and v_latitude is not NULL THEN
open c_WC;
loop
fetch c_WC into v_wirecenter_name;
exit when c_WC%NOTFOUND;
end loop;
close c_WC;
end if;
end loop;
close c_Source;
END;
I'm attributing the link to spatial because if I change the c_WC cursor's SELECT statement to not use a spatial query, I get no leak. As near as I can tell I'm leaking a little bit of memory with each spatial query. I can watch the consumed memory jump in 64K blocks about every second or two on the machine I am running on.
I have tried pinning the code in memory, as well as pinning the spatial index and it's table in memory. None of this helps. I am continuing to experiment with this, but wanted to see if anyone had any ideas.
Thanks.
Matt.I have been able to reproduce the memory leak now using a very simple anonymous PL/SQL block. All it is doing is looping through a range of lon/lat and issuing a given spatial query. Here it is:
DECLARE
v_longitude NUMBER(15,10) := 0;
v_latitude NUMBER(15,10) := 0;
v_miprinx NUMBER;
v_lon_start NUMBER(15,10) := -150.0000000000;
v_lon_end NUMBER(15,10) := -30.0000000000;
v_lat_start NUMBER(15,10) := 20.0000000000;
v_lat_end NUMBER(15,10) := 70.0000000000;
CURSOR c_test IS
SELECT mi_prinx
FROM ion_info.ion_markets
WHERE mdsys.sdo_relate(geoloc,
mdsys.sdo_geometry(2001,
8265,
mdsys.sdo_point_type(v_longitude,
v_latitude,
NULL),
NULL,
NULL),
'mask=contains querytype=window') = 'TRUE';
BEGIN
FOR v_longitude IN v_lon_start..v_lon_end LOOP
FOR v_latitude IN v_lat_start .. v_lat_end LOOP
OPEN c_test;
LOOP
FETCH c_test
INTO v_miprinx;
EXIT WHEN c_test%NOTFOUND;
END LOOP;
CLOSE c_test;
END LOOP;
END LOOP;
END;
On my 8.1.7 database on NT 4.0 I get the same results on all three tables that have spatial indexes. I tried this on a different spatial table on 8.1.6 on NT 4.0 and saw no memory leak. It doesn't matter whether I execute the script using sqlplus or sqlplusw.
Matt. -
Simple spatial query with different SRID
Can anyone help me with just a real simple spatial query with different SRID.
Here is the error i get when i perform the query:
AND SDO_RELATE(A.geometrie_point, B.GEOMETRIE_POLYGONE, 'mask=anyinteract querytype=WINDOW') = 'TRUE'
ERROR at line 4:
ORA-00604: error occurred at recursive SQL level 1
ORA-13207: incorrect use of the [IN COMPATIBLE BOUNDS in SDO_RELATE] operator
ORA-06512: at "MDSYS.SDO_INDEX_METHOD", line 84
ORA-06512: at line 4Hi,
I am using 8.1.7.2 and i have the lattest spatial patch.
From the start i had different SRID. The only thing i changed was the bounds of the coordinate system.
I reset my bounds of the coordinate system with SRID 8307 to -180,
180 in X (longitude), and -90,90 in Y (latitude) to see if the query window geometry
(geom2) will be transformed to the coordinate system of the layer geometries (geom1)
Her is the content of the user_sdo_geom_metadata :
GIS_PCP GEOMETRIE_POINT
SDO_DIM_ARRAY(SDO_DIM_ELEMENT('X', -5800000, 3600000, .00000005), SDO_DIM_ELEMENT('Y', 3516000, 6000000, .00000005))
82227
GIS_TEST GEOMETRIE_POLYGONE
SDO_DIM_ARRAY(SDO_DIM_ELEMENT('X', -180, 180, .00000005), SDO_DIM_ELEMENT('Y', -90, 90, .00000005))
8307
Here is my query :
select /*+ ordered */ A.no_point
from gis_pcp A, gis_test B
WHERE SDO_RELATE(A.geometrie_POINT, B.GEOMETRIE_POLYGONE, 'mask=anyinteract querytype=WINDOW') = 'TRUE';
Here is my result :
WHERE SDO_RELATE(A.geometrie_POINT, B.GEOMETRIE_POLYGONE, 'mask=anyinteract querytype=WINDOW') = 'TRUE'
ERROR at line 3:
ORA-00604: error occurred at recursive SQL level 1
ORA-13207: incorrect use of the [IN COMPATIBLE BOUNDS in SDO_RELATE] operator
ORA-06512: at "MDSYS.SDO_INDEX_METHOD", line 84
ORA-06512: at line 4
If i change the bounds of GIS_TEST to the exact bouns of GIS_PCP then i dont have the error message above and i have correct results. Do i have the adjust the bounds of every layer to fit the biggest bound? -
Can anyone help me with just a real simple spatial query. All I want to do is identify which police district a parcel falls in. I have two shapefiles police and parcel and I know I should do an relate but I just can't figure out to get the answer back. Can anyone help me.
MattHere is an example to try...
select pd.district_name
from parcels p,
police_district pd
where p.apn = 'XXXXXXXX'
and mdsys.sdo_relate
(p.shape,pa.shape,'querytype=window mask=anyinteract') = 'TRUE';
Note that the table names have aliases (p and pd).
I am just learning Oracle Spatial too but this example should work.
Tom Elder
City of Phoenix
[email protected]
Maybe you are looking for
-
File name mystery - works in BeanShell - but not in plain java
I have added a step in a KM with the following: <% import java.io.*; try FileWriter tempFile = new FileWriter("newSourceTableList_"+odiRef.getSession("SESS_NO")+".txt"); tempFile.write(newSourceTableList); tempFile.close(); catch (Exception e) out.pr
-
Create a abap server proxy and consume the service with the pi WS Navigator
hi all: i create a abap server proxy ,i use the t_code "sproxy" to generate the proxy, and then write the abap code to implemente the method; then i use the T-code (soamanager) to define the endpoint, but when i click the " Open WSDL document
-
why won't iphoto slideshow not use my edited tracks from i tunes, i have shortened length of tracks to fit in my slide show but whenever i try to add them they play full version of music instead of shortened one, if i play back on itunes music is how
-
Clarifications in External Reconciliations
Hi experts, Need your valuable suggestions for the below raised situation in Banking reconciliations. One of our client is doing bank external reconciliation through Manual Reconciliation. Last time when he is doing the reconciliation, he selected th
-
Hi people, Please, does anybody know how could I implement an incremental search in a List? This List is based on RMS data and it must work like that: one List is exhibited with the first registry highlighted, user start to type cellular keyboard and