sdo_geom
Hello
working with oracle 11.2.0.1.0, the following query returns to the INSIDE of the relationship, in fact it is DISJOINT.
Select sdo_geom.relate (a.geometry, "determine", b.geometry, 0.05) test a, b test where a.idnumber =' Steve ' and b.idnumber ='abcd ';
ABCD MDSYS. SDO_GEOMETRY (2003,8307, NULL, MDSYS. SDO_ELEM_INFO_ARRAY (1,1003,1), MDSYS. SDO_ORDINATE_ARRAY(-63.511895146,44.883927382,-63.511917747,44.883932719,-63.511943823,44.883931141,-63.51234812,44.883862534,-63.512410738,44.88381001,-63.512641895,44.883616114,-63.512867359,44.88342672,-63.512910261,44.883383825,-63.513899075,44.882385966,-63.515021288,44.88124581,-63.515320558,44.880941675,-63.51553685,44.880721866,-63.515847735,44.880405706,-63.51680081,44.879436458,-63.517103832,44.879128292,-63.517949007,44.878268728,-63.518479978,44.87772787,-63.518536077,44.877670724,-63.519862136,44.876324062,-63.520352141,44.875826445,-63.520875977,44.87529447,-63.521012779,44.87515414,-63.521029469,44.875134851,-63.521038752,44.875117469,-63.521046038,44.875094454,-63.521048577,44.875072368,-63.521046494,44.875048106,-63.521040844,44.875027953,-63.52103162,44.875008859,- 63.521019009,44.874991525,-63.521007524,44.874978615,-63.520990199,44.874959284,-63.520968364,44.874936809,-63.520940738,44.874911432,-63.520880061,44.874862375,-63.520848717,44.874840831,-63.520786635,44.874798894,-63.520716909,44.87475688,-63.520654302,44.87472334,-63.520595816,44.874695319,-63.520515013,44.874662486,-63.520428784,44.874634104,-63.520350631,44.874613439,-63.520278473,44.874598439,-63.520198047,44.874586401,-63.520111209,44.874577969,-63.520030138,44.874573262,-63.519940956,44.874571591,-63.519864301,44.874573084,-63.519778699,44.874576795,-63.519678073,44.874584332,-63.519579202,44.874595104,-63.519494358,44.874607036,-63.519408372,44.874621695,-63.519327355,44.874637906,-63.5192365,44.874658704,-63.519146286,44.87468136,-63.519068168,44.874703018,- 63.518959636,44.874736331,-63.518903063,44.874755342,-63.518846253,44.874775112,-63.518734517,44.874888332,-63.518819058,44.874842649,-63.518911751,44.874805767,-63.518987812,44.874779833,-63.519068179,44.874756665,-63.519145115,44.874733827,-63.519236361,44.874709944,-63.519317179,44.874691623,-63.519397124,44.87467606,-63.519484395,44.874661925,-63.519579638,44.874649845,-63.519683429,44.874636,-63.519759209,44.87462827,-63.519846351,44.87462252,-63.519921021,44.874620247,-63.51997481,44.874620122,-63.520026922,44.874621208,-63.520065397,44.874622774,-63.520116942,44.874628591,-63.52017073,44.874635781,-63.520235021,44.874645889,-63.520280769,44.874654097,-63.520326648,44.874663184,-63.520375078,44.874673719,-63.520425629,44.874687552,-63.520482676,44.874707912,-63.520528305,44.874726295 ,-63.520576379,44.87474778,-63.520632999,44.874776024,-63.520716465,44.874823086,-63.520783988,44.874867665,-63.52083892,44.874909345,-63.520882895,44.874944811,-63.520901148,44.874963038,-63.520909245,44.874980936,-63.520907967,44.875005651,-63.520897312,44.875041872,-63.520863074,44.875132124,-63.520839957,44.875175126,-63.520794797,44.875224578,-63.520599847,44.875421292,-63.5183909,44.877657061,-63.518139304,44.877922764,-63.513933818,44.882196182,-63.513853277,44.882276678,-63.512799484,44.883329899,-63.512687478,44.883425868,-63.51262839,44.883472607,-63.512545714,44.883531,-63.512460967,44.883591331,-63.512370783,44.88364668,-63.512277899,44.883698706,-63.512239574,44.883718778,-63.512214286,44.883731593,-63.512183522,44.883745273,-63.512164668,44.883751508,- 63.512138925,44.883759169,-63.512107764,44.883767169,-63.512079528,44.883773247,-63.512043277,44.88377946,-63.512007231,44.883783905,-63.511967858,44.883786821,-63.511934709,44.883787722,-63.511905193,44.883787333,-63.511866053,44.883785083,-63.511843135,44.883782842,-63.511807275,44.883773062,-63.511784093,44.883763448,-63.511752174,44.883749749,-63.511716923,44.883733988,-63.511673453,44.883713618,-63.511621498,44.883687881,-63.511531986,44.883639829,-63.511326651,44.88353215,-63.511239223,44.883478511,-63.5110421,44.883340078,-63.510961335,44.883282054,-63.51092987,44.883255839,-63.510910861,44.883230934,-63.510892506,44.883190955,-63.510812347,44.883009086,-63.510802747,44.88297249,-63.510804296,44.882923898,-63.510687933,44.883041808,-63.510805401,44.883275341,- 63.51081841,44.883296868,-63.510836851,44.883312892,-63.510952665,44.883397298,-63.511170025,44.883557617,-63.511199734,44.883577286,-63.511224225,44.88359013,-63.511545644,44.883751197,-63.511895146,44.883927382))
Steve MDSYS. SDO_GEOMETRY (2003,8307, NULL, MDSYS. SDO_ELEM_INFO_ARRAY (1,1003,1), MDSYS. SDO_ORDINATE_ARRAY(-63.518193562,44.878400883,-63.518170639,44.878424027,-63.51732663,44.879276283,-63.517306365,44.879305756,-63.517302882,44.879339193,-63.517307944,44.879370666,-63.517313567,44.879396826,-63.517331081,44.879425327,-63.517352059,44.879449059,-63.517529907,44.879536473,-63.517450676,44.87944834,-63.517428804,44.879421979,-63.51741049,44.879399976,-63.517401953,44.879376169,-63.517411281,44.879350954,-63.517430699,44.879327567,-63.518392524,44.878351357,-63.518193562,44.878400883))
In 11.2.0.3, I have DISJOINT. So, it could be a bug on 11.2.0.1.
Tags: Database
Similar Questions
-
SDO_GEOM. Relate ("The INTERIOR", polygon, polygon)
Hello
I need to execute a query using a geometry table WKT, but it doesn't produce any result (0 rows returned)
The query is as follows:
SELECT... Of... WHERE...
AND SDO_GEOM. RELATE (GEOGRAPHICAL_LOCATION, "ANYINTERACT", MDSYS. SDO_GEOMETRY (2003,8307, NULL, MDSYS. SDO_ELEM_INFO_ARRAY (1,1003,3), MDSYS. SDO_ORDINATE_ARRAY (33.0,36.0,37.0,41.0)), 0.05) = 'TRUE '.
AND SDO_GEOM. RELATE (GEOGRAPHICAL_LOCATION, 'INSIDE', SDO_GEOMETRY ('POLYGON ((-90,180-180-90, 180 90, 90-180-180-90))', 8307), 0.05) = "INSIDE".
AND ROWNUM < 500;
If I remove 'INSIDE' query filter, it produces the results so I think that it is not a problem with the spatial index.
So dig in I met the problem, there is an inconsistency (probably I'm wrong somewhere). The symptoms are given such as:
1. try specified polygon is inside a box (World MBR [-180, 180] X [-90, 90])
Select SDO_GEOM. RELATE)
MDSYS. SDO_GEOMETRY (2003,8307, NULL, MDSYS. SDO_ELEM_INFO_ARRAY (1,1003,1), MDSYS. SDO_ORDINATE_ARRAY (36,26,45,26,45,38.5,36,38.5,36,26))
, "INSIDE."
MDSYS. SDO_GEOMETRY (2003,8307, NULL, MDSYS. SDO_ELEM_INFO_ARRAY (1,1003,3), MDSYS. SDO_ORDINATE_ARRAY(-180,-90,180,90))
0.05) than double;
happening 'INSIDE'
2 try specified polygon is inside a polygon (World MBR [-180, 180] X [-90, 90])
Select SDO_GEOM. RELATE)
MDSYS. SDO_GEOMETRY (2003,8307, NULL, MDSYS. SDO_ELEM_INFO_ARRAY (1,1003,1), MDSYS. SDO_ORDINATE_ARRAY (36,26,45,26,45,38.5,36,38.5,36,26))
, "INSIDE."
MDSYS. SDO_GEOMETRY (2003,8307, NULL, MDSYS. SDO_ELEM_INFO_ARRAY (1,1003,1), MDSYS. SDO_ORDINATE_ARRAY(-180,-90,180,-90,180,90,-180,90,-180,-90))
0.05) than double;
which produces 'FALSE' (and 2nd points of the polygon is defined in order counterclockwise)
3. try specified polygon is inside a polygon defined by WKT (World MBR [-180, 180] X [-90, 90])
Select SDO_GEOM. RELATE)
MDSYS. SDO_GEOMETRY (2003,8307, NULL, MDSYS. SDO_ELEM_INFO_ARRAY (1,1003,1), MDSYS. SDO_ORDINATE_ARRAY (36,26,45,26,45,38.5,36,38.5,36,26))
, "INSIDE."
SDO_GEOMETRY ('POLYGON ((-90,180-180-90, 180 90, 90-180-180-90))', 8307)
0.05) than double;
which produces 'FALSE' (and 2nd points of the polygon is defined in order counterclockwise).
4. to be sure, I generated WKT using geometry in 1st round by SDO_UTIL package which is
Select SDO_GEOM. RELATE)
MDSYS. SDO_GEOMETRY (2003,8307, NULL, MDSYS. SDO_ELEM_INFO_ARRAY (1,1003,1), MDSYS. SDO_ORDINATE_ARRAY (36,26,45,26,45,38.5,36,38.5,36,26))
, "INSIDE."
SDO_GEOMETRY (SDO_UTIL.to_WKTGEOMETRY (MDSYS. SDO_GEOMETRY (2003,8307, NULL, MDSYS. SDO_ELEM_INFO_ARRAY (1,1003,3), MDSYS. SDO_ORDINATE_ARRAY(-180,-90,180,90))), 8307)
0.05) than double;
that always produces 'FALSE '.
Could someone please help find what's not here.
Thanks in advance.
By the way; the oracle DB version is:
Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production
PL/SQL Release 11.2.0.2.0 - Production
"CORE 11.2.0.2.0 Production."
AMT for Linux: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production
found the problem to: http://docs.oracle.com/cd/B28359_01/appdev.111/b28400/sdo_cs_concepts.htm#SPATL624
who says:
The following size limits apply, with geodetic data:
- No polygon element can have a greater or equal to the half of the surface of the Earth.
- Online, the distance between two adjacent coordinates cannot be greater or equal to half of the perimeter (a great circle) of the Earth.
-
Sdo_Geom.Sdo_Intersection does not vertices overlapping
Hi all
I run the query where I try to get the number of vertices that intersect between 2 objects GEOM below.
Sdo_Util.Getnumvertices (Sdo_Geom.Sdo_Intersection(B.geom,R.geom,.00000000005))
The query above works fine when, for ex B.GEOM to say 5 different X tops and are coordinated. It gives me the good number of vertices that intersect with R.GEOM.
However, in my case, B.GEOM has 15 peaks, all having the same X and are coordinated. When I run the above query, the output returned is 1 when there are actually 15 peaks that are intertwined with R.GEOM.
I am a novice in the database space and not very sure if Sdo_Geom.Sdo_Intersection will remove duplication/overlap of the summits? I want to be able to examine all vertices that overlap as well. Can you get it someone please let me know if I'm doing the right thing here?
Please see below the image of intersection where B.Geom have 15 vertices overlapping and R.Geom is the polygon.
You poor soul, who deals these clusters on you anyway? They should buy lunch you.
So yes, go getnumelem to getnumvertices in the meter of the loop, and then you will need manually extract every x, y in a temporary point normal, simple geometry in the loop.
Here's a little revised sample PL/SQL.
declare multip sdo_geometry := sdo_geometry (2005, null, null, sdo_elem_info_array (1,1,3), sdo_ordinate_array (50,5, 55,7, 60,5)); singlep sdo_geometry; poly sdo_geometry := SDO_GEOMETRY (2003, NULL, NULL, SDO_ELEM_INFO_ARRAY (1, 1003, 1), SDO_ORDINATE_ARRAY (-100,-100,100,-100,100,100,-100,100,-100,-100)); kount pls_integer := 0; begin for i in 1 .. sdo_util.getnumvertices(multip) loop singlep := SDO_GEOMETRY ( 2001, multip.sdo_srid, SDO_POINT_TYPE ( multip.sdo_ordinates(i * 2 - 1), multip.sdo_ordinates(i * 2), NULL ), NULL, NULL); --debuggin tip - use determine mask --dbms_output.put_line(sdo_geom.relate(singlep, 'mask=DETERMINE', poly, .05)); if sdo_geom.relate(singlep, 'mask=INSIDE', poly, .05) <> 'FALSE' then kount := kount + 1; end if; end loop; dbms_output.put_line(kount); end;
-
Hello world
I'm dealing with this error while trying spatial data bad list (11.0.2.0.3 (AIX) RAC)
Select *.
Table
Where SDO_GEOM. VALIDATE_GEOMETRY_WITH_CONTEXT (GEOMETRY, 0.001)! = 'TRUE '.
It returns:
ORA-13199: there is no SRID
ORA-06512: at the 'MDSYS. MD", line 1723
ORA-06512: at the 'MDSYS. MDERR", line 17
ORA-06512: at the 'MDSYS. SDO_CS", line 5328
ORA-06512: at the 'MDSYS. SDO_GEOM", line 483
ORA-06512: at the 'MDSYS. SDO_GEOM", line 560
ORA-06512: at line 1
Is there someone who faced this kind of question or any idea?
Thanks in advance
Concerning
There is no such 2000303 SRID. However, it seems that, as it does the same thing. Replace all values in SRID 2320 and you should be set.
SQL > select *.
2 of MDSYS. SDO_COORD_REF_SYSTEM
3 where srid = 2320;
SRID COORD_REF_SYS_NAME COORD_REF_SYS_KIND
---------- -------------------------------------------------------------------------------- ------------------------
COORD_SYS_ID DATUM_ID GEOG_CRS_DATUM_ID SOURCE_GEOG_SRID PROJECTION_CONV_ID CMPD_HORIZ_SRID CMPD_VERT_SRID
------------ ---------- ----------------- ---------------- ------------------ --------------- --------------
INFORMATION_SOURCE
------------------------------------------------------------------------------------------------------------------------
DATA_SOURCE IS_LE LEGACY_CODE
---------------------------------------- ----- -----------
LEGACY_WKTEXT
------------------------------------------------------------------------------------------------------------------------
LEGACY_CS_BOUNDS (SDO_GTYPE, SDO_SRID, SDO_POINT_TYPE (X, Y, Z), ANSDO_ELEM_INFO, SDO_ORDINATES)
------------------------------------------------------------------------------------------------------------------------
IS_VA SUPPO
----- -----
ED50 2320 / PROJECTED TM30
4530 6230 4230 16370
Major mapping via EuroGeographics; http://CRS.IFAG.de/
EPSG FALSE
TRUE TRUE
-
about precision sdo_geom.sdo_intersection
I'm under Oracle EE on Linux.
I have a test query:
SELECT SDO_GEOM. () SDO_INTERSECTION
SDO_GEOMETRY (2003, 4269, NULL, SDO_ELEM_INFO_ARRAY, (1, 1003,1), SDO_ORDINATE_ARRAY (114-28, 114, -36, 126, -36, 126, -28, 114, -28)).
SDO_GEOMETRY (2003, 4269, NULL, SDO_ELEM_INFO_ARRAY, (1, 1003,1), SDO_ORDINATE_ARRAY (114, -28, 114, -32, 120, -32, 120, -28, 114, -28)).
0.1
). SDO_ORDINATES FROM DUAL;
The result:
MDSYS. SDO_ORDINATE_ARRAY (120, - 32, 120,-28.1306637561154, - 28, 114, - 32, 120, 114-32)
Can someone please explain to me why the result isn't MDSYS. SDO_ORDINATE_ARRAY (120, - 32, 120,-28, 114-28, 114, -32, 120-32)? There are, as if accuracy issue, which - 28.1306637561154 would be-28.
Can someone advice me what I should do to get the result (120,-32,120,-28,114,-28,114,-32,120,-32)?
SRID 4269 = is for geodetic geometries, not for the geometries of project, so that
line ((120,-28), (114, -28)) is not on a line of latitude constant (or parallel).
It's a big circle.
-
Hi people,
I found a strange case where sdo_geom.validate_geometry_with_context returns an error:
Select sdo_geom.validate_geometry_with_context (SDO_GEOMETRY (2003, 8307, NULL, SDO_ELEM_INFO_ARRAY (1, 1003, 1), SDO_ORDINATE_ARRAY (0,0, 51.9273, 0.3556, 51.9273, 0.3910, 51.9274, 0.1964, 51.9274, 0,0, 51.9273)), 1) twice;
13349 [element < 1 >] [ring < 1 >] [m < 3 >] [edge < 1 >]
Tolerance to 8307 SRID is in meters, right? The form is a parallelogram, although lat dimension is about 0.0001 grad or about 11 meters. All tips why is there an error?
using Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production
Published by: Slava2 on May 27, 2013 03:12These edges are not straight, curved (large circles / on the globe/ellipse). Your first edge is almost 2 times the length of the 3rd. In your case, this means that the first edge is less "straight" / more curved.
The point on the first Board at longitude 0.19640 has latitude +-51.927445, which means that your 4th point is lower, causing the edges at the intersection (at the place described by Jum'a).You can quickly test it by drawing your polygon on Google Earth.
Small note to Jum'a, tolerance is (effectively) in meters. However must be no smaller than 5 cm, or 0.05.
Luke
-
Vs MDSYS Haversine formula. SDO_GEOM. SDO_DISTANCE
We need calculate the distance between 2 lat/long (from the GPS unit).
What is more precise, the use of MDSYS. SDO_GEOM. SDO_DISTANCE or a hand coded formula Haversine?
Thank you
JBWell, the best thing to do is to perform a test.
I looked at this website: http://www.movable-type.co.uk/scripts/latlong-vincenty.html
The answer to the default functional demo is 969954.114 meters.
Test with SDO_DISTANCE, we get (I converted values DMS to DD):
select sdo_geom.sdo_distance( sdo_geometry(2001,8307,sdo_point_type(-5.71475, 50.0663222222,null),null,null), sdo_geometry(2001,8307,sdo_point_type(-3.07009444444,58.6440222222,null),null,null), 0.05) as dist from dual; -- Result -- 969954.113110585
Which is pretty similar!
So, don't bother coding your own Haversine (you need to add additional parameters to pass in parameters to ellisodal for non - WGS84 SRID...), use what comes out of the box.
That answer your question? If so, please give points.
concerning
Simon -
Slow query using the SDO_GEOM package
Hello
I have a query that retrieves data from a table:
SDO_GEOM.sdo_centroid (geometry, 0.5).sdo_point.x
It's very, very slow, but about 15 seconds to 300 cases.
Delete this package to select, it's very fast.
Ideas for how tuning package spacial?
TNXyou better to activate extended SQL trace (tkprof utility) and paste the result, if the experts are around here if your chance favor, then you can get some clues.
Khurram
-
sdo_geom.relate vs sdo_relate
Hello
As a beginner to oracle space, I have a query which is a little confusing me.
I understand that sdo_relate uses the spatial index and queries data slightly differently than sdo_geom.relate therefor.
I have a database of street that is shared by postal code, for example if a street passes through 3 postal codes, I have it divided into 3 separate blocks.
Now, I want to go back to all segments of the streets and their post_code id matching.
-REQUEST 1
Select street_id, post_code p.id s.id
of AP_STREETS s, AP_POSTCODE p
where sdo_relate (s.geoloc, p.geoloc, "MASK = INSIDE + DOMMAGESCAUSDSPAR") = "TRUE";
-REQUEST 2
Select street_id, post_code p.id s.id
of AP_STREETS s, AP_POSTCODE p
where sdo_geom.relate (s.geoloc, 'INTERIOR + DOMMAGESCAUSDSPAR', p.geoloc, 0.05) = "INTERIOR + DOMMAGESCAUSDSPAR;
QUERY 1 returns nothing while 2 QUERY returns the values and the correct set of records.
The only thing is the time it takes for the shuttle sdo_geom.relate is not very effective.
I tested only with a recordset of 10 000 segments streets, but the live DB will be over 5 million.
At 10,000, it takes the request almost 30 minutes, is not ideal to say the least.
Any help/advice would be welcome.
Kind regards
Davidsdo_relate should return the same results as sdo_geom.relate returns,
If the same tolerance is used. Which version of DB are you using? Please
Try 11.2.0.2 if possible. -
The simple geometry Gets the error ORA-29532 on all calls SDO_GEOM
Hi all
I have a single point in a table in such a way that the query:
However the query:select SDO_GEOM.VALIDATE_GEOMETRY(geomObj, 0.05) from testvalid; /* Returns */ SDO_GEOM.VALIDATE_GEOMETRY(GEOMOBJ,0.05) 'TRUE'
Receives the following error message:select SDO_GEOM.VALIDATE_GEOMETRY_with_context(geomObj, 0.05) from testvalid;
The data itself are a unique SDO_POINT_TYPE:ORA-29532: Java call terminated by uncaught Java exception: java.lang.NumberFormatException: empty String ORA-06512: at "MDSYS.SDO_3GL", line 658 ORA-06512: at "MDSYS.SDO_GEOM", line 519 ORA-06512: at "MDSYS.SDO_GEOM", line 558 ORA-06512: at line 1
I think the problem is something to do with the accuracy of the stored X, Y and Z values in point because if I'm running the following:select GEOMOBJ from testvalid; /* Returns: */ GEOMOBJ '(3001, , (174.092329032787, 129.420551704918, -71.2857142857142), , )'
Similarly, running a direct comparison of an object made in the textual representation of the point fly works fine:update TESTVALID set GEOMOBJ.sdo_point.x = cast(GEOMOBJ.sdo_point.x as number(8,3)); select SDO_GEOM.VALIDATE_GEOMETRY_with_context(geomObj, 0.05) from testvalid; /* Returns: */ SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(GEOMOBJ,0.05) 'TRUE'
Note that I only noticed this problem after upgrade to v11 v11 R2. In addition, the same error ORA-29532 happens when executing calls SDO_GEOM. [x] function such as SDO_GEOM. DISTANCE(). The problem is not limited to the geometries of type SDO_POINT_TYPE, but the problem only happens on some geometry entries in my database. It is reproducible in that the same geometry will continue to fail and the only solution I found is to try to round up its precision in x, y or z. I don't know how to round the precision for the types of SDO_POINT_TYPE easily, so one of my problems is that I find myself with a any dispersion of other geometries that I can query is no longer in space.select SDO_GEOM.VALIDATE_GEOMETRY_with_context("MDSYS"."SDO_GEOMETRY"(3001,NULL, "MDSYS"."SDO_POINT_TYPE"(174.092329032787,129.420551704918,-71.2857142857142),NULL,NULL), 0.005) from dual; /* Returns */ SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT("MDSYS"."SDO_GEOMETRY"(3001,NULL,"MDSYS"."SDO_POINT_TYPE"(174.092329032787,129.420551704918,-71.2857142857142),NULL,NULL),0.005) 'TRUE'
The data itself was inserted from MATLAB (which connects using drivers of ODBC Oracle Java v11) which converts my details in Java.Math.BigDecimal and binds to a prepared statement oracle.
It is possible that I consider that the insertion is made from different computers, some of which are 64-bit computers. Maybe somehow these machines are pumping in too large of a precision coordinates for the geometry of the oracle?
Any help would be great I am quite lost here.
If the precision is indeed the problem, anyone know how can I cut these surplus values after the decimal point for all types of geometry?
Thank you
Sven.It is only related to the version of the server.
So once the database is 11.2, that corruption won't happen. -
Hi people,
Shares of happy Thanksgiving together. I have a task of aggregation that seemed ideal to try the new function SDO_AGGR_SET_UNION in GR 11, 2 (11.2.0.2). I have two valid touching polygons (among many others) who validate to tolerance of 0.05 meter. When I have union together using SDO_GEOM. SDO_UNION or the original SDO_AGGR_UNION the results are stunning, and the surface of the new polygon is close to two entries. However when I run the polygons of same exact through SDO_AGGR_SET_UNION I return the results - for example a 2004 containing a polygon of entry and a random point of the limit of the other polygon geometry does not.
Errors of aggregation such as this are not exactly anything of the never seen in Oracle Spatial, and normally I would just submit it as a bug. But I'm a little confused when the usual functions of SDO_UNION works fine, but the new SDO_AGGR_SET_UNION function fails. They do not work on the same code base? I always thought that what works for SDO_UNION would work for SDO_AGGR_UNION and now SDO_AGGR_SET_UNION is just another addition to the family of the "unioners". We need treat (and test) the new SDO_AGGR_SET_UNION as a different creature altogether from SDO_UNION? My apologies if that derives in taboo landowners. Looking at the results of my test again once I see that actually SDO_AGGR_UNION does not EXACTLY correspond to SDO_UNION (pretty darn close) then perhaps the idea of family is all wrong?
My opinion at this point is confused on the issue whether to use SDO_AGGR_SET_UNION. It is much faster and much easier on the PGA I'l will admit, but SDO_UNION wins the prize of quality for this task.
Cheers and happy holidays,
Paul
DECLARE polygon1 SDO_GEOMETRY; polygon2 SDO_GEOMETRY; rez_oldschool_sdo_union SDO_GEOMETRY; rez_aggr_set_union SDO_GEOMETRY; rez_aggr_union SDO_GEOMETRY; num_tolerance NUMBER := 0.05; BEGIN polygon1 := SDO_GEOMETRY(2003, 8265, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 1), SDO_ORDINATE_ARRAY(-101.367659850094, 45.6250958279126, -101.367750579539, 45.6246663149791, -101.36778407735, 45.6239928420968, -101.367540353957, 45.6233468469559, -101.367308521691, 45.6229827221804, -101.366899484815, 45.6228175577095, -101.366673138039, 45.6225835498738, -101.366629328625, 45.6222646352215, -101.366628551902, 45.6222589429779, -101.366095924796, 45.6220963415067, -101.365627851382, 45.6219975468078, -101.364973450124, 45.6218808707156, -101.364448124586, 45.6218917783656, -101.364110017238, 45.6219421740928, -101.363654697356, 45.6221469160479, -101.363214785275, 45.6219824072281, -101.362436795648, 45.6218682941355, -101.361686971078, 45.6216884967243, -101.360873514825, 45.6214665886314, -101.359874660186, 45.6212484952359, -101.358967626503, 45.6210068282033, -101.358182365109, 45.6207192059896, -101.358076000621, 45.6203958805935, -101.3577215616, 45.6200559553039, -101.357368016649, 45.619737726105, -101.357067192006, 45.6199392494093, -101.356612766194, 45.6201656576528, -101.356002952935, 45.6203735586541, -101.355390364335, 45.6205164309878, -101.354498798057, 45.6206433292767, -101.353565419121, 45.6205106493372, -101.352529371184, 45.62014136876, -101.352633917731, 45.6196834560759, -101.352647567195, 45.6192708429218, -101.352508539361, 45.6189047511931, -101.352288629886, 45.6188224967832, -101.351470703284, 45.6184921082368, -101.350941771666, 45.6184161719192, -101.349821234145, 45.6182439144956, -101.348940635122, 45.6178931113583, -101.348338153234, 45.6175365563727, -101.347801113521, 45.6172654744479, -101.347174072657, 45.6170613583416, -101.346421623621, 45.6168163832512, -101.34560739437, 45.6165726896607, -101.345082128437, 45.6165834781014, -101.345099443586, 45.6162575897056, -101.345027709396, 45.6160203334168, -101.344768758879, 45.6157435294461, -101.344570720584, 45.6154437776871, -101.343946421534, 45.615304660446, -101.343533003717, 45.6150310155214, -101.343056881814, 45.614736956006, -101.342713410048, 45.6146572049912, -101.342468017725, 45.6147056337651, -101.342197174219, 45.6148848053276, -101.341594750073, 45.614528250342, -101.340900564577, 45.6141952391912, -101.339942956353, 45.6134770032207, -101.339244270705, 45.6130355712208, -101.338453823708, 45.6126177128581, -101.337701464078, 45.612372678163, -101.336212122817, 45.6122512635015, -101.336192304272, 45.6117742177263, -101.335945421833, 45.6110413786178, -101.335616642612, 45.610570650935, -101.335230583328, 45.6102096256011, -101.334946239369, 45.6100635346166, -101.334630066531, 45.6098963733901, -101.334438407795, 45.6097483750569, -101.334307605402, 45.6095774289354, -101.3340868596, 45.6094734188302, -101.333838785068, 45.6094567891342, -101.332731360569, 45.6088500734542, -101.332383448257, 45.6086618419858, -101.331784749401, 45.6083919521539, -101.331092501056, 45.6081022437775, -101.330252939831, 45.6079891737662, -101.329314434895, 45.6077261980731, -101.328373249613, 45.6073981639101, -101.327992642291, 45.6071671959113, -101.327608460552, 45.6068495031542, -101.327069813377, 45.6065349396409, -101.32641475833, 45.606396388644, -101.325643325214, 45.6064337905586, -101.324999922875, 45.6065771099272, -101.324193533497, 45.6057688411406, -101.323838466765, 45.6054071303533, -101.323051804662, 45.6050759073418, -101.321817005037, 45.6051227267903, -101.320397699234, 45.6051949676199, -101.319817000981, 45.6053587015793, -101.319392526503, 45.6055626388717, -101.318969869966, 45.6058099385432, -101.318444663638, 45.6058206077746, -101.318069482201, 45.6057197269132, -101.31775161063, 45.6055091437029, -101.317426586501, 45.6051251109761, -101.317134255521, 45.6047838147796, -101.316515529505, 45.6047746654667, -101.316021228185, 45.604784679047, -101.315613385265, 45.6046410318529, -101.315201038469, 45.6043889638098, -101.314971411575, 45.6040680822042, -101.31476911341, 45.6036598499915, -101.314480358708, 45.6034052785534, -101.313899660456, 45.6035689529081, -101.313442522632, 45.6037301536702, -101.312765562878, 45.603808980813, -101.312275731907, 45.60392738544, -101.311693215712, 45.6040476974156, -101.311207855089, 45.604274552694, -101.310601586444, 45.6045689698373, -101.310057962281, 45.6048837717691, -101.309517020326, 45.6052636619731, -101.309069657664, 45.6056633707215, -101.308727139573, 45.6056051667858, -101.308470213751, 45.6053716357872, -101.307939672807, 45.6052521582766, -101.307710969785, 45.6049529429594, -101.307511383632, 45.6046097394143, -101.307343566754, 45.6042876061112, -101.306859726049, 45.6037982221746, -101.306751036979, 45.603409778704, -101.306707706265, 45.6031068380966, -101.306268120147, 45.6029420908582, -101.305856728888, 45.6027116593011, -101.305445367431, 45.6024812575464, -101.304879540538, 45.6022539552333, -101.304159248207, 45.6020297523616, -101.303322518202, 45.601981532204, -101.301559025377, 45.6019519981024, -101.301253640979, 45.6020449515461, -101.301012719005, 45.6022017415644, -101.300863588183, 45.6023349579456, -101.30071442756, 45.6024681743269, -101.300475293725, 45.602668296922, -101.300171669526, 45.6028046425471, -101.2997409645, 45.6028567370067, -101.29930492672, 45.6027786847243, -101.298837985795, 45.6027012880929, -101.298432851161, 45.602622639764, -101.297905918161, 45.602589827407, -101.29769497546, 45.6027242954858, -101.296937638843, 45.6023488756302, -101.296058501996, 45.6020193513511, -101.295742506109, 45.6018520709153, -101.295029336533, 45.6018013175602, -101.294627750238, 45.6018093641873, -101.294042551835, 45.6018645282861, -101.293456491027, 45.6018980260965, -101.292775118667, 45.6018682833787, -101.292278196605, 45.6018131788845, -101.291873063834, 45.6017345007533, -101.291283482627, 45.6016812142008, -101.290510291174, 45.6016750153178, -101.290393764093, 45.6010913964376, -101.290285224035, 45.6007029529671, -101.289931293516, 45.6003627892589, -101.289362009553, 45.6000486727805, -101.288850124863, 45.5996249135578, -101.288520032477, 45.5991106744843, -101.288505041909, 45.5987420197559, -101.288652444196, 45.5985654409955, -101.288862490964, 45.5984093364306, -101.288852807072, 45.5981707986419, -101.28867276938, 45.5975450392778, -101.288897836519, 45.596997958045, -101.289324099137, 45.596837502341, -101.289565915181, 45.5967024382158, -101.289805972888, 45.5965240117114, -101.290201362162, 45.5963641818562, -101.290604675129, 45.596399467806, -101.290402587443, 45.595991205791, -101.290436979323, 45.5953177329087, -101.29079088004, 45.5948982950229, -101.29132830532, 45.5944317694676, -101.292452627736, 45.5939534421926, -101.292937094289, 45.5937049802305, -101.29280736478, 45.5935556705951, -101.292658204156, 45.5929293151846, -101.292974973041, 45.5923586901171, -101.293683553059, 45.5915414806337, -101.293267900068, 45.5912025686231, -101.293135518152, 45.5909882303201, -101.292554849702, 45.5903922136739, -101.292436564284, 45.5897652324146, -101.292644822913, 45.5895657356683, -101.292598033267, 45.5891760106979, -101.292432123738, 45.5888972099715, -101.292022699432, 45.5887101109913, -101.291674131469, 45.5885000940252, -101.291282320336, 45.5879871066492, -101.291144663409, 45.5876426216042, -101.29097964795, 45.5873855169686, -101.290649648696, 45.5868712778951, -101.290548171788, 45.5866562839411, -101.290633764058, 45.5864809568783, -101.290565814763, 45.5863303955453, -101.290284329965, 45.5862492438214, -101.289840483977, 45.5859760161293, -101.289512241198, 45.585505139435, -101.288992548299, 45.5848862048027, -101.287976110291, 45.5842121060717, -101.28714584739, 45.5835559483388, -101.286212408849, 45.582641464075, -101.285476619311, 45.5820268209773, -101.28511842706, 45.5815782364201, -101.284357035464, 45.5810943063084, -101.283982956713, 45.5810150023285, -101.283165121381, 45.5806624110518, -101.282134646478, 45.5804008956725, -101.28119328052, 45.5800507481863, -101.280940079988, 45.5799039121436, -101.280586356223, 45.5795637186331, -101.280392313302, 45.5793505724231, -101.279982948601, 45.5791634436406, -101.279688352644, 45.578756969765, -101.279088491498, 45.5784434195307, -101.278616512118, 45.5782358165526, -101.278077537117, 45.5778993185301, -101.277262385856, 45.577611755921, -101.276535535152, 45.5772138949165, -101.276191467339, 45.5771122391947, -101.275848295459, 45.5770322795636, -101.275343740278, 45.5767819102529, -101.275118824013, 45.5765693600894, -101.274914288812, 45.5760959799999, -101.274648869328, 45.5756455476987, -101.274266060359, 45.5753493424161, -101.273919397882, 45.5751826282244, -101.273802246815, 45.5745772834512, -101.273471588185, 45.5740413184846, -101.272609019567, 45.5733423050121, -101.271817859176, 45.572880607433, -101.270905848505, 45.5724863823119, -101.270488705398, 45.5721040483174, -101.270042473362, 45.5717656727486, -101.269714469001, 45.5712947662519, -101.269444757983, 45.570735853497, -101.268835419699, 45.5701837058694, -101.268133455796, 45.5696333761834, -101.268205100579, 45.5691110904828, -101.26744928388, 45.568757187904, -101.267126584333, 45.5684163387424, -101.266455525439, 45.5678654130099, -101.265675838942, 45.5676855559941, -101.265751028339, 45.5672500248541, -101.26570009617, 45.5667518790347, -101.265420818607, 45.5659544284911, -101.265470707694, 45.5648900385455, -101.266117954533, 45.5633146281773, -101.265613043586, 45.5622829313794, -101.264529073515, 45.5622176046887, -101.263660335816, 45.5621263201751, -101.262631142413, 45.5618862922702, -101.262095892702, 45.5616364892036, -101.261493677173, 45.5612577612902, -101.260768886554, 45.5609031732579, -101.260109301554, 45.560634117891, -101.259364927084, 45.5605620260731, -101.258433636173, 45.5604502375616, -101.258130157261, 45.5605864639775, -101.257646644382, 45.5608564432164, -101.257036203412, 45.5610421414874, -101.255992675092, 45.561214667132, -101.255111807848, 45.5608197267551, -101.253763582446, 45.56032548504, -101.25254317548, 45.5599372203833, -101.250823670883, 45.5594285841464, -101.249551111715, 45.5592800493715, -101.248095059648, 45.5591785128589, -101.246515506757, 45.5590793903345, -101.245464231696, 45.5590566511625, -101.24486734892, 45.5588079805842, -101.244539642582, 45.5583369548782, -101.244295921052, 45.5576472695325, -101.243470901498, 45.5570992346254, -101.242128874979, 45.5567566569291, -101.241258526092, 45.5566218312224, -101.240575099234, 45.5565267320115, -101.23947145963, 45.555962395234, -101.238539391996, 45.5558287616202, -101.237818235398, 45.5555607791369, -101.236225064708, 45.5551145191609, -101.235286110875, 45.5548073764259, -101.234401190515, 45.5543038363861, -101.233707511658, 45.5539484734935, -101.23302241587, 45.5538099522988, -101.232221597664, 45.5538690205019, -101.23142593526, 45.5540582056447, -101.230327600469, 45.5544051940847, -101.229248100746, 45.5544479902197, -101.228566462028, 45.5543961937834, -101.227913105713, 45.5542787130283, -101.227145695911, 45.5544022138525, -101.226524913534, 45.5543274994301, -101.225349390728, 45.5542852993416, -101.224003219824, 45.5546153600625, -101.222625726679, 45.5549351687845, -101.222261780718, 45.5547143931799, -101.221933806159, 45.5546231086663, -101.22143524497, 45.5545134361198, -101.220859074808, 45.5543944354463, -101.220216894364, 45.5541682060168, -101.219464951967, 45.5539007003706, -101.21886568873, 45.5535867925085, -101.218146348211, 45.5533620531951, -101.217718565675, 45.5530882294566, -101.217145049782, 45.5526436086083, -101.216522240848, 45.5521240051167, -101.216158741921, 45.5519140477552, -101.215845400303, 45.5518007393253, -101.215579623192, 45.5517191107642, -101.215282136409, 45.5516163523564, -101.214870238511, 45.5513530786401, -101.214412027804, 45.5510906691911, -101.213885688987, 45.5506668503638, -101.213667088952, 45.5506059642191, -101.213416749444, 45.5505240078324, -101.213287764992, 45.5503854568355, -101.21290927736, 45.5501866157402, -101.212607139553, 45.5499645884381, -101.212244087661, 45.5497654493196, -101.211807424033, 45.5492639060355, -101.211671614849, 45.5489518459173, -101.211414510214, 45.5486964102118, -101.211099469863, 45.5485397394028, -101.210731530391, 45.5482989068352, -101.210504585705, 45.5483697767579, -101.210120374165, 45.5484073276842, -101.210267687044, 45.5488862212033, -101.210266446523, 45.5493596478589, -101.274968132295, 45.6085839424402, -101.367659850094, 45.6250958279126)); polygon2 := SDO_GEOMETRY(2003, 8265, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 1), SDO_ORDINATE_ARRAY(-101.365627851382, 45.6219975468078, -101.366095924796, 45.6220963415067, -101.366628551902, 45.6222589429779, -101.366629328625, 45.6222646352215, -101.366620268719, 45.6220802780549, -101.366700496571, 45.62182305421, -101.366595413582, 45.6214897748383, -101.366373265208, 45.6210790690329, -101.366263473452, 45.6206340607544, -101.367038125219, 45.6206499751946, -101.367585325661, 45.6206705685994, -101.367529088679, 45.6204161461728, -101.367560440722, 45.6200800355804, -101.367629254285, 45.6195514913921, -101.367714576471, 45.6193683542582, -101.257581859721, 45.5548077973837, -101.211696997115, 45.5464650954303, -101.211825365031, 45.5468085820975, -101.21181919595, 45.5474711175274, -101.211578810417, 45.5478973205405, -101.210864418946, 45.5482574220024, -101.210731530391, 45.5482989068352, -101.211099469863, 45.5485397394028, -101.211414510214, 45.5486964102118, -101.211671614849, 45.5489518459173, -101.211807424033, 45.5492639060355, -101.212244087661, 45.5497654493196, -101.212607139553, 45.5499645884381, -101.21290927736, 45.5501866157402, -101.213287764992, 45.5503854568355, -101.213416749444, 45.5505240078324, -101.213667088952, 45.5506059642191, -101.213885688987, 45.5506668503638, -101.214412027804, 45.5510906691911, -101.214870238511, 45.5513530786401, -101.215282136409, 45.5516163523564, -101.215579623192, 45.5517191107642, -101.215845400303, 45.5518007393253, -101.216158741921, 45.5519140477552, -101.216522240848, 45.5521240051167, -101.217145049782, 45.5526436086083, -101.217718565675, 45.5530882294566, -101.218146348211, 45.5533620531951, -101.21886568873, 45.5535867925085, -101.219464951967, 45.5539007003706, -101.220216894364, 45.5541682060168, -101.220859074808, 45.5543944354463, -101.22143524497, 45.5545134361198, -101.221933806159, 45.5546231086663, -101.222261780718, 45.5547143931799, -101.222625726679, 45.5549351687845, -101.224003219824, 45.5546153600625, -101.225349390728, 45.5542852993416, -101.226524913534, 45.5543274994301, -101.227145695911, 45.5544022138525, -101.227913105713, 45.5542787130283, -101.228566462028, 45.5543961937834, -101.229248100746, 45.5544479902197, -101.230327600469, 45.5544051940847, -101.23142593526, 45.5540582056447, -101.232221597664, 45.5538690205019, -101.23302241587, 45.5538099522988, -101.233707511658, 45.5539484734935, -101.234401190515, 45.5543038363861, -101.235286110875, 45.5548073764259, -101.236225064708, 45.5551145191609, -101.237818235398, 45.5555607791369, -101.238539391996, 45.5558287616202, -101.23947145963, 45.555962395234, -101.240575099234, 45.5565267320115, -101.241258526092, 45.5566218312224, -101.242128874979, 45.5567566569291, -101.243470901498, 45.5570992346254, -101.244295921052, 45.5576472695325, -101.244539642582, 45.5583369548782, -101.24486734892, 45.5588079805842, -101.245464231696, 45.5590566511625, -101.246515506757, 45.5590793903345, -101.248095059648, 45.5591785128589, -101.249551111715, 45.5592800493715, -101.250823670883, 45.5594285841464, -101.25254317548, 45.5599372203833, -101.253763582446, 45.56032548504, -101.255111807848, 45.5608197267551, -101.255992675092, 45.561214667132, -101.257036203412, 45.5610421414874, -101.257646644382, 45.5608564432164, -101.258130157261, 45.5605864639775, -101.258433636173, 45.5604502375616, -101.259364927084, 45.5605620260731, -101.260109301554, 45.560634117891, -101.260768886554, 45.5609031732579, -101.261493677173, 45.5612577612902, -101.262095892702, 45.5616364892036, -101.262631142413, 45.5618862922702, -101.263660335816, 45.5621263201751, -101.264529073515, 45.5622176046887, -101.265613043586, 45.5622829313794, -101.266117954533, 45.5633146281773, -101.265470707694, 45.5648900385455, -101.265420818607, 45.5659544284911, -101.26570009617, 45.5667518790347, -101.265751028339, 45.5672500248541, -101.265675838942, 45.5676855559941, -101.266455525439, 45.5678654130099, -101.267126584333, 45.5684163387424, -101.26744928388, 45.568757187904, -101.268205100579, 45.5691110904828, -101.268133455796, 45.5696333761834, -101.268835419699, 45.5701837058694, -101.269444757983, 45.570735853497, -101.269714469001, 45.5712947662519, -101.270042473362, 45.5717656727486, -101.270488705398, 45.5721040483174, -101.270905848505, 45.5724863823119, -101.271817859176, 45.572880607433, -101.272609019567, 45.5733423050121, -101.273471588185, 45.5740413184846, -101.273802246815, 45.5745772834512, -101.273919397882, 45.5751826282244, -101.274266060359, 45.5753493424161, -101.274648869328, 45.5756455476987, -101.274914288812, 45.5760959799999, -101.275118824013, 45.5765693600894, -101.275343740278, 45.5767819102529, -101.275848295459, 45.5770322795636, -101.276191467339, 45.5771122391947, -101.276535535152, 45.5772138949165, -101.277262385856, 45.577611755921, -101.278077537117, 45.5778993185301, -101.278616512118, 45.5782358165526, -101.279088491498, 45.5784434195307, -101.279688352644, 45.578756969765, -101.279982948601, 45.5791634436406, -101.280392313302, 45.5793505724231, -101.280586356223, 45.5795637186331, -101.280940079988, 45.5799039121436, -101.28119328052, 45.5800507481863, -101.282134646478, 45.5804008956725, -101.283165121381, 45.5806624110518, -101.283982956713, 45.5810150023285, -101.284357035464, 45.5810943063084, -101.28511842706, 45.5815782364201, -101.285476619311, 45.5820268209773, -101.286212408849, 45.582641464075, -101.28714584739, 45.5835559483388, -101.287976110291, 45.5842121060717, -101.288992548299, 45.5848862048027, -101.289512241198, 45.585505139435, -101.289840483977, 45.5859760161293, -101.290284329965, 45.5862492438214, -101.290565814763, 45.5863303955453, -101.290633764058, 45.5864809568783, -101.290548171788, 45.5866562839411, -101.290649648696, 45.5868712778951, -101.29097964795, 45.5873855169686, -101.291144663409, 45.5876426216042, -101.291282320336, 45.5879871066492, -101.291674131469, 45.5885000940252, -101.292022699432, 45.5887101109913, -101.292432123738, 45.5888972099715, -101.292598033267, 45.5891760106979, -101.292644822913, 45.5895657356683, -101.292436564284, 45.5897652324146, -101.292554849702, 45.5903922136739, -101.293135518152, 45.5909882303201, -101.293267900068, 45.5912025686231, -101.293683553059, 45.5915414806337, -101.292974973041, 45.5923586901171, -101.292658204156, 45.5929293151846, -101.29280736478, 45.5935556705951, -101.292937094289, 45.5937049802305, -101.292452627736, 45.5939534421926, -101.29132830532, 45.5944317694676, -101.29079088004, 45.5948982950229, -101.290436979323, 45.5953177329087, -101.290402587443, 45.595991205791, -101.290604675129, 45.596399467806, -101.290201362162, 45.5963641818562, -101.289805972888, 45.5965240117114, -101.289565915181, 45.5967024382158, -101.289324099137, 45.596837502341, -101.288897836519, 45.596997958045, -101.28867276938, 45.5975450392778, -101.288852807072, 45.5981707986419, -101.288862490964, 45.5984093364306, -101.288652444196, 45.5985654409955, -101.288505041909, 45.5987420197559, -101.288520032477, 45.5991106744843, -101.288850124863, 45.5996249135578, -101.289362009553, 45.6000486727805, -101.289931293516, 45.6003627892589, -101.290285224035, 45.6007029529671, -101.290393764093, 45.6010913964376, -101.290510291174, 45.6016750153178, -101.291283482627, 45.6016812142008, -101.291873063834, 45.6017345007533, -101.292278196605, 45.6018131788845, -101.292775118667, 45.6018682833787, -101.293456491027, 45.6018980260965, -101.294042551835, 45.6018645282861, -101.294627750238, 45.6018093641873, -101.295029336533, 45.6018013175602, -101.295742506109, 45.6018520709153, -101.296058501996, 45.6020193513511, -101.296937638843, 45.6023488756302, -101.29769497546, 45.6027242954858, -101.297905918161, 45.602589827407, -101.298432851161, 45.602622639764, -101.298837985795, 45.6027012880929, -101.29930492672, 45.6027786847243, -101.2997409645, 45.6028567370067, -101.300171669526, 45.6028046425471, -101.300475293725, 45.602668296922, -101.30071442756, 45.6024681743269, -101.300863588183, 45.6023349579456, -101.301012719005, 45.6022017415644, -101.301253640979, 45.6020449515461, -101.301559025377, 45.6019519981024, -101.303322518202, 45.601981532204, -101.304159248207, 45.6020297523616, -101.304879540538, 45.6022539552333, -101.305445367431, 45.6024812575464, -101.305856728888, 45.6027116593011, -101.306268120147, 45.6029420908582, -101.306707706265, 45.6031068380966, -101.306751036979, 45.603409778704, -101.306859726049, 45.6037982221746, -101.307343566754, 45.6042876061112, -101.307511383632, 45.6046097394143, -101.307710969785, 45.6049529429594, -101.307939672807, 45.6052521582766, -101.308470213751, 45.6053716357872, -101.308727139573, 45.6056051667858, -101.309069657664, 45.6056633707215, -101.309517020326, 45.6052636619731, -101.310057962281, 45.6048837717691, -101.310601586444, 45.6045689698373, -101.311207855089, 45.604274552694, -101.311693215712, 45.6040476974156, -101.312275731907, 45.60392738544, -101.312765562878, 45.603808980813, -101.313442522632, 45.6037301536702, -101.313899660456, 45.6035689529081, -101.314480358708, 45.6034052785534, -101.31476911341, 45.6036598499915, -101.314971411575, 45.6040680822042, -101.315201038469, 45.6043889638098, -101.315613385265, 45.6046410318529, -101.316021228185, 45.604784679047, -101.316515529505, 45.6047746654667, -101.317134255521, 45.6047838147796, -101.317426586501, 45.6051251109761, -101.31775161063, 45.6055091437029, -101.318069482201, 45.6057197269132, -101.318444663638, 45.6058206077746, -101.318969869966, 45.6058099385432, -101.319392526503, 45.6055626388717, -101.319817000981, 45.6053587015793, -101.320397699234, 45.6051949676199, -101.321817005037, 45.6051227267903, -101.323051804662, 45.6050759073418, -101.323838466765, 45.6054071303533, -101.324193533497, 45.6057688411406, -101.324999922875, 45.6065771099272, -101.325643325214, 45.6064337905586, -101.32641475833, 45.606396388644, -101.327069813377, 45.6065349396409, -101.327608460552, 45.6068495031542, -101.327992642291, 45.6071671959113, -101.328373249613, 45.6073981639101, -101.329314434895, 45.6077261980731, -101.330252939831, 45.6079891737662, -101.331092501056, 45.6081022437775, -101.331784749401, 45.6083919521539, -101.332383448257, 45.6086618419858, -101.332731360569, 45.6088500734542, -101.333838785068, 45.6094567891342, -101.3340868596, 45.6094734188302, -101.334307605402, 45.6095774289354, -101.334438407795, 45.6097483750569, -101.334630066531, 45.6098963733901, -101.334946239369, 45.6100635346166, -101.335230583328, 45.6102096256011, -101.335616642612, 45.610570650935, -101.335945421833, 45.6110413786178, -101.336192304272, 45.6117742177263, -101.336212122817, 45.6122512635015, -101.337701464078, 45.612372678163, -101.338453823708, 45.6126177128581, -101.339244270705, 45.6130355712208, -101.339942956353, 45.6134770032207, -101.340900564577, 45.6141952391912, -101.341594750073, 45.614528250342, -101.342197174219, 45.6148848053276, -101.342468017725, 45.6147056337651, -101.342713410048, 45.6146572049912, -101.343056881814, 45.614736956006, -101.343533003717, 45.6150310155214, -101.343946421534, 45.615304660446, -101.344570720584, 45.6154437776871, -101.344768758879, 45.6157435294461, -101.345027709396, 45.6160203334168, -101.345099443586, 45.6162575897056, -101.345082128437, 45.6165834781014, -101.34560739437, 45.6165726896607, -101.346421623621, 45.6168163832512, -101.347174072657, 45.6170613583416, -101.347801113521, 45.6172654744479, -101.348338153234, 45.6175365563727, -101.348940635122, 45.6178931113583, -101.349821234145, 45.6182439144956, -101.350941771666, 45.6184161719192, -101.351470703284, 45.6184921082368, -101.352288629886, 45.6188224967832, -101.352508539361, 45.6189047511931, -101.352647567195, 45.6192708429218, -101.352633917731, 45.6196834560759, -101.352529371184, 45.62014136876, -101.353565419121, 45.6205106493372, -101.354498798057, 45.6206433292767, -101.355390364335, 45.6205164309878, -101.356002952935, 45.6203735586541, -101.356612766194, 45.6201656576528, -101.357067192006, 45.6199392494093, -101.357368016649, 45.619737726105, -101.3577215616, 45.6200559553039, -101.358076000621, 45.6203958805935, -101.358182365109, 45.6207192059896, -101.358967626503, 45.6210068282033, -101.359874660186, 45.6212484952359, -101.360873514825, 45.6214665886314, -101.361686971078, 45.6216884967243, -101.362436795648, 45.6218682941355, -101.363214785275, 45.6219824072281, -101.363654697356, 45.6221469160479, -101.364110017238, 45.6219421740928, -101.364448124586, 45.6218917783656, -101.364973450124, 45.6218808707156, -101.365627851382, 45.6219975468078)); DBMS_OUTPUT.put_line('------------'); DBMS_OUTPUT.put_line('polygon1 validation at ' || TO_CHAR(num_tolerance) || ' = ' || SDO_GEOM.validate_geometry_with_context(polygon1, num_tolerance)); DBMS_OUTPUT.put_line('polygon2 validation at ' || TO_CHAR(num_tolerance) || ' = ' || SDO_GEOM.validate_geometry_with_context(polygon2, num_tolerance)); DBMS_OUTPUT.put_line('combined area is ' || TO_CHAR(SDO_GEOM.sdo_area(polygon1, num_tolerance) + SDO_GEOM.sdo_area(polygon2, num_tolerance))); rez_oldschool_sdo_union := SDO_GEOM.SDO_UNION(polygon1, polygon2, num_tolerance); SELECT SDO_AGGR_UNION(sdoaggrtype(a.shape, num_tolerance)) INTO rez_aggr_union FROM (SELECT polygon1 shape FROM DUAL UNION ALL SELECT polygon2 shape FROM DUAL) a; rez_aggr_set_union := SDO_AGGR_SET_UNION(mdsys.sdo_geometry_array(polygon1, polygon2),num_tolerance); DBMS_OUTPUT.put_line('------------'); DBMS_OUTPUT.put_line('sdo_union creates GTYPE ' || TO_CHAR(rez_oldschool_sdo_union.sdo_gtype)); DBMS_OUTPUT.put_line('sdo_aggr_union creates GTYPE ' || TO_CHAR(rez_aggr_union.sdo_gtype)); DBMS_OUTPUT.put_line('sdo_aggr_set_union creates GTYPE ' || TO_CHAR(rez_aggr_set_union.sdo_gtype)); DBMS_OUTPUT.put_line('------------'); DBMS_OUTPUT.put_line('sdo_union creates area of ' || TO_CHAR(SDO_GEOM.sdo_area(rez_oldschool_sdo_union, num_tolerance))); DBMS_OUTPUT.put_line('sdo_aggr_union creates area of ' || TO_CHAR(SDO_GEOM.sdo_area(rez_aggr_union, num_tolerance))); DBMS_OUTPUT.put_line('sdo_aggr_set_union creates area of ' || TO_CHAR(SDO_GEOM.sdo_area(rez_aggr_set_union, num_tolerance))); END; /
Paul,
This is a very stupid bug that occurs when the sdo_aggr_set_union entrance is only two geometries. I filed a bug: 10382252.
Please use to request a backport if you need it. -
sdo_geom.relate returns the MASK of the UNKNOWN: 000000001
I have everything,
I use on a database of Oracle 11 g Release 11.1.0.6.0 - 64 bit Production With the Real Application Clusters option.
I have to determine what relationship there is between 2 sdo_geometry.
I run this query:
Select sdo_geom.relate (shape_1, "determine", shape_2, 0.5) determine,
sdo_geom.relate (shape_1, 'anyinteract', shape_2, 0.5) anyinteract
Double;
I get:
DETERMINE THE ANYINTERACT
MASK UNKNOWN: 000000001 TRUE
That means MASK UNKNOWN: 000000001 average?
How can I determine the relationship?
Thanks in advance.
SamuelThe second and third pairs ordered at the end are the same for the two geometry.
shape_1:-66.89470555713654,10.514948048707884
shape_2:-66.87824215820313,10.508391980537853remove the redundancy pts and see if that fixes the problem.
Jack
-
Incorrect results of SDO_GEOM. Relate()
Hi all
I get incorrect results of calls to SDO_GEOM.relate / SDO_RELATE / SDO_INSIDE etc., apparently because they cannot handle the values of Longitude both positive and negative in the same query.
The request goes in the direction of
Where SCOTT.ASIA is a layer containing a geometry for each Asian countries (although I experienced the same behavior with other, more simple polygons)SELECT COUNTRY, SDO_GEOM.relate(SCOTT.ASIA.GEOLOC, 'DETERMINE', < A Transient Geometry>, '0.005') from SCOTT.ASIA;
And transitional geometry is defined:
This query gives me:MDSYS.SDO_GEOMETRY( 2003, 8307, null, MDSYS.SDO_ELEM_INFO_ARRAY(1,1003, 1), MDSYS.SDO_ORDINATE_ARRAY(-1.2, 89.9, 6.6, -16.2, 170.3, -21.1, 168.25, 89.9, -1.2, 89.9))
When all these geometries have to resolve on the INSIDE.Malaysia DISJOINT Maldives DISJOINT Mongolia DISJOINT Myanmar DISJOINT ...etc
I traced this issue to the fact that there is a selected point with a negative longitude (-1.2, 89.9), which should be perfectly fine. If I change of (1,2, 89.9):
I get:
This occurs regardless of what point is outside the hemisphere for example:Malaysia INSIDE Maldives INSIDE Mongolia INSIDE Myanmar INSIDE ...etc
Note that the second and third entries represent a limit to the East that surrounds the Western hemisphere. None of these definitions provide good results when using SDO_GEOM.relate... MDSYS.SDO_ORDINATE_ARRAY(-1.2, 89.9, 6.6, -16.2, 170.3, -21.1, 168.25, 89.9, -1.2, 89.9)... ... MDSYS.SDO_ORDINATE_ARRAY(1.2, 89.9, 6.6, -16.2, 170.3, -21.1, *191.75*, 89.9, 1.2, 89.9)... ... MDSYS.SDO_ORDINATE_ARRAY(1.2, 89.9, 6.6, -16.2, 170.3, -21.1, *-168.25*, 89.9, 1.2, 89.9)...
Is there a way to make sure that spatial queries returning correct results with geometries that envelop this way?
Thank youThis type of query "whole earth" does not work as you did. See http://download.oracle.com/docs/html/B14255_01/sdo_cs_concepts.htm#i891851
>
The following size limits apply, with geodetic data
No polygon element can have an area larger than half of the surface of the Earth.
Online, the distance between two adjacent coordinates cannot be greater or equal to half of the perimeter (a great circle) of the Earth.If you need to work with larger items, first break these elements into several smaller components and work with them. For example, you cannot create a geometry that represents the entire surface of the Earth; However, you can create several geometries, each representative of the global ocean surface. To work with a line string that is greater than or equal to half of the perimeter of the land, you can add one or more points on the line so that all adjacent coordinates are less than half of the perimeter of the land.
>Search this forum for "Earth." for example
Re: Simple Transformation work not as expected
the whole earth MBR GEODESIC -
issue of sdo_geom.sdo_intersection
Hello
I am new to oracle spatial, and I'll try to find the point on a line which is closest to another topic.
to do this, I use the SDO_NN_distance to find the distance of my object point to the line closest to you.
I then use this distance as being the distance of entry to create a buffer around mysubject point.
I then use the SDO_geom. SDO_intersection to find the intersection of my stamp and my line. This intersection is expected to be the closest point on my line to the point of topic.
However this does not always work. Here's what I find so far and for which I can't find an explanation.
1. when creating the buffer, I need to set a very low tolerance so that the buffer to be round. Is there another way to do it.
2. Despite everything when I look at my pad and my line, I see that the buffer does not touch the line my buffer distance is a bit too small why?
3 - when I try to get the intersection using sdo_geom.sdo_intersection and don't receive no value. I guess it's because my tolerance of buffer is so small that it cannot extend far enough to touch the line?
That's what I'm developing as the solution so that the bearing from one point to the nearest point of the nearest line. but for this I need to get X and Y on the point on the line in order to calculate the azimuth beetwen my topic as well as on the line.
Any help is appreciated.
Thank you
ThierryHello
You can try the function below - note that the distances are arbitrary. You can experiment with different values. The function is not robust, for a production system, check the geometry types are passed into the function.Select near_point (sdo_geometry (2001, null, sdo_point_type (3,1,null), null, null),)
sdo_geometry (2002, null, null, sdo_elem_info_array (1,2,1), sdo_ordinate_array (0,0,1,2, 10.5)))
Double;Kind regards
PieterFUNCTION to CREATE or REPLACE near_point SDO_GEOMETRY RETURN (point SDO_GEOMETRY, line SDO_GEOMETRY) IS
Dist NUMBER;
x NUMBER;
y NUMBER;
SDO_GEOMETRY arcs;
MDSYS inter1. VERTEX_SET_TYPE;
intersect_line SDO_GEOMETRY;
MDSYS INTER2. VERTEX_SET_TYPE;
dir NUMBER.
avgx NUMBER;
avgy NUMBER;
BEGIN
Dist: = sdo_geom.sdo_distance (point, line, 0.0010) + 0.10;
x: = point.sdo_point.x;
y: = point.sdo_point.y;
-create arcs around the point
arcs: = sdo_geometry (2002, point.sdo_srid, null, sdo_elem_info_array (1,4,2,1,2,2,5,2,2),)
sdo_ordinate_array (x, y + dist,)
x + dist
x, y - Dist.,
x Dist
x, y + dist));
-intersect with the line bows
inter1: = sdo_util.getvertices (sdo_geom.sdo_intersection (arcs, line, 0.001));
-get the average between the first and last point of intersection
avgx: = (inter1 (1) .x + inter1 (inter1.count) .x) / 2;
avgy: = (inter1 (1) there + inter1 (inter1.count) there) / 2;
-take in the direction of the point to the average of the coordinates
dir: = atan2 (avgx - x, avgy - y);
-create a point in the direction of the average line, increase the distance allowing the bows online
intersect_line: = sdo_geometry (2002, point.sdo_srid, null, sdo_elem_info_array (1,2,1),)
sdo_ordinate_array (x, y, x + sin (dir) * (dist + 10), y + cos (dir) * (dist + 10)));
-get intersections
INTER2: = sdo_util.getvertices (sdo_geom.sdo_intersection (intersect_line, line, 0.001));
RETURN sdo_geometry (2001, point.sdo_srid, SDO_POINT (inter2 (1) .x, inter2 there (1), null), null, null);
END;
/ -
Strange SDO_GEOM. Behavior of function TELLS
Hello
I have a sdo_geometry and SDO_POINT_TYPE 3.
All 3 points are within the sdo_geometry.
When I try to run the SDO_GEOM. Function to ASSOCIATE between the geometry and the points, anyinteract relationship and 0.5 as tolerance, I get the TRUE just for one of them, FALSE for other 2.
It's geometry:
MDSYS. SDO_GEOMETRY (2003,8307, null, MDSYS. SDO_ELEM_INFO_ARRAY (1,1003,1), MDSYS. SDO_ORDINATE_ARRAY(-66.86493873596191,10.514480111763291,-66.8459701538086,10.51414255361881,-66.83515548706054,10.513214266818304,-66.82159423828125,10.510513780257033,-66.81352615356445,10.506209830993908,-66.8009090423584,10.503509283194786,-66.79498672485351,10.501652642893063,-66.79781913757324,10.493719599636431,-66.80142402648926,10.484267197377525,-66.80365562438965,10.47937208991565,-66.80777549743652,10.477346505577561,-66.81095123291015,10.473886101698585,-66.82107925415039,10.47253568970338,-66.82734489440918,10.47413930329266,-66.82519912719726,10.468737624427312,-66.82125091552734,10.463589061672053,-66.82296752929687,10.4524476170361,-66.82820320129394,10.447467599627947,-66.83335304260254,10.448227268460263,-66.83627128601074,10.450253042932304,- 66.84803009033203,10.45354489827311,-66.85386657714844,10.460719333868834,-66.87026023864746,10.45911565089031,-66.8734359741211,10.46485510961747,-66.87798500061035,10.46983484806402,-66.87249183654785,10.475742908584456,-66.87352180480957,10.490090586485742,-66.86262130737304,10.49388838990972,-66.86871528625488,10.505956655640416))
and here are the 3 points:
MDSYS. SDO_GEOMETRY (2001,8307, MDSYS. SDO_POINT_TYPE(-66.84779,10.50483,null), NULL, null)
MDSYS. SDO_GEOMETRY (2001,8307, MDSYS. SDO_POINT_TYPE(-66.84468,10.50138,null), NULL, null)
MDSYS. SDO_GEOMETRY (2001,8307, MDSYS. SDO_POINT_TYPE(-66.84705,10.50489,null), NULL, null)
This is the query:
Select - point 1
SDO_GEOM. RELATE (MDSYS. SDO_GEOMETRY (2001,8307, MDSYS. SDO_POINT_TYPE(-66.84779,10.50483,null), null, null), 'anyinteract. "
MDSYS. SDO_GEOMETRY (2003,8307, null, MDSYS. SDO_ELEM_INFO_ARRAY (1,1003,1), MDSYS. SDO_ORDINATE_ARRAY(-66.86493873596191,10.514480111763291,-66.8459701538086,10.51414255361881,-66.83515548706054,10.513214266818304,-66.82159423828125,10.510513780257033,-66.81352615356445,10.506209830993908,-66.8009090423584,10.503509283194786,-66.79498672485351,10.501652642893063,-66.79781913757324,10.493719599636431,-66.80142402648926,10.484267197377525,-66.80365562438965,10.47937208991565,-66.80777549743652,10.477346505577561,-66.81095123291015,10.473886101698585,-66.82107925415039,10.47253568970338,-66.82734489440918,10.47413930329266,-66.82519912719726,10.468737624427312,-66.82125091552734,10.463589061672053,-66.82296752929687,10.4524476170361,-66.82820320129394,10.447467599627947,-66.83335304260254,10.448227268460263,-66.83627128601074,10.450253042932304,- 66.84803009033203,10.45354489827311,-66.85386657714844,10.460719333868834,-66.87026023864746,10.45911565089031,-66.8734359741211,10.46485510961747,-66.87798500061035,10.46983484806402,-66.87249183654785,10.475742908584456,-66.87352180480957,10.490090586485742,-66.86262130737304,10.49388838990972,-66.86871528625488,10.505956655640416)),0.5) point1,
-point 2
SDO_GEOM. RELATE (MDSYS. SDO_GEOMETRY (2001,8307, MDSYS. SDO_POINT_TYPE(-66.84468,10.50138,null), null, null), 'anyinteract. "
MDSYS. SDO_GEOMETRY (2003,8307, null, MDSYS. SDO_ELEM_INFO_ARRAY (1,1003,1), MDSYS. SDO_ORDINATE_ARRAY(-66.86493873596191,10.514480111763291,-66.8459701538086,10.51414255361881,-66.83515548706054,10.513214266818304,-66.82159423828125,10.510513780257033,-66.81352615356445,10.506209830993908,-66.8009090423584,10.503509283194786,-66.79498672485351,10.501652642893063,-66.79781913757324,10.493719599636431,-66.80142402648926,10.484267197377525,-66.80365562438965,10.47937208991565,-66.80777549743652,10.477346505577561,-66.81095123291015,10.473886101698585,-66.82107925415039,10.47253568970338,-66.82734489440918,10.47413930329266,-66.82519912719726,10.468737624427312,-66.82125091552734,10.463589061672053,-66.82296752929687,10.4524476170361,-66.82820320129394,10.447467599627947,-66.83335304260254,10.448227268460263,-66.83627128601074,10.450253042932304,- 66.84803009033203,10.45354489827311,-66.85386657714844,10.460719333868834,-66.87026023864746,10.45911565089031,-66.8734359741211,10.46485510961747,-66.87798500061035,10.46983484806402,-66.87249183654785,10.475742908584456,-66.87352180480957,10.490090586485742,-66.86262130737304,10.49388838990972,-66.86871528625488,10.505956655640416)),0.5) point2,
-item 3
SDO_GEOM. RELATE (MDSYS. SDO_GEOMETRY (2001,8307, MDSYS. SDO_POINT_TYPE(-66.84705,10.50489,null), null, null), 'anyinteract. "
MDSYS. SDO_GEOMETRY (2003,8307, null, MDSYS. SDO_ELEM_INFO_ARRAY (1,1003,1), MDSYS. SDO_ORDINATE_ARRAY(-66.86493873596191,10.514480111763291,-66.8459701538086,10.51414255361881,-66.83515548706054,10.513214266818304,-66.82159423828125,10.510513780257033,-66.81352615356445,10.506209830993908,-66.8009090423584,10.503509283194786,-66.79498672485351,10.501652642893063,-66.79781913757324,10.493719599636431,-66.80142402648926,10.484267197377525,-66.80365562438965,10.47937208991565,-66.80777549743652,10.477346505577561,-66.81095123291015,10.473886101698585,-66.82107925415039,10.47253568970338,-66.82734489440918,10.47413930329266,-66.82519912719726,10.468737624427312,-66.82125091552734,10.463589061672053,-66.82296752929687,10.4524476170361,-66.82820320129394,10.447467599627947,-66.83335304260254,10.448227268460263,-66.83627128601074,10.450253042932304,- 66.84803009033203,10.45354489827311,-66.85386657714844,10.460719333868834,-66.87026023864746,10.45911565089031,-66.8734359741211,10.46485510961747,-66.87798500061035,10.46983484806402,-66.87249183654785,10.475742908584456,-66.87352180480957,10.490090586485742,-66.86262130737304,10.49388838990972,-66.86871528625488,10.505956655640416)),0.5) point3
Double;
I also checked 4 geometries with Oracle card manufacturer, and 3 points are displayed inside the geometry.
(I wanted to attach the screenshot, but I have not found how I could)
How can it be possible?
Am I in the wrong?
Thanks in advance.
SamuelSamuel,
I also had the same results with the original polygon. I loaded the points and polygons in our application, and they are clearly in the polygon (about 1 KM from the northern edge).
So, I re-directed the selection setting the coordinates of the first and the last to the same value, and he came up with the right answer.
Why? The reason is that the last coordinates are approximately 1 KM from the start coordinates - is MUCH larger than your specified tolerance of 1/2 counter! Why it does not return an error message and closes the polygon blindly, I'm not sure.
Maybe you are looking for
-
I have a photosmart 7760 which I like and just bought a new computer hp laptop with windows 8. If anyone can help, I need to know if I can print wireless and if so someone can give me fool proof instructions. I tried in vain to find a phone number fo
-
Try to download an application
Remember - this is a public forum so never post private information such as numbers of mail or telephone! Ideas: You have problems with programs keep having the same message all the time as above Error messages a problem caused this program to stop w
-
Hi all I'm stuck in one of the problems. try { // Dialog.alert(updateConnectionSuffix()); connection = (HttpConnection)Connector.open(url+";deviceside=true"); connection.setRequestMethod(method); connection.setRequestProperty(HttpProtocolConstants.HE
-
Hi all I developed a screen with a selection of buttons that you can click on the use of the navigationClick method. Is there a code I can add to each field button that allows the user to press the key "Enter" on the keyboard to also click on the but
-
My Tungsten E Palm Pilot is ready to expire. I am looking for a product that connects seamlessly with the data of the tungsten e. Any suggestions?