-
Global mapper grid file
Is there a way to extract the bounding coordinates from a global mapper grid (GMG) file? It appears to be a binary file and a quick scan of the file didn't reveal anything that would hint at the location of where the bounding coordinates would be. Is there a specific byte location or does the entire file have to be parsed in order to find out the bounding coordinates?
As an alternative, I am prepared to write a script that would use the EXPORT_METADATA command to export the metadata (which I presume would include the bounding coordinates) for all loaded GMG files and then create a separate non-global mapper script to re-process the exported .txt file to extract the bounding coordinates. I was just wondering if there is an easier way.
Thanks!
-
-
It is a binary file. Here is the C declaration of the header from which you can extract the bounding box:
struct PackedHeader_t
{
sint32 mHeaderSize; // Size of entire header
uint32 mMagicNumber; // Magic number
double mMinX; // X coordinate of center of top left sample
double mMaxY; // Y coordinate of center of top left sample
double mPixelSizeX; // Ground size of a pixel in the X direction
double mPixelSizeY; // Ground size of a pixel in the Y direction
sint32 mImageWidth; // Total number of valid pixels in a row
sint32 mImageHeight; // Total number of valid pixels in a column
uint8 mTilePowerX; // 1 << Total number of samples in a tile row
uint8 mTilePowerY; // 1 << Total number of samples in a tile column
sint8 mElevUnits; // Elevation units (same as ViewerUtils)
sint32 mMinZ; // Minimum elevation
sint32 mMaxZ; // Maximum elevation
// Offsets to tables and other values
uint32 mProjOffset; // Offset to embedded projection string
uint32 mProjSize; // Size of embedded projection string
uint32 mLayerTableOffset; // Offset to layer table
uint32 mLayerTableSize; // Size of layer table
uint32 mLayerTableRecSize; // Size of layer table record
uint32 mTileSizeTableOffset; // Offset to table of tile sizes
uint32 mTileSizeTableRecSize; // Size of tile size table record
uint32 mTileTableOffset; // Offset to the tile data table
};
Let me know if I can be of further assistance.
Thanks,
Mike
Global Mapper Support
support@globalmapper.com
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Powered by
vBulletin® Version 4.2.1
Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.
Content Relevant URLs by
vBSEO 3.6.1

Copyright 2008-2012 Globalmapperforum.com
All times are GMT. The time now is 03:33 AM.
Bookmarks