Format
SDO_UTIL.FROM_KMLGEOMETRY(
geometry IN CLOB
) RETURN SDO_GEOMETRY;
or
SDO_UTIL.FROM_KMLGEOMETRY(
geometry IN VARCHAR2
) RETURN SDO_GEOMETRY;Description
Converts a KML (Keyhole Markup Language) document to a Spatial and Graph geometry object.
Parameters
Usage Notes
The input geometry must be a valid document conforming to the KML 2.1 specification.
This function does not process the whole KML document; it only processes the KML geometry tags.
Examples
The following example shows conversion to and from KML format. (The example uses the definitions and data from Simple Example: Inserting_ Indexing_ and Querying Spatial Data, specifically the cola_c geometry from the COLA_MARKETS table.)
-- Convert cola_c geometry to a KML document; convert that result to
-- a spatial geometry.
DECLARE
kmlgeom CLOB;
val_result VARCHAR2(5);
geom_result SDO_GEOMETRY;
geom SDO_GEOMETRY;
BEGIN
SELECT c.shape INTO geom FROM cola_markets c WHERE c.name = 'cola_c';
-- To KML geometry
kmlgeom := SDO_UTIL.TO_KMLGEOMETRY(geom);
DBMS_OUTPUT.PUT_LINE('To KML geometry result = ' || TO_CHAR(kmlgeom));
-- From KML geometry
geom_result := SDO_UTIL.FROM_KMLGEOMETRY(kmlgeom);
-- Validate the returned geometry
val_result := SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(geom_result, 0.005);
DBMS_OUTPUT.PUT_LINE('Validation result = ' || val_result);
END;
/
To KML geometry result =
<Polygon><extrude>0</extrude><tessellate>0</tessellate><altitudeMode>relativeToG
round</altitudeMode><outerBoundaryIs><LinearRing><coordinates>3.0,3.0 6.0,3.0
6.0,5.0 4.0,5.0 3.0,3.0 </coordinates></LinearRing></outerBoundaryIs></Polygon>
Validation result = TRUERelated Topics