问题描述
我无法为包含复杂(常规数组1005)几何的表生成良好的geojson。
使用我目前的方法,我遇到了多个ORA错误。主要是ORA-13199错误:多边形错误。
当我使用常规选择几何图形时,似乎做得很好,我得到了正确的json
当我尝试将其作为我的FeatureCollection的一部分时,它吐出SDO_GEOMETRY而不是Geojson。
我被困住了,不胜感激:)
解决方法
首先,Oracle Spatial操作基于正确定义的Spatial数据, 请尝试使用SqlDeveloper进行检查:
,使用此SDO验证并从Hans Viehmann and Albert Godfrind进行纠正:
用于表格和SDO列,公差为0.005。
完成此步骤后,请最终检查:
select rowid,geometry from my_geom_table where sdo_geom.validate_geometry_with_context(geometry,0.005) != 'TRUE'
〜如果存在错误,则仅对经过验证的几何体使用GeoJSON处理:
... where validate_geometry_with_context(shape,0.005) = 'TRUE'