kalisio / k-vigicrues

A Krawler based service to download data from French flood warning system Vigicrues
MIT License
3 stars 0 forks source link

Job fails due to invalid geometries #30

Closed claustres closed 3 years ago

claustres commented 3 years ago

Starting from 03/08/2021 the job fails with the following error: Error: invalid polygon. It seems to be raised by turf.cleanCoords(), which is not within a try/catch block.

We previously retrieved MultiLineStrings for sections and it now appears to be broken into different LineStrings but with the same id/properties, which should probably be merged. A lot of line strings seems to be invalid (eg only 2 points).

When downloading https://www.vigicrues.gouv.fr/services/1/InfoVigiCru.geojson and check it with mapshaper it indeed appears there are also a lot of self-intersections with different features identified with the same gid.

Sent a message on the vigicrues web site contact form and the Hub'Eau workforce to check if it's a bug on their side or a valid update.

claustres commented 3 years ago

Once try/catch block has been added the job fails with this error linked to the fact multiple features are using the same id: BulkWriteError: E11000 duplicate key error collection: kano.vigicrues-forecasts.

claustres commented 3 years ago

Bug fixed in vigicrues API.