您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

在Oracle数据库中保存多边形

在Oracle数据库中保存多边形

如果打算使用Oracle Spatial来存储或处理多边形,则需要将数据存储为SDO_GEOMETRY对象。这是一个简单的例子:

CREATE TABLE my_polygons (
  id INTEGER
, polygon sdo_geometry
)
/

INSERT INTO my_polygons (
  id
, polygon
)
VALUES (
  1
, sdo_geometry (
    2003 -- 2D Polygon
  , 4326 -- wgs84, the typical GPS coordinate system
  , NULL -- sdo_point_type, should be NULL if sdo_ordinate_array specified
  , sdo_elem_info_array(
      1    -- First ordinate position within ordinate array
    , 1003 -- Exterior polygon
    , 1    -- All polygon points are specified in the ordinate array
    )
  , sdo_ordinate_array(
      80.16397166, 27.54798833,
    , 80.16450166, 27.547766,
    , 80.164701, 27.548131,
    , 80.16397166, 27.54798833
    )
  )
)
/

这里有关于对象类型的不同标志的更多信息:http ://docs.oracle.com/cd/B19306_01/appdev.102/b14255/sdo_objrelschema.htm

需要注意的关键事项:

Oracle 2022/1/1 18:41:42 有333人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