kadaster / klic-win

https://kadaster.nl/zakelijk/registraties/landelijke-voorzieningen/klic
20 stars 16 forks source link

Invalid geometries in AanduidingEisVoorzorgsmaatregel layer #107

Closed janwalczynski-intive closed 2 years ago

janwalczynski-intive commented 2 years ago

Hello,

We started receiving KLICs today with incorrect geometries in the AanduidingEisVoorzorgsmaatregel layer. The GDAL tool is reporting the following error messages:

TopologyException: Input geom 0 is invalid: Hole lies outside shell at or near point 116393.02899999999 489292.766 at 116393.02899999999 489292.766

When you use the ST_IsValidReason function, you actually get a confirmation that the geometry is invalid:

Hole lies outside shell[116393.02899999999 489292.766]

For both messages, of course, the coordinates vary KLIC to KLIC, but the reason is always the same.

I know that ST_MakeValid function can be used to attempt to create a valid representation of the geometry, but I'm not sure which of the available algorithms (linework / structure) would be more appropriate for this case.

Please advise or confirm that the problem can be resolved on your end.

janwalczynski-intive commented 2 years ago

The root cause of the problem was that previously this layer contained a POLYGON geometry type. With the introduction of clipping in some cases, the geometry type may now be MULTIPOLYGON. When we specified this explicitly as an invocation parameter to our GIS tools the problem stopped.