I want to see a Mercator map where I choose what latitude/longitude is in the center and what direction is "north". In some sense, a Mercator map of a rigid rotation of the globe.
Does such a program/site exist? I'm familiar with Mercator Rotator, but this appears to be vaporware. I'm working on a project like this myself, and want to see if I'm duplicating anything.
Same general question for other projections.
Answer
You don't say which software you're using, but in general you can use the Proj4 library (for which there are bindings for many popular languages) to create a transformation from one CRS to another.
Proj4 has an Oblique Mercator projection type that is just what you're looking for. Its parameters are described here. For example, this definition:
+proj=omerc +k=1.0 +lat_0=52.0 +alpha=23.0 +lonc=-4.0
Puts the centre of the projection at 52N 4W, and rotates it 23 degrees clockwise. You can also specify the centre and rotation parameters in terms of a great circle.
There are potential problems however, and you'll have to handle your data with care because you can easily end up with wrap-around problems at the projection's anti-meridian. For example, the World Borders datset looks like this normally:
And with our Oblique Mercator defined above, it looks like this:
Everything is good apart from the vertical lines, which is where the data wraps around and causes QGIS (in this case) problems when it comes to render.
There are also caveats in the Proj4 documentation that say it will fail if the parameters nearly define a regular or transverse Mercator, but it looks like you'll have to use trial-and-error to see to what tolerance it can go to.
No comments:
Post a Comment