Global mapper grid file
kartoone76
Global Mapper UserTrusted User
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!
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!
Comments
-
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
Categories
- 12.7K All Categories
- 5.6K Features Discussion
- 342 Downloading Imagery
- 1.3K Elevation Data
- 380 Georeferencing Imagery Discussion
- 628 GM Script Language
- 53 User Scripts
- 113 GPS Features
- 414 Projection Questions
- 819 Raster Data
- 1.3K Vector Data
- 6.6K Support
- 177 Announcement and News
- 908 Bug Report
- 558 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 562 Other Discussion
- 129 GIS Data Sources
- 27 Global Mapper Showcase
- 233 How I use Global Mapper
- 107 Global Mapper Forum Website