Opened 12 years ago

Closed 5 years ago

#4522 closed defect (wontfix)

Wrong decoding of NASA MOLA grids with PDS/NASA driver

Reported by: jluis Owned by: warmerdam
Priority: normal Milestone: closed_because_of_github_migration
Component: GDAL_Raster Version: svn-trunk
Severity: normal Keywords:
Cc:

Description

Running gdalinfo on this example grid

http://pds-geosciences.wustl.edu/mgs/mgs-m-mola-5-megdr-l3-v1/mgsl_300x/meg004/megt90n000cb.lbl

reports

ERROR 6: megt90n000cb.lbl, band 1: SetNoDataValue() not supported for this dataset.
ERROR 6: megt90n000cb.lbl, band 1: SetOffset() not supported on this raster band.
ERROR 6: megt90n000cb.lbl, band 1: SetScale() not supported on this raster band.
Driver: PDS/NASA Planetary Data System
Files: megt90n000cb.lbl
Size is 1440, 720
Coordinate System is:
PROJCS["SIMPLE_CYLINDRICAL MARS",
    GEOGCS["GCS_MARS",
        DATUM["D_MARS",
            SPHEROID["MARS",3396000,0]],
        PRIMEM["Reference_Meridian",0],
        UNIT["degree",0.0174532925199433]],
    PROJECTION["Equirectangular"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",180],
    PARAMETER["standard_parallel_1",0],
    PARAMETER["false_easting",0],
    PARAMETER["false_northing",0]]
Origin = (-10668960.000000000000000,5334480.000000000000000)
Pixel Size = (14818.000000000000000,-14818.000000000000000)
Metadata:
  BANDWIDTH=
  CENTER_FILTER_WAVELENGTH=
  DATA_SET_ID="MGS-M-MOLA-5-MEGDR-L3-V1.0"
  FILTER_NAME=
  INSTRUMENT_ID=MOLA
  INSTRUMENT_NAME=MARS_ORBITER_LASER_ALTIMETER
  MISSION_NAME=
  NOTE=
  PRODUCER_INSTITUTION_NAME="GODDARD SPACE FLIGHT CENTER"
  PRODUCT_CREATION_TIME=2003-04-03T01:00:00
  PRODUCT_ID="MEGT90N000CB.IMG"
  PRODUCT_TYPE=
  SPACECRAFT_NAME="MARS GLOBAL SURVEYOR"
  TARGET_NAME=MARS
Corner Coordinates:
Upper Left  (-10668960.000, 5334480.000) (  0d 0' 6.76"W, 90d 0' 3.38"N)
Lower Left  (-10668960.000,-5334480.000) (  0d 0' 6.76"W, 90d 0' 3.38"S)
Upper Right (10668960.000, 5334480.000) (  0d 0' 6.76"E, 90d 0' 3.38"N)
Lower Right (10668960.000,-5334480.000) (  0d 0' 6.76"E, 90d 0' 3.38"S)
Center      (   0.0000000,   0.0000000) (180d 0' 0.00"E,  0d 0' 0.01"N)

One question is why it says the grid is "Equidistant Cylindrical"? It would preferable to have it saying something like 'geographical' but the most important issue is that the corner coordinates are wrong (the grid step is 4 pix/deg = 15').

The other thing, which I'll report in another ticket, is that this grid is not correctly converted by gdalwarp.

Change History (3)

comment:1 by Jukka Rahkonen, 9 years ago

At least the metadata item MAP_SCALE = 14.818 <KM/PIXEL> suits with the pixel size that is reported by gdalinfo.

Are there specialists of the geography of Mars following this ticket?

comment:2 by thare, 8 years ago

This is an interesting ticket not really from the original issue (more on that later) but from the "ERROR 6" messages that have been creeping up lately in different gdal builds. The PDS, ISIS2, and ISIS3 drivers all support SetNoDataValue, SetOffset, and SetScale. I have not been able to figure out where this error is coming from to actually submit a ticket. I have seen this issue appear in the 1.13.x binaries by KyngChaos and gdal-2.0.0 binaries in Anaconda. Fortunately, upgrading to 1.14.x seems to fix issue for Macs. I'm not sure there is a fix for Anaconda binaries yet without dropping to an older version (e.g. conda install gdal=1.11.2).

Anyway, back to main topic. This is not really a bug but a "feature". There was a conscious decision for the PDS, ISIS2, ISIS3 (and probably VICAR), when a map projection is defined, to use it and always default to meters for the horizontal Cartesian coordinate system. Thus while indeed this file could be defined in "geocentric/geographic" using the defined "MAP_RESOLUTION = 4.0 <PIXEL/DEGREE>" (or 0.25 deg/pix) and the lat/lon ranges, there is also required keywords for "MAP_SCALE = 14.818 <KM/PIXEL>" and "MAP_PROJECTION_TYPE = SIMPLE CYLINDRICAL". PDS, ISIS2, and ISIS3 do not really allow for map projected products to be defined only in degrees. The label is required to also define the map projection and the pixel spacing in meters (or kilometers).

To be consistent across all map projected products, the current GDAL driver for these formats will default to using "MAP_SCALE" to gather the linear units (meters/kilometers) and try to map to an equivalent projection which for this MOLA product happens to map to "Equidistant Cylindrical".

If degrees is really needed, it is pretty easy to override these defaults by using a VRT and changing the geotransform and map projection (SRS) definition to just define the body size. -Trent

Last edited 8 years ago by thare (previous) (diff)

comment:3 by Even Rouault, 5 years ago

Milestone: closed_because_of_github_migration
Resolution: wontfix
Status: newclosed

This ticket has been automatically closed because Trac is no longer used for GDAL bug tracking, since the project has migrated to GitHub. If you believe this ticket is still valid, you may file it to https://github.com/OSGeo/gdal/issues if it is not already reported there.

Note: See TracTickets for help on using tickets.