DTED tile extents, Global Mapper Application vs SDK?

jkenneallyjkenneally Global Mapper UserPosts: 53Trusted User
edited April 2014 in SDK
Hello,

I just encountered a bit of a strange elevation data loading situation that I assume is related to 'pixel as point' vs 'pixel as area', but I was hoping to get some clarification/guidance.

I have a *.DT1 tile that I'm trying to read from. When I load it normally through the Global Mapper application, the meta data window (from overlay control centre dialog) gives me a pixel width/height of 1201/1201, and extents on even degree boundaries, with min_lat, min_lon, max_lat, max_lon of 30.00000, -109.00000, 31.00000, -108.00000 respectively.

This is what I was expecting, and makes sense as a 'pixel centre is sample' format, whereas tiles overlap on degree boundaries (i.e. similar to the NASA SRTM data).

However, when I load the same tile through the Global Mapper API, and query the layer returned through GM_GetLayerInfo(), the returned extents through GM_LayerInfo_t::mGlobalRect are 29.999583333333334, -109.00041666666667, 31.000416666666666, -107.99958333333333. This gives a total tile extents of 1.0008333333333326.

I guess I'm looking for some clarification as to why the SDK and Application are reporting the data extents differently, and how I should interpret the data in code to ensure I am getting accurate elevation samples for a given coordinate.

Thanks!

Comments

  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited April 2014
    The SDK is reporting the displayed extents (outer edge of grid cells) for all layers, both raster and elevation, whereas the pretty display of metadata in the application shows the coordinates of the grid cell centers for terrain layers. The formatted metadata list is also available in the SDK in the GM_LayerInfo_t structure so you can use that if you want the grid cell center values.

    The mGlobalBounds in the SDK is set up to allow easy intersection to see if a layer is on-screen at all. If it was the pixel center values you would have to add the extra half spacing on to each edge manually to do an intersection test that included the outer half-pixel of rendered grid.

    Thanks,

    Mike
    Global Mapper Guru
    geohelp@bluemarblegeo.com
    Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation
  • jkenneallyjkenneally Global Mapper User Posts: 53Trusted User
    edited April 2014
    Ok, that makes sense, thanks for the quick explanation.

    So I can assume this is always the case? If so I will just stick with using the global rect for simplicity and apply my own half pixel adjustments to reported extents, given that I prefer to work with pixel centre/sample points within my project.
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited April 2014
    Yes for all layers the reported bounds will be the as-displayed bounds for the layer, so around the outside edge of the outer pixels. So for elevation grid layers you can subtract half a pixel spacing to get the data bounds.

    Thanks,

    Mike
    Global Mapper Guru
    geohelp@bluemarblegeo.com
    Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation
Sign In or Register to comment.