PDA

View Full Version : Converting azimuthal map to equirectangular



Peter Ahlstrom
01-27-2012, 05:28 PM
Hi there. I've tried looking around for info on how to do this but am coming up blank.

I've got a map of a continent that is about 120 wide and 60 tall. It's drawn, basically, is if the world is flat. So let's say this is the equivalent, more or less, of the picture being taken from a satellite above the planet at a sufficient distance for the globe to look like a disc, and this satellite is positioned exactly over the center of this continent. So basically, this is a continent which will fit fine into an Azimuthal Equidistant projection using G.Projector, with the settings of longitude 0 E, latitude -30 N, and Radius 45, with fill corners checked.

I want to take this azimuthal equidistant projection and project it back to a baseline Equirectangular projection. There doesn't seem to be any way in G.Projector to do this: it will only calculate other projections starting with an equirectangular projection, and won't go the other way around if you don't have an equirectangular one to start out with.

Any ideas? I'm open to ANY method that will get me from a "looks like a globe photographed from space" to an equirectangular map. The rest of the non-continent globe surface can be completely white, that's fine.

Hai-Etlik
01-31-2012, 12:37 PM
Actually a globe from space approaches an Orthographic projection, not an Equidistant one. You could try using GDAL if you don't mind a command line interface, or a GIS like QuantumGIS can do this.

RobA
01-31-2012, 04:13 PM
You could also use a 3d modelling program. If you texture a sphere with your planar image, and set up a spherical/panoramic camera in the center of the sphere you can go back to the equi-rectangular projection.

(I've used POVRay for this in the past, but the learning curve is fairly steep as it has no GUI either :P )

-Rob A>

waldronate
02-01-2012, 01:35 AM
Long, long ago I wrote http://www.ridgenet.net/~jslayton/ReprojectImage.zip to do this sort of thing. It's a little rough around the edges, but it works quite well to go from a number of projections to Equirectangular.

Peter Ahlstrom
04-27-2012, 11:42 AM
Hi there,

It took too long for my post to get through moderation, so I figured everything out myself before the replies came. I'm on OS X, so I used the various commandline tools.

You're right about orthographic, but I didn't quite describe myself well enough. Anyway, using azimuthal made an end result that looks like what I wanted.

Here's what I did...

I found a blue marble geotiff, and used listgeo to get the data out of it. My map is 10000px by 5000 px. I altered the pixel scale to 0.036 and this turned out completely right (as far as I can tell).

So I put the geo data into the tiff to make a geotiff...

geotifcp -g Roshar-equirectangular.geo roshar_world/roshar_no_title.tif Roshar-equirectangular-unskewed-geotiff.tif

Then I warped it to the azimuthal equidistant projection I wanted...

gdalwarp -s_srs '+proj=latlong' -t_srs '+proj=aeqd +lat_0=-30 +lon_0=0' Roshar-equirectangular-unskewed-geotiff.tif Roshar-azimuthal-equidistant-unskewed-geotiff.tif

Then I opened that in Photoshop and pasted the old map on top of the new one, lining everything up in the middle. I increased the size by 171% to get it to align (I'm not worrying about the dodgy interpolation of data).

Then I saved to a new tiff, copied out the geo data from the azimuthal geotiff using listgeo, then copied it over to my new saved version to make a new geotiff:

geotifcp -g Roshar-azimuthal-equidistant.geo Roshar-azimuthal-equidistant.tif Roshar-azimuthal-equidistant-geotiff.tif

Then I warped it back to equirectangular:

gdalwarp -t_srs '+proj=latlong' -s_srs '+proj=aeqd +lat_0=-30 +lon_0=0' Roshar-azimuthal-equidistant-geotiff.tif Roshar-partial-equirectangular-geotiff.tif

Then in Photoshop I pasted the new version on top of my old equirectangular version, scaled to 58.1% aligned in the middle. And that was pretty much done.

Then I used make_gores.pl from http://www.vendian.org/mncharity/dir3/planet_globes/ to make a gore map so it can be printed out on stickers and stuck onto a globe.