[PROJ] Transformation to rotated pole

Even Rouault even.rouault at spatialys.com
Sat Nov 21 06:32:26 PST 2020


Ken,

Not completely clear if you want to reproject from or into rotated pole, but 
you'll fix trivially the below depending on your need.

shapefile .prj AFAIK cannot store a rotated pole CRS, so I'd just try to do it 
in one step, with the following modified & corrected CRS ("+proj=latlon" was 
wrong, it should be "+proj=ob_tran +o_proj=latlon")

ogr2ogr -s_srs "+proj=ob_tran +o_proj=latlon +lat_0=0 +lon_0=180 +o_lat_p=18.0 
+o_lon_p=-200.0 +datum=WGS84 +type=crs"  -t_srs EPSG:4326 output.shp 
source.shp

You may need a quite recent PROJ version for that to work correctly due to 
ob_tran being complicated to handle when "computing" transformation pipelines.

Actually I just did a fix in PROJ master (https://github.com/OSGeo/PROJ/pull/
2441) for ob_tran if there was a +towgs84 term (you don't need one here, as 
+a=6378137 +rf=298.257223563 +towgs84=0,0,0 really means +datum=WGS84)

Or you can also directly specify the transformation pipeline which should 
hopefully work with any GDAL >= 3 and PROJ >= 6

ogr2ogr -ct "+proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad 
+step +inv +proj=ob_tran +o_proj=latlon +lat_0=0 +lon_0=180 +o_lat_p=18 
+o_lon_p=-200 +ellps=WGS84 +step +proj=unitconvert +xy_in=rad +xy_out=deg" 
output.shp source.shp

if you add -t_srs EPSG:4326, you'll also likely need to add " +step 
+proj=axisswap +order=2,1" at the end of the above pipeline to deal with the 
lat,lon axis order of EPSG:4326

(for the reverse direction remove the +inv)

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the PROJ mailing list