orbisgis / geoclimate

Geospatial processing toolbox for environmental and climate studies
GNU Lesser General Public License v3.0
59 stars 16 forks source link

Error using BDTOPO_V3 workflow (on Gimont commune - INSEE code 32147) #857

Closed sfaraut closed 10 months ago

sfaraut commented 11 months ago

Hi! There is a problem using Geoclimate's BDTOPO_V3 workflow, which occurs on Gimont commune (INSEE code 32147) and latest IGN BDTOPO V3 edition (BDTOPO_3-3_TOUSTHEMES_SHP_LAMB93_D032_2023-09-15). Problem confirmed with latest snapshot (223-10-14) and a previous one (2023-07-18), even error message is not exactly the same... No problem when using BDTOPO_V2 workflow on BDTOPOP V2 latest data edition (BDTOPO_2-2_TOUSTHEMES_SHP_LAMB93_D032_2018-03-29). Using Windows with same Java version for all, same conf file (except input folder)... Seems to be related to bad processing of accentuated characters in ROAD table....

Some tests's details below (*).

Regards. Serge. (*) ** Test avec dernière version Geoclimate SNAPSHOT-2023-10-14

cd C:\Users\faraut\Documents\DEVELOPPEMENT\Geoclimate "C:\Program Files\Java\jdk-11.0.17\bin\java.exe" -jar geoclimate-0.0.2-SNAPSHOT-2023-10-14.jar -f Geoclimate-resus-BDTOPO_Gimont-32147.json -w BDTOPO_V3

--> Erreur: 10:10:12.085 [main] INFO class org.orbisgis.geoclimate.bdtopo.BDTopoUtils -- Processing the commune with the code insee : 32147 10:10:12.706 [main] INFO class org.orbisgis.geoclimate.bdtopo.BDTopoUtils -- Processing the commune with the code insee : 32147 org.h2.jdbc.JdbcSQLDataException: Erreur lors de la conversion de données "CHARACTER VARYING to DECFLOAT" Data conversion error converting "CHARACTER VARYING to DECFLOAT"; SQL statement:

        DROP TABLE IF EXISTS INPUT_ROAD [22018-224]
    at org.h2.message.DbException.getJdbcSQLException(DbException.java:518)

** Test avec version précédente SNAPSHOT-2023-07-18 et BDTOPO-V3: -> Erreur: C:\Users\faraut\Documents\DEVELOPPEMENT\Geoclimate>"C:\Program Files\Java\jdk-11.0.17\bin\java.exe" -jar geoclimate-0.0.2-SNAPSHOT-2023-07-18.jar -f Geoclimate-resus-BDTOPO_Gimont-32147.json -w BDTOPO_V3 The BDTOPO_V3 workflow has been started. Please wait... 10:13:37.321 [main] INFO org.orbisgis.geoclimate.bdtopo.BDTopoUtils - Processing the commune with the code insee : 32147 10:13:37.837 [main] INFO org.orbisgis.geoclimate.bdtopo.BDTopoUtils - Processing the commune with the code insee : 32147 org.h2.jdbc.JdbcSQLDataException: Erreur lors de la conversion de données "Gué ou radier" Data conversion error converting "Gué ou radier"; SQL statement:

        DROP TABLE IF EXISTS INPUT_ROAD [22018-214]
    at org.h2.message.DbException.getJdbcSQLException(DbException.java:506)

** Test avec dernière version Geoclimate SNAPSHOT-2023-10-14 et BDTOPO-V2 Fichier conf: Geoclimate-resus-BDTOPO-V2_Gimont-32147.json "C:\Program Files\Java\jdk-11.0.17\bin\java.exe" -jar geoclimate-0.0.2-SNAPSHOT-2023-10-14.jar -f "Geoclimate-resus-BDTOPO-V2_Gimont-32147.json" -w BDTOPO_V2 -> Pas d'erreurs - OK!

ebocher commented 11 months ago

The file troncon_de_route from BDTopo 3 on the department 32 is corrupted. The pos_sol columns contains a mix of integer and text values e.g "Gué ou radier" According the BDTopo spec the pos_sol must contains only integer value.

sfaraut commented 11 months ago

Hi Erwan! Thanks for explaination. It's really strange... But it seems this value "Gué ou radier" is in accordance to spec (last version),...

In DC_BDTOPO_3-3.pdf ( Descriptif de contenu - Janvier 2023) page 318 (URL: https://geoservices.ign.fr/sites/default/files/2023-01/DC_BDTOPO_3-3.pdf):

Chapter 12.14 : TRONCON_DE_ROUTE ... Position par rapport au sol Format PostgreSQL Format Shapefile position_par_rapport_au_sol POS_SOL Longueur maximale : 14 Type : Liste Valeurs possibles : 0 | 1 | -1 | 2 | -2 | 3 | -3 | 4 | -4 | Gué ou radier

ebocher commented 11 months ago

Good catch. Mixing integer and varchar is a very weird approach to modeling. Another +1 for OSM. I'll look for a workaround

ebocher commented 10 months ago

Fix with the PR #861 Please test

sfaraut commented 10 months ago

Hi! No more error now. Problem fixed! Thanks. Serge.