Monday, 1 October 2018

Convert shapefiles from WGS84 to Miller Projection


I have some shapefiles of the world from Natural Earth at WGS84. I would like to convert them to the Miller Projection. I have ogr2ogr, but I'm not sure what the parameters for this conversion should be, or if this conversion can be done with it.




Answer



Because the eastern part of Russia crosses the 180° meridian, you have to cut your shapefile there. I have written a tutorial for cutting at any meridian to use the Natural Earth shapefiles here:


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


The clipping polygon for your case is:


Nr;WKT
1;POLYGON ((180.1 90, 179.9 90, 179.9 -90, 180.1 -90, 180.1 90))

giving you this result with EPSG:53003 (the spherical version of the Miller projection):


enter image description here





EDIT


If this works in QGIS, it works as well with pure ogr2ogr:


ogr2ogr -clipsrclayer D:\Karten\shp\Projektionen\180deg.txt -t_srs EPSG:53003 D:\Karten\shp\Projektionen\ne-miller.shp D:\Karten\shp\NaturalEarth\ne_110m_admin_0_countries.shp

No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...