I may have found another way to flatten imagery and maps onto equirectangular projection. Matthew’s Map Projection Software, created by Matthew Arcus, is a suite of command-line applications for creating and re-projecting maps. At least on my Macintosh, it was quick and easy to compile and link the code using the instructions given on the page. Given that it doesn’t need porting for a Mac, I’m confident it would work perfectly for other Unices and Linuces. For Windows, you’d need to install some sort of “make” program, but even without the make utility the compile process doesn’t look too terribly complicated. As always, Image Magick is strongly recommended and free. MMPS apps require PPM images for input and return PPM images for output. For those with a make app, the command “make ppms” will convert any jpeg files in the images subdirectory into PPM format. The Image Magick mogrify command can also perform the conversion to and from a wider variety of file formats. The thing that caught my eye was the inverse projection option. This allows the user to project from any of the available projections back to equirectangular projection. Here you can find a basic introduction to the use of inverse projection to create at least a partial map from imagery. And if this page, describing how to convert a four view into a map, doesn’t give you some idea of what I’ll be doing in a future post, you haven’t been reading much of this blog :). Suffice to say, if you start playing around with a well-placed orthometric camera and a sphere with an unshaded texture in Blender it probably won’t be anything new to you by the time I get it out… For my purposes, the thing that finally makes MMPS almost a straight-out freeware replacement for Flexify 2 is its ability to easily transform map coordinate systems(recenter the map to a different latitude and longitude and rotate around that center). Flexify has a much more extensive set of projections, but a lot of those are… peculiar and the names are somewhat uninformative. For instance, let’s say we start with a 2048×1024 pixel equirectangular png(generated in Photoshop with Lunarcell) named testmap.png, and we want to center the map over a point at 90ºE, 45ºN, and tilt around that center by 30º counter-clockwise. Start by using Image Magick to convert to ppm.
convert testmap.png testmap.ppm Now, we use the following code in MMPS to perform the coordinate system transform.
./project -w 2048 -h 1024 latlong -long 90 -lat 45 -tilt 30 -f images/testmap.ppm > images/rotmap.ppm The resulting image,”rotmap.ppm,” will be essentially identical to an image transformed in Flexify 2 with the latitude slider set to 45, the longitude slider set to 90 and the spin slider set to 30. Perfect. The only unfortunate aspect of the MMPS project tool compared to Flexify is that it apparently can’t handle 16-bit imagery. (Note: Okay, maybe it can handle 16-bit. I’ll have to recheck that.)Other than that and a slightly more limited selection of projections, it is an excellent substitute.