0

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 :)

Sietze
  • 33
  • 3

2 Answers2

0

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 -

Dharman
  • 30,962
  • 25
  • 85
  • 135
fmatz
  • 21
  • 1
  • 2
  • I ran validation. With default Tolerance 0.0005 I got no output. When lowing to 0.005 I get the following two kinds of output: 1: 13346 and 2: 13349 [Element <1>] [Ring <1>][Edge <24>][Edge <23>] or similar element, ring, edge or coordinate values. – Sietze Oct 16 '20 at 16:21
0

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'

fmatz
  • 21
  • 1
  • 2
  • hi fmatz, thanks for your suggestions. I've ran all validation and no errors arise. All geometry seems to be valid. – Sietze Oct 19 '20 at 14:14
  • to clarify: when doing a simple: select (geometry column) from (tablename) I get valid geojson output for every single object in the table. – Sietze Oct 19 '20 at 14:24