Correlating projection values from embedded metadata

ozbigbenozbigben Global Mapper UserPosts: 9
edited July 2014 in Projection Questions
Hi All

I've been using 2% of Global Mapper's functionality for many years but it's finally time to step things up a notch for some projects I'm working on. What I'm trying to do is work with a large number of TIFF DTMs, using a database of metadata to generate a script fragment to load images into Global Mapper. Apart from learning scripting, I have a projection-related question which is getting outside of my areas of expertise.

The DTMs are HRSC data for Mars which are Sinusoidal projection. I've got most of it working but as far as I can tell I need to specify the projection for each image, in particular the central meridian. When I load the TIFF in manually i get prompted to specify a datum to use, which is a pain to do for every image. I've collected all of the metadata from the images using EXIFTool and I've looked at a GMW file loading the same image but I don't see how to the central meridian in the GMS coorrelates to the image metadata.

Any help would be greatly appreciated

Sample image metadata:
ExifToolVersion                 : 9.34
FileName                        : h0018_0000.da4.53.tif
Directory                       : G:/data/Elevation/Mars/HRSC/mex4/0018
FileSize                        : 116 MB
FileModifyDate                  : 2014:06:06 20:14:49+10:00
FileAccessDate                  : 2014:07:09 09:58:10+10:00
FileCreateDate                  : 2014:07:09 21:59:14+10:00
FilePermissions                 : rw-rw-rw-
FileType                        : TIFF
MIMEType                        : image/tiff
ExifByteOrder                   : Little-endian (Intel, II)
ImageWidth                      : 1313
ImageHeight                     : 33003
BitsPerSample                   : 16
Compression                     : Uncompressed
PhotometricInterpretation       : BlackIsZero
StripOffsets                    : (Binary data 97632 bytes, use -b option to ext
ract)
SamplesPerPixel                 : 1
RowsPerStrip                    : 3
StripByteCounts                 : (Binary data 55004 bytes, use -b option to ext
ract)
PlanarConfiguration             : Chunky
PixelScale                      : 50 50 0
ModelTiePoint                   : 0 0 0 -24515 728260 0
GDALMetadata                    : <GDALMetadata>
  <Item name="CREATOR">Conversion from VICAR Format by Sebastian Walter, swalter@zedat.fu-berlin.de</Item>
  <Item name="DTM.DTM_A_AXIS_RADIUS">-1e+32</Item>
  <Item name="DTM.DTM_B_AXIS_RADIUS">-1e+32</Item>
  <Item name="DTM.DTM_C_AXIS_RADIUS">-1e+32</Item>
  <Item name="DTM.DTM_DESC">Height above equipotential surface described by potential model GMM3 (PDS dataset MGS-M-MOLA-5-MEGDR-L3-V1.0)</Item>
  <Item name="DTM.DTM_MAXIMUM_DN">1063</Item>
  <Item name="DTM.DTM_MINIMUM_DN">-5474</Item>
  <Item name="DTM.DTM_MISSING_DN">-32768</Item>
  <Item name="DTM.DTM_OFFSET">0.0</Item>
  <Item name="DTM.DTM_SCALING_FACTOR">1.0</Item>
  <Item name="PRODUCT_TYPE">DTM</Item>
  <Item name="SPACECRAFT_NAME">MARS_EXPRESS</Item>
  <Item name="STATISTICS_MAXIMUM" sample="0">1063</Item>
  <Item name="STATISTICS_MEAN" sample="0">0</Item>
  <Item name="STATISTICS_MINIMUM" sample="0">-5474</Item>
  <Item name="STATISTICS_STDDEV" sample="0">0</Item>
</GDALMetadata>

SubfileType                     : Reduced-resolution image
TileWidth                       : 128
TileLength                      : 128
TileOffsets                     : (Binary data 163 bytes, use -b option to extra
ct)
TileByteCounts                  : (Binary data 101 bytes, use -b option to extra
ct)
SampleFormat                    : Signed
GDALNoData                      : -32768
GeoTiffVersion                  : 1.1.0
GTModelType                     : Projected
GTRasterType                    : Pixel Is Area
GTCitation                      : SINUSOIDAL MARS
GeographicType                  : User Defined
GeogCitation                    : GCS Name = GCS_MARS|Datum = D_MARS|Ellipsoid =
 MARS|Primem = Reference_Meridian|
