1

I want to project a map as being rotated by x degrees (as opposed to the standard "north is up" orientation).

So far I'm able to get some arbitrary rotation using these projections:

Two Point Equidistant as used in this Gist

+proj=tpeqd +lat_1=35 +lat_2=35 +lon_1=-80 +lon_2=-122  +x_0=0 +y_0=0 +ellps=WGS84 +units=m +no_defs

Azimuthal as described here: Rotating ~90° using Two-Point Equidistant projection with Proj4

+proj=aeqd +ellps=sphere +lat_0=90 +lon_0=-90

However, I'm having trouble actually converting a value in degrees (like 45°) to a corresponding PROJ.4 string for a specific map. Can anyone point me in the right direction?

EDIT: I'm using Mapnik to render the maps.

3
  • Why not use a "standard" projection and rotate the canva by x degree ? – J.R Apr 17 '18 at 13:46
  • Wish it were that simple. That would also rotate labels, markers, etc. – kontextify Apr 17 '18 at 14:00
  • you should say what you use to render your map, depending there may be some simple solution or not – J.R Apr 17 '18 at 14:47
2

Note: I have not tried this.

You could try to use oblique Mercator. Here's an example of a PROJ string for a statewide Michigan projected coordinate reference system:

PROJ.4 : '+proj=omerc +lat_0=45.30916666666666 +lonc=-86 +alpha=337.25556 +k=0.9996 +x_0=2546731.496 +y_0=-4354009.816 +no_uoff +gamma=337.25556 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs'

Check out the alpha and gamma parameters: +alpha=337.25556 +gamma=337.25556

alpha rotates the cylinder used by oblique Mercator, AKA it happens early in the algorithm. gamma is applied near the end of the algorithm to re-orient the data. If you use the same values in alpha and gamma, grid north will be close to geodetic/true north in the center of the projection. So you can adjust alpha and gamma to rotate the coordinate reference system.

+no-uoff also influences it, but I've never figured out exactly how.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.