Coordinate System – Solving ogr2ogr Reprojection Issues

coordinate systemogr2ogr

I have a geodatabase that I would like to convert to shapefile with epsg:4326 projection. For this I use ogr2ogr.

However when I reproject, the results are offenter image description here. They seem to have shifted?

Any idea why?

The commands I'm using:

/opt/anaconda3/envs/python35/bin/ogr2ogr -f 'ESRI Shapefile' /volumes/data/Y2018M08D13_RH_Process_Basisregistratie_Gewaspercelen_V01/process2_V07/BRP_Gewaspercelen_2009.shp /volumes/data/Y2018M08D13_RH_Process_Basisregistratie_Gewaspercelen_V01/process_V07/BRP_Gewaspercelen_2009.gdb

and then convert to epsg 4326 (I used to do everything in one step but split for debugging purposes)

/opt/anaconda3/envs/python35/bin/ogr2ogr -t_srs EPSG:4326 /volumes/data/Y2018M08D13_RH_Process_Basisregistratie_Gewaspercelen_V01/output_V07/BRP_Gewaspercelen_2009.shp /volumes/data/Y2018M08D13_RH_Process_Basisregistratie_Gewaspercelen_V01/process2_V07/BRP_Gewaspercelen_2009.shp

Geodatabase: http://geodata.nationaalgeoregister.nl/brpgewaspercelen/extract/2009-definitief/brpgewaspercelen.zip

The file geodatabase has this metadata crs:

+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +towgs84=565.4171,50.3319,465.5524,-0.398957,0.343988,-1.87740,4.0725 +units=m +no_defs

Best Answer

The projection of the shapefiles is not wrong, it just lacks the datum shift (as ESRI shapefiles do per definition, while ogr2ogr needs it). So you have to add the EPSG code for the source and target CRS to do it right.

From your comment, this command line works:

 ogr2ogr -s_srs EPSG:28992 -t_srs EPSG:4326 -f 'ESRI Shapefile' outfile.shp infile.gdb
Related Question