[gdal-dev] Vertical Mapper GRD files

Andrew Williams AWilliams at rapidmap.com
Sun Jun 22 19:45:51 EDT 2008


Man this is the bane of my existence. I too was challenged with the requirement to extract data in Mapinfo from a Vertical Mapper grid.

Vertical Mapper grids are actually not native grids to Mapinfo. Vertical mapper was written by a third party called Northwood Geosceince in Canada. Mapinfo acquired them some years ago as I understand it.

Other then the VMSDK which is about USD$700 there is almost nothing about the format available.

If it's not against the rules of the forum here is a link to the Mapinfo-L Google Group with athread I started about this very issue.

http://groups.google.com/group/mapinfo-l/browse_thread/thread/175f375be41d7e23

I also had a colleague who did some work on breaking down the format.

Below are his discoveries. His skills far exceed mine.

I hope you can make use of this.

byte 0, 4 characters "HGPC"
byte 4, 1 character "1" (version)

byte 9, 2 byte integer - no of X pixels
byte 11, 2 byte integer - no of Y pixels
byte 13, 8 byte double - min X coordinate
byte 21, 8 byte double - max X coordinate
byte 29, 8 byte double - min Y coordinate
byte 37, 8 byte double - max Y coordinate
byte 45, 4 byte float - min Z value
byte 49, 4 byte float - max Z value

Data starts at byte 1028 and is a stream of 16-bit integer
values.  0 is noval.  Data is stretched to use values
1-65535.  Use Z min and Z max to reconstruct original
Z values.

 Some resources I've found:

This includes a file spec for a related file format - not the same but documents some conventions
http://testdrive.mapinfo.com/TECHSUPP/MIPROD.NSF/0/9ba1b248cfac072285256eae004d123e/$FILE/SDK%202.6.pdf

Some basic code for the 3d file format
http://testdrive.mapinfo.com/techsupp/miprod.nsf/kbase_by_product/BAABD8094414825785256D12004CD1CE

AND
I managed to get the first GRD file loaded into PostGIS
with my python code.

To match the alignment with our reference data I had to add an offset of
exactly 2 grid pixels east, which is a bit odd, but there you
go.  I expected a half-pixel uncertainty since I wasn't sure if the
coordinates are the centre or edge of the pixel, but a 2 pixel
shift doesn't make any obvious sense.

I'd suggest if you are uncertain about your file types the
Vertical Mapper GRD files are easily distinguished by the
characters "HGPC " in the first 4 bytes.  If the 5th byte
is "." then it is a 3d file, which is well documented.  If the
5th byte is "1" then it is a 2d file, which is what I have, and
I have not found documentation.

I used a Unix box (FreeBSD) for my exploratory analysis.  If you have
access to one you can check the first bytes for this signature
with something like this:
    od -c myfile.grd | head

From: gdal-dev-bounces at lists.osgeo.org [mailto:gdal-dev-bounces at lists.osgeo.org] On Behalf Of Ned Harding
Sent: Saturday, 14 June 2008 1:30 AM
To: gdal-dev at lists.osgeo.org
Subject: [gdal-dev] Vertical Mapper GRD files

Does anyone have any information about how to read Vertical Mapper GRD/GRC files?  I haven't been able to find much on them.

Ned Harding
CTO
SRC, LLC
3825 Iris Avenue, Suite 150
Boulder, CO 80301
(303) 440-8896 x104
nharding at extendthereach.com<mailto:nharding at extendthereach.com>

Visit SRC on the web at www.ExtendTheReach.com<http://www.extendthereach.com/>
See SRC in Action at www.DemographicsNow.com<http://www.demographicsnow.com/>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20080623/d41b1425/attachment.html


More information about the gdal-dev mailing list