Parse 'complex' geojson through ORDS

203 views Asked by At

I'm having trouble generating a good geojson for tables that contain complex (Ordinate array 1005) geometry.

With my current approach I'm getting multiple ORA errors. Primarily ORA-13199 ERROR: wrong polygon. using the get_geojson()

When I use a regular select geometry it seems to do just fine, I get proper json select geometry from table

When I try to do this trick as part of my featureCollection it spits out SDO_GEOMETRY instead of Geojson. enter image description here

I'm stuck, would appreciate help :)

2

There are 2 answers

1
fmatz On

First at all the Oracle Spatial operations are based on correct defined Spatial data, please try to check it with the SqlDeveloper:

<Right-Mouse-Click> - OnTable: Select the validation function here:
Select the validation function here -

2
fmatz On

Use this SDO validation and rectifying from Hans Viehmann and Albert Godfrind:

for your table & SDO column and with the 0.005 tolerance.

After this step check it finally:

select rowid, geometry from my_geom_table where sdo_geom.validate_geometry_with_context(geometry, 0.005) != 'TRUE'

~ if errors exists then use your GeoJSON handling only with the validated geometries:

... where validate_geometry_with_context(shape, 0.005) = 'TRUE'