orbisgis / orbisdata

Providing a common access point to data
GNU Lesser General Public License v3.0
2 stars 5 forks source link

Pblm with SRID #183

Closed gpetit closed 4 years ago

gpetit commented 4 years ago

I want to retrieve (and compare) the SRID of shapefiles that are imported during the BD Topo process. So in my groovy script I wrote

def srid = datasource.getTable(tableIrisName).srid
logger.info "The SRID used in the table $tableIrisName is $srid"

When I execute my tests, I have some troubles since the message indicates that for the IRIS_GE table, the SRID is equal to 0, when it should be 2154 (see the content of the associated .PRJ file below)

PROJCS["RGF93_Lambert_93",GEOGCS["GCS_RGF93",DATUM["D_RGF_1993",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["standard_parallel_1",49],PARAMETER["standard_parallel_2",44],PARAMETER["latitude_of_origin",46.5],PARAMETER["central_meridian",3],PARAMETER["false_easting",700000],PARAMETER["false_northing",6600000],UNIT["Meter",1]]

Note that the IRIS_GE.shp is imported like this

h2GISDatabase.load(BDTopoGISLayersTest.class.getResource("bdtopofolder/IRIS_GE.shp"), "IRIS_GE", true)

In debug mode, we (with @SPalominos) executed this command line

((org.orbisgis.datamanagerapi.dataset.ISpatialTable)h2GISDatabase.getTable("IRIS_GE")).getSrid()

and the result is 0

ebocher commented 4 years ago

The PROJCS["RGF93_Lambert_93",GEOGCS["GCS_RGF93",DATUM["D_RGF_1993",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["standard_parallel_1",49],PARAMETER["standard_parallel_2",44],PARAMETER["latitude_of_origin",46.5],PARAMETER["central_meridian",3],PARAMETER["false_easting",700000],PARAMETER["false_northing",6600000],UNIT["Meter",1]]

doesn't contain any EPSG code so the lib cannot find a srid.

Here you will find a valid OGC WKT https://spatialreference.org/ref/epsg/rgf93-lambert-93/ogcwkt/

gpetit commented 4 years ago

Hum ... these PRJ files are coming from IGN ...