GeogGeodeticDatum               : User Defined
GeogAngularUnits                : Angular Degree
GeogEllipsoid                   : User Defined
GeogSemiMajorAxis               : 3396000
GeogSemiMinorAxis               : 3396000
GeogPrimeMeridianLong           : 0
ProjectedCSType                 : User Defined
Projection                      : User Defined
ProjCoordTrans                  : Sinusoidal
ProjLinearUnits                 : Linear Meter
ProjFalseEasting                : 0
ProjFalseNorthing               : 0
ProjCenterLong                  : 323
ImageSize                       : 1313x33003

GMW snippet:
IMPORT FILENAME="G:\data\Elevation\Mars\HRSC\ValleMarineris\h0018_0000.da4.53.tiff" \
     TYPE="GEOTIFF" PROJ_NAME="SNSOID_Interplanetary,_Mars_2000_Sphere_23" LABEL_FIELD_FORCE_OVERWRITE="NO" \
     LOAD_FLAGS="0~0~0~3~0~0" SAMPLING_METHOD="BILINEAR" CLIP_COLLAR="NONE" TRANSLUCENCY="512" \
     FEATHER_BLEND_SIZE="200" FEATHER_BLEND_EDGES="31" FEATHER_BLEND_POLY="FEATHER_POLY" \
     ELEV_UNITS="METERS"
DEFINE_PROJ PROJ_NAME="SNSOID_Interplanetary,_Mars_2000_Sphere_24"
Projection     SINUSOIDAL
Datum          INTERPLANETARY,_MARS_2000_SPHERE
Zunits         NO
Units          METERS
Xshift         0.000000
Yshift         0.000000
Parameters
[B]-31 0 0.000 /* central meridian[/B]

0.000 /* false easting (meters)

0.000 /* false northing (meters)

END_DEFINE_PROJ

Comments

  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited July 2014
    In the metadata the central longitude is listed as 323, which is the 0-360 degree convention. To convert that to the normal -180 to +180 just subtract 360 from anything over 180. For example, 323 - 360 is -37, so replace the -31 in the Parameters section of the projection definition with -37.

    Where can I download one of these TIFF files? I may be able to make some easy modifications and directly set up these projection parameters.

    Thanks,

    Mike
    Global Mapper Guru
    geohelp@bluemarblegeo.com
  • ozbigbenozbigben Global Mapper User Posts: 9
    edited July 2014
    In the metadata the central longitude is listed as 323, which is the 0-360 degree convention. To convert that to the normal -180 to +180 just subtract 360 from anything over 180. For example, 323 - 360 is -37, so replace the -31 in the Parameters section of the projection definition with -37.

    Thanks Mike

    That was my guess but the odd thing is that it doesn't match the number Global Mapper uses if I manually load the image, and if I use it the terrain is incorrectly positioned.

    The data can be downloaded from Index of /mex4
    Each directory should contain one tiff which is the elevation data. It's not a huge problem but it would be nice to automate as I want to do a batch conversion to lat/long, cropping 5px from the border of valid data, and there's about 1,400 of them..
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited July 2014
    The GeoTIFF referenced a Mars ellipsoid/datum that was slightly different than the built-in ones. I have added a new one (Mars MOLA Sphere) that is a sphere radius 3960000. Now the GeoTIFF loads right in with the correct datum and placement.

    I have placed new builds with the latest changes at the links below:

    32-bit: http://www.bluemarblegeo.com/downloads/global-mapper/global_mapper15.zip
    64-bit: http://www.bluemarblegeo.com/downloads/global-mapper/global_mapper15_64bit.zip

    Simply download the .zip file for the build that you are using and extract over your existing installation files. The likely locations to extract to are as follows:

    32-bit: C:\Program Files (x86)\GlobalMapper15
    64-bit: C:\Program Files\GlobalMapper15_64bit

    Thanks,

    Mike
    Global Mapper Guru
    geohelp@bluemarblegeo.com
    Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation
  • ozbigbenozbigben Global Mapper User Posts: 9
    edited July 2014
    Could be a good time for me to upgrade as well ;) Still on 14.2
    Thanks for the quick response.

    Ben
Sign In or Register to comment.