Home » Server Options » Spatial » SDO_UTIL.REMOVE_DUPLICATE_VERTICES doesn't remove duplicate vertices (Oracle Database 18c Standard Edition 2 Release 18.0.0.0.0)
SDO_UTIL.REMOVE_DUPLICATE_VERTICES doesn't remove duplicate vertices [message #680401] Tue, 12 May 2020 15:14 Go to next message
linuxhippy
Messages: 1
Registered: May 2020
Junior Member
Hi,

I am currently rather puzzled by the behaviour of SDO_UTIL.REMOVE_DUPLICATE_VERTICES.
For simple cases it seems to work, however I've a couple of real-world polygons where it doesn't seem to do anything - despite it is obvious they contain duplicate vertices:

select SDO_UTIL.REMOVE_DUPLICATE_VERTICES(MDSYS.SDO_GEOMETRY(2004, 31287, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1, 1, 1, 3, 1003, 1), MDSYS.SDO_ORDINATE_ARRAY(619264.635430746, 470617.463337161, 619264.635430746, 470617.463337161, 619276.844786495, 470617.284899779, 619280.218514755, 470617.105072018, 619294.139840312, 470616.88249531, 619305.140096277, 470616.657125633, 619304.338727623, 470599.166695148, 619339.836853348, 470597.926709395, 619338.650044695, 470606.005265199, 619337.216534473, 470612.993703924, 619335.891179569, 470620.386538278, 619334.79148297, 470626.637466606, 619333.265777648, 470628.109353107, 619277.611015953, 470630.131454848, 619273.720373511, 470630.021165598, 619271.492321163, 470629.594902549, 619269.788885854, 470628.618598163, 619264.635430746, 470617.463337161)), 0.1) FROM DUAL;

So despite the first and second point are completly identical, they are not removed and the geometry passes unchanged.
Also validate_geometry says this is a valid geometry.

Help is really appreciated.

Thanks, Clemens
Re: SDO_UTIL.REMOVE_DUPLICATE_VERTICES doesn't remove duplicate vertices [message #680404 is a reply to message #680401] Wed, 13 May 2020 05:33 Go to previous message
_jum
Messages: 577
Registered: February 2008
Senior Member
Your geometry is a SDO_GTYPE 2004 Collection Type. You "collected" with the SDO_ELEM_INFO (1, 1, 1, 3, 1003, 1) a POINT (1,1,1) and a POLYGON (3,1,1003) (at 3rd coordinate). So the POINT can't be removed.

Try with a simple Polygon:
select SDO_UTIL.REMOVE_DUPLICATE_VERTICES(MDSYS.SDO_GEOMETRY(2003, 31287, NULL,
 MDSYS.SDO_ELEM_INFO_ARRAY(1, 1003, 1),
  MDSYS.SDO_ORDINATE_ARRAY(619264.635430746, 470617.463337161, 619264.635430746, 470617.463337161, 619276.844786495, 470617.284899779, 619280.218514755, 470617.105072018, 619294.139840312, 470616.88249531, 619305.140096277, 470616.657125633, 619304.338727623, 470599.166695148, 619339.836853348, 470597.926709395, 619338.650044695, 470606.005265199, 619337.216534473, 470612.993703924, 619335.891179569, 470620.386538278, 619334.79148297, 470626.637466606, 619333.265777648, 470628.109353107, 619277.611015953, 470630.131454848, 619273.720373511, 470630.021165598, 619271.492321163, 470629.594902549, 619269.788885854, 470628.618598163, 619264.635430746, 470617.463337161)), 0.1) shape FROM DUAL;
And the unnecessary vertex will be removed:
MDSYS.SDO_GEOMETRY(2003, 31287, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1, 1003, 1), 
  MDSYS.SDO_ORDINATE_ARRAY(619264.635430746, 470617.463337161, 619276.844786495, 470617.284899779, 619280.218514755, 470617.105072018, 619294.139840312, 470616.88249531, 619305.140096277, 470616.657125633, 619304.338727623, 470599.166695148, 619339.836853348, 470597.926709395, 619338.650044695, 470606.005265199, 619337.216534473, 470612.993703924, 619335.891179569, 470620.386538278, 619334.79148297, 470626.637466606, 619333.265777648, 470628.109353107, 619277.611015953, 470630.131454848, 619273.720373511, 470630.021165598, 619271.492321163, 470629.594902549, 619269.788885854, 470628.618598163, 619264.635430746, 470617.463337161))

[Updated on: Wed, 13 May 2020 06:01]

Report message to a moderator

Previous Topic: Spatial Features Licensing
Next Topic: ORA-13034: Invalid data in the SDO_ORDINATE_ARRAY in SDO_GEOMETRY object (split from "ORA-0939: too many arguments for function")
Goto Forum:
  


Current Time: Sat Dec 21 20:31:35 CST 2024