I need to warp a global dataset into a set of 6 rasters to form a cubemap for rendering the Moon. These rasters must be in Gnomonic projection in order for the rectangular raster bounds to line up along longitude lines. I am not finding any resources online that help with defining a Gnomonic projection for celestial bodies besides Earth.
I was able to use gdalwarp (through the OSGeo4W shell) to generate Stereographic projection rasters that are close to what I am looking for through commands like the following:
> gdalwarp -te -45 -45 45 45 -te_srs moon_cyl.prj -ts 16384 16384 -t_srs moon_stereog_eq_long_0.prj Lunar_LRO_LOLA_Global_LDEM_118m_Mar2014.tif WarpedGlobalToEq0.tif
ERROR 1: Invalid dfSouthLatitudeDeg
ERROR 1: Invalid dfSouthLatitudeDeg
Creating output file that is 16384P x 16384L.
Processing Lunar_LRO_LOLA_Global_LDEM_118m_Mar2014.tif [1/1] : 0Using internal nodata values (e.g. -32768) for image Lunar_LRO_LOLA_Global_LDEM_118m_Mar2014.tif.
Copying nodata values from source Lunar_LRO_LOLA_Global_LDEM_118m_Mar2014.tif to destination WarpedGlobalToEq0.tif.
...10...20...30...40...50...60...70...80...90...100 - done.
With the projection moon_stereog_eq_long_0.prj
defined by this WKT:
PROJCS["Moon_Stereographic_AUTO",
GEOGCS["Moon 2000",
DATUM["D_Moon_2000",
SPHEROID["Moon_2000_IAU_IAG",1737400.0,0.0]],
PRIMEM["Greenwich",0],
UNIT["Decimal_Degree",0.0174532925199433]],
PROJECTION["Stereographic"],
PARAMETER["False_Easting",0],
PARAMETER["False_Northing",0],
PARAMETER["Central_Meridian",0],
PARAMETER["Scale_Factor",1],
PARAMETER["Latitude_Of_Origin",0],
UNIT["Meter",1]]
and varying the Central_Meridian
and Latitude_Of_Origin
was all I needed to do to switch center locations.
The results, though, are unsatisfactory because Stereographic projection does not have straight longitude lines (or other great circle lines).
When I try to use a modified WKT with what I think will give me a Gnomonic projection, I get errors like one of the following:
PROJ: proj_create: Error -9 (unknown elliptical parameter name)
Cannot invert geotransform
buildCS: missing UNIT
What is the right way to define a Gnomonic projection for the Moon?
Quick Reference: