4

I have a line shapefile with a local transverse mercator projection ("+proj=tmerc +lat_0=50 +lon_0=172.5 +x_0=0 +y_0=0 +a=6371000 +b=6371000 +units=m +no_defs") and I want to reproject it into EPSG:4326 with ogr2ogr. The line feature is crossing the international date meridian, as you can see in the image. Input line This particular situation seems to be a problem for ogr2ogr. In fact, the reprojected output line is crossing the entire world, and this is clearly wrong. Output line

This is the command I used for the reprojection:

ogr2ogr -f "ESRI Shapefile" track_linedate_pr.shp track_linedate.shp -t_srs EPSG:4326

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
Andreampa
  • 730
  • 6
  • 17

2 Answers2

1

There is no other way to display the shape properly than to cut it between 179.9°E and -179.9° (W). I described a workflow for the cutting here:

QGIS display world country shape files centered on pacific ocean using Robinson, Miller Cylindrical or other projection

AndreJ
  • 76,698
  • 5
  • 86
  • 162
0

You can use the -wrapdateline flag with ogr2ogr to split the geometry automatically at the dateline

spatialthoughts
  • 6,106
  • 28
  • 49