通过ORDS解析“复杂” geojson

时间:2020-10-15 15:59:01

标签: oracle oracle-apex geojson oracle-ords sdo

我无法为包含复杂(常规数组1005)几何的表生成良好的geojson。

使用我目前的方法,我遇到了多个ORA错误。主要是ORA-13199错误:多边形错误。 using the get_geojson()

当我使用常规选择几何图形时,似乎做得很好,我得到了正确的json select geometry from table

当我尝试将其作为我的FeatureCollection的一部分时,它吐出SDO_GEOMETRY而不是Geojson。 enter image description here

我被困住了,不胜感激:)

2 个答案:

答案 0 :(得分:0)

首先,Oracle Spatial操作基于正确定义的Spatial数据, 请尝试使用SqlDeveloper进行检查:

<右键单击>-OnTable: 在此处选择验证功能:
Select the validation function here -

答案 1 :(得分:0)

使用此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'