我在Oracle中有一个SDO_GEOMETRY格式的图层,我希望在Web地图应用程序中显示该图层。我在Oracle Spatial开发人员指南(http://docs.oracle.com/cd/B28359_01/appdev.111/b28400/sdo_util.htm#BJEFIFEF)中找到了这个示例:
-- 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 = TRUE
是否可以在PHP中使用SDO_UTIL.TO.KMLGEOMETRY?
或者在网络地图应用程序中有没有其他方法可以使用SDO_GEOMETRY?
答案 0 :(得分:1)
该函数返回一个CLOB,因此没有理由不能从SELECT语句中调用它并将结果作为字符串返回给PHP。