2

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.

Stereographic warped rasters

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:

1 Answer 1

1

This may be a valid WKT for a Gnomonic projection centered at 0,0:

PROJCS["Moon_Gnomonic_Equatorial",
    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["Gnomonic"],
    PARAMETER["False_Easting",0],
    PARAMETER["False_Northing",0],
    PARAMETER["Longitude_of_Center",0],
    PARAMETER["Scale_Factor",1],
    PARAMETER["Latitude_Of_Center",0],
    UNIT["Meter",1]]

I thought the change of the PARAMETER nomenclature was the change that made this work, but I may have been having problems with the south pole warp I was trying to do apart from the definition of the projection, which convoluted the problem.

possibly correct Gnomonic

In this instance, though, it appears the corners of the raster are offset from the correct 45,45 degrees. This offset goes away when sufficiently zoomed in. I have no idea why. Zoomed in Gnomonic vs Stereographic

EDIT: I previously was under the assumption that the vertex of a cube projected onto a sphere corresponded to the 45/45 Lat/Long point. It does not. The true point is still 45*n longitude, but the latitude is +- 35.264 (asin(sqrt(3)/3)).


Quick Reference:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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