35.70 SDO_UTIL.SIMPLIFYVW
Format
SDO_UTIL.SIMPLIFYVW( geometry IN SDO_GEOMETRY, vertex_threshold IN NUMBER, tolerance IN NUMBER DEFAULT 0.0000005, remove_loops IN NUMBER DEFAULT 0 ) RETURN SDO_GEOMETRY;
Description
Simplifies the input geometry, based on a threshold value, using the Visvalingham-Whyatt algorithm.
Parameters
- geometry
-
Geometry to be simplified.
- vertex_threshold
-
Threshold value to be used for the geometry simplification, expressed as a percentage value between 0 and 100. As the value is decreased, the returned geometry is likely to be closer to the input geometry; as the value is increased, fewer points are likely to be in the returned geometry.
You may want to experiment with different values to get the desired level of simplification.
- tolerance
-
Tolerance value (see Tolerance). If you do not specify a value, the default value is 0.0000005.
- remove_loops
-
For some line geometries, when the line is simplified, it might end up with self-crossing loops in the middle. While this is a valid geometry (for lines), in some cases it is not desirable to have these loops in the result of the simplify operation. A value of
0
(the default) does not remove such loops; a value of1
(or any other nonzero positive number) removes any such loops and always returns simple line segments.
Usage Notes
Note:
The SDO_UTIL.SIMPLIFYVW function is supported only if Oracle JVM is enabled on your Oracle Autonomous Database Serverless deployments. To enable Oracle JVM, see Use Oracle Java in Using Oracle Autonomous Database Serverless for more information.See the Usage Notes for the SDO_UTIL.SIMPLIFY function, which also simplifies an input geometry but uses a different algorithm (Douglas-Peucker).
Examples
The following example simplifies the same line string geometry used in the example for SDO_UTIL.SIMPLIFY.
SELECT SDO_UTIL.SIMPLIFYVW( SDO_GEOMETRY( 2002, -- line string, 2 dimensions (X,Y) NULL, NULL, SDO_ELEM_INFO_ARRAY(1,2,1), -- one line string, straight segments SDO_ORDINATE_ARRAY( 2,2, -- Starting point 2,4, 8,4, 12,4, 12,10, 8,10, 5,14) -- Ending point ), 80, -- threshold "percentage" value for geometry simplification 0.5 -- tolerance ) FROM DUAL; SDO_UTIL.SIMPLIFYVW(SDO_GEOMETRY(2002,--LINESTRING,2DIMENSIONS(X,Y)NULL,NULL,SDO -------------------------------------------------------------------------------- SDO_GEOMETRY(2002, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 2, 1), SDO_ORDINATE_ARRAY( 2, 2, 12, 4, 5, 14))
Note that the resulting geometry in this case, using 80 as the vertex_threshold
value, has the same points as the example for SDO_UTIL.SIMPLIFY, but without any measure dimension information (that is, the vertices are 2,2, 12,4, and 5,14). A significantly lower vertex_threshold
value would probably result in a geometry with more vertices.
Parent topic: SDO_UTIL Package (Utility)