How to project the shapefile with GDAL ogr2ogr
Asked Answered
V

3

5

The GDAL ogr2ogr project the shape file with EPSG:28991 and create .prj file near Amersfoort. But the actual place of shp file should be in amsterdam.

How to reproject the shape file to locate it on amsterdam with the help of xmin ymin xmax, ymax.enter image description here

Veterinarian answered 13/6, 2017 at 7:45 Comment(1)
Did you find the asnwer? Let us know if the suggestions provided led you to the results, so we can close the thread.Necessary
S
7

This Command can help you you convert shapefile projection when you have two different EPSGs.

ogr2ogr -f "ESRI Shapefile" -t_srs EPSG:NEW_EPSG_NUMBER -s_srs EPSG:OLD_EPSG_NUMBER output.shp input.shp
Sauer answered 13/6, 2018 at 7:20 Comment(0)
N
0

There are a lot of reasons for why this didn't work. Do you know what the original projection of the shapefile was? Wrong placement doesn't necesarrily mean wrong projection. Is the actual data correct?

Ogr2ogr and other commandline tools are not the best solution for one-time only actions and solving such problems. Much more user friendly tool, that actually run on the same engines, is QGIS for example. You will get more visual perception on the problem and you will trouble shoot everything much faster.

Necessary answered 15/6, 2017 at 11:42 Comment(0)
T
0

Regarding the GDAL OGR, no problem in the tool itself. The prj file created contains the EPSG projection that you have assigned to the shapefile. The problem in such cases is, that the map and the shapefile layer are not on the same coordinates system which causes the shifting. To solve this problem make sure that the PRJ file generated contains the targeted coordinates system and what's more important is to assure that the map coordinates is exactly the same.

Theodor answered 7/12, 2017 at 20:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.