Closed sfaraut closed 2 years ago
Same problems with SNAPSHOT-v0.0.2 Nightly downloaded this morning (18-05-2022)...
I gave before WTK's GDAL SRS informations (using gdalsrsinfo). Concerning data using RGF93-Lambert 93 projection, my BDTOPO data and "sample_12174" data are both seen as EPSG:2154 with "epsg" output type:
>gdalsrsinfo -o epsg C:\Users\faraut\Documents\DEVELOPPEMENT\Geoclimate\BD_TOPO_v2\sample_12174-orig\BATI_INDIFFERENCIE.shp
EPSG:2154
>gdalsrsinfo -o epsg C:\\DATA\\IGN-DATA\\BDTOPO_2-2_EPSG2154_D031_2018-09-25-converted\BATI_INDIFFERENCIE.shp
EPSG:2154
Better, I could verify that their proj4 are also exactly the same:
>gdalsrsinfo -o proj4 C:\Users\faraut\Documents\DEVELOPPEMENT\Geoclimate\BD_TOPO_v2\sample_12174-orig\BATI_INDIFFERENCIE.shp
+proj=lcc +lat_0=46.5 +lon_0=3 +lat_1=49 +lat_2=44 +x_0=700000 +y_0=6600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
>gdalsrsinfo -o proj4 C:\\DATA\\IGN-DATA\\BDTOPO_2-2_EPSG2154_D031_2018-09-25-converted\BATI_INDIFFERENCIE.shp
+proj=lcc +lat_0=46.5 +lon_0=3 +lat_1=49 +lat_2=44 +x_0=700000 +y_0=6600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
So it seems that Geoclimate (CTS?), somehow, is not able to parse correctly the "standard" .proj file of shapefiles provided by IGN or created by GDAL/OGR....
GeoClimate uses H2GIS to process data and then CTS to read prj file. CTS parses only the WKT version 1 that describes the CRS information in the prj file. Could you please copy-paste, the input of one prj file (not the GDAL info).
But this EPSG code is necessary to declare the SRID of the geometries in the database as PostGIS does
Sorry for the delay. My version of GDAL(gdalsrsinfo ) on Windows doesn't support WKT output format... Here is the raw .proj file content of BTDOPO V2 data converted to "EPSG21:54" (with GDAL/ogr2ogr):
C:\>type C:\\DATA\\IGN-DATA\\BDTOPO_2-2_EPSG2154_D031_2018-09-25-converted\BATI_INDIFFERENCIE.prj
PROJCS["RGF_1993_Lambert_93",GEOGCS["GCS_RGF_1993",DATUM["D_RGF_1993",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",700000.0],PARAMETER["False_Northing",6600000.0],PARAMETER["Central_Meridian",3.0],PARAMETER["Standard_Parallel_1",49.0],PARAMETER["Standard_Parallel_2",44.0],PARAMETER["Latitude_Of_Origin",46.5],UNIT["Meter",1.0]]
C:\>
This SRID is well identified by GDAL/gdalsrsinfo as as "EPSG:2154", just like GIS softwares (QGIS,...).
One way to solve this problem could be having a standard way/tool (in CLI mode like GDAL ?) to produice .proj files comptabible with Geoclimate/CTS. If not implementing a way to work as GDAL/gdalsrsinfo in CTS...
Tests must still have to be done on other system than Windows... or latest versions ( A couple of improvements... (PR #740))
To be complete, the original BDTOPO V2 files .proj files contain:
C:\>type C:\DATA\IGN-DATA\BDTOPO_2-2_TOUSTHEMES_SHP_LAMB93_D031_2018-09-25\BATI_INDIFFERENCIE.prj
PROJCS["RGF93_Lambert_93",GEOGCS["GCS_RGF_1993",DATUM["D_RGF_1993",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",700000.0],PARAMETER["False_Northing",6600000.0],PARAMETER["Central_Meridian",3.0],PARAMETER["Standard_Parallel_1",44.0],PARAMETER["Standard_Parallel_2",49.0],PARAMETER["Latitude_Of_Origin",46.5],UNIT["Meter",1.0]]
C:\>
The only difference with converted to "EPSG:2154" version is only "RGF93_Lambert_93" in place of "RGF_1993_Lambert_93". All other parameters are the same.
Here is the raw .proj file content of BTDOPO V2 data converted to "EPSG21:54" (with GDAL/ogr2ogr):
As you can see the prj file doesn't contain any information about the epsg. GDal uses PROJ4 lib that offers a mecanism to retrieve the best epsg code according the CRS parameters. QGIS is based on GDAL so yes it detects the EPSG code.
One way to solve this problem could be having a standard way/tool (in CLI mode like GDAL ?) to produice .proj files comptabible with Geoclimate/CTS. If not implementing a way to work as GDAL/gdalsrsinfo in CTS...
It's a big job. CTS is a free software so a PR is welcome to solve this problem.
Tests must still have to be done on other system than Windows... or latest versions ( A couple of improvements... (PR https://github.com/orbisgis/geoclimate/pull/740))
Same comments as before. Any PR that can improved GeoClimate and help the community are welcome.
The only difference with converted to "EPSG:2154" version is only "RGF93_Lambert_93" in place of "RGF_1993_Lambert_93". All other parameters are the same.
A the end of prj formatting yes.
The SRID error with non standardized prj has been fixed on H2GIS side see https://github.com/orbisgis/h2gis/pull/1312
Hello,
When I try to use all recent Geoclimate SNAPSHOT-0.0.2 Nightly versions with BDTOPO data downloaded from IGN, I have this error: The process has been stopped since the table BATI_INDIFFERENCIE has a no SRID.
I tried to convert DATA to other projections using "ogr2og" , and it makes no difference. Tried all RGF93 (Lambert93, CC43,...) and even "WGS 84 / World Mercator - EPSG:3395]"
Is only the projection of "sample_12174" to be recognized bhy Geoclimate?
For example with WGS 84 / World Mercator - EPSG:3395 :
Config file (my_first_try_BDTOPO_Aigrefeuille-id_zone-converted-0.0.2.json):
Execution:
Informations on shapefile C:\DATA\IGN-DATA\BDTOPO_2-2_EPSG3395_D031_2018-09-25-converted\BATI_INDIFFERENCIE.shp :
Same thing with RGF93 / Lambert-93 - EPSG 2154, with in config file concerning new input folder:
For reference, here is what I get with the "sample_12174" example which work (but with the road width bug corrected):
These SRS information are more "complex" to understand, even its seems that main parameters are the same... What are the differences as they should be all of them some "RGF93 / Lambert-93" projection? And how this shapefile (or this projection) have been obtained?
I convert (by script) all data files using GDAL/OGR tools, on Windows. For forcing RGF93/Lamber-93 EPSG:2154" projection I used:
I don't understand why my "standard" projection (even WGS84) using "GDAL/OGR" don't work... Can't we use them do make batch process of data? Is it possible to know what projection can be recognized in Geoclimate by "CTS" library?
Or is it a bug to fix in SRID verification?
Thanks by advance,
Serge.