Global Mapper v25.0

Consistency of output elevation grid coordinates

wtsullivan
wtsullivan Global Mapper UserTrusted User
edited June 2013 in Elevation Data
I would like more consistency of the coordinates chosen by Global Mapper in exported elevation files. I am aware of the option "Export: Snap export bounds to pixel boundaries if possible" (under Configure > General > Advanced) but this does not exactly achieve what I want.

I'm guessing that normally Global Mapper will select the exact min X and Y values from the loaded data, perhaps including any related vector data such as crop/feather layers, and set those as the lower left corner of the output grid. Ideally there would be an option to force the lower left corner of the export grid such that the boundaries of the grid cells will fall on multiples of the export cell resolutions. So if I'm exporting to a 5 meter grid, and the min values of my loaded data are (805073.0, 6154037.0), the lower left corner of my export grid would be forced to (805075.0, 6154035.0) with the center of the lower left grid cell being (805077.5, 6154037.5). The option might be called "Export: Snap grid cell edges to multiples of export cell resolution". For some purposes it might be desired to have the grid cell centers, rather than the boundaries, on multiples of resolution, in which case an alternate option might be "Export: Snap grid cell centers to multiples of export cell resolution".

This option would ensure that applying a similar workflow to varying input sources will result in output grids whose pixels all perfectly line up as long as the export resolution is the same. This is very important in the case of rerunning the same process with slightly different input data and needing the output grids not to shift between versions. The existing "snap to pixel boundary" option does not quite cater for this because it's referring to the input pixel boundaries. What is desired is a way to guarantee that all grids exported to the same resolution will line up perfectly no matter what the input data was. It would be great to have access to this option in scripts as well.

This would address the issue I've seen raised in other posts (i.e. http://www.globalmapperforum.com/forums/elevation-data/8432-mismatch-elevation-after-gridding-dem.html and possibly http://www.globalmapperforum.com/forums/elevation-data/8364-exported-dem-mismatch.html) where the same input data can produce slightly different output values with up to a half-pixel of shift. As a software user, I (and perhaps others) find these apparently unpredictable results quite frustrating and would love to have an option to remove the uncertainty.

Thanks!

Comments

  • global_mapper
    global_mapper Administrator
    edited March 2013
    Typically elevation files refer to the coordinates of the grid cell centers. By default the bounding box that you specify for an elevation grid cell export will refer to the bounds of the grid cell centers for the outer cells. So would it suffice simply to have a new option to snap the grid cell centers to the specified export cell resolution rather than needing 2 options?

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.bluemarblegeo.com/
  • global_mapper
    global_mapper Administrator
    edited March 2013
    I have added a new option in the Advanced section of the General tab of the Configuration dialog labeled 'Export: Snap Export Bounds to Nearest Spacing Boundary'. So if you check this and export with 0.5m resolution pixels, the output will start on an even 0.5m multiple boundary. I have placed a new build at http://www.bluemarblegeo.com/downloads/global-mapper/global_mapper14.zip with the latest changes for you to try. Simply download that file and extract the contents into your existing v14.xx installation folder to give it a try. If you are using the 64-bit v14 version there is a new build at http://www.bluemarblegeo.com/downloads/global-mapper/global_mapper14_64bit.zip .

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.bluemarblegeo.com/
  • wtsullivan
    wtsullivan Global Mapper User Trusted User
    edited March 2013
    Thanks for the response Mike. I tried your new build and it does as expected. I did notice though that with the option "Export: Snap Export Bounds to Pixel Boundary If Possible" also enabled, the grid cell centers are at multiples of the export resolution plus an offset for half the input data resolution. In other words both effects are being applied. It might be better to have these be mutually exclusive options to avoid confusion about where exactly the output cells will be.

    I would still be interested in an option to have the grid cell edges on multiples of the output resolution, meaning the grid cell centers would be halfway between multiples of the output resolution. Then I could select the one that's appropriate for my needs. (I am often processing tiled data where the boundaries of the input data are on exact kilometers of a projection, and I would like my output grids to line up with these boundaries, requiring the grid cell centers to be offset inside these boundaries by half the resolution.)
  • global_mapper
    global_mapper Administrator
    edited March 2013
    The snapping to pixel boundaries and multiples of the resolution do work against each other as in many cases only one can be true. In the (hopefully) near future we will be moving some of these specific export-only options to a location that is easier to find for export, at which point these options (along with potentially a new one for elevation exports) could be made some kind of mutually exclusive selection rather than just separate checkbox options.

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.bluemarblegeo.com/
  • wtsullivan
    wtsullivan Global Mapper User Trusted User
    edited June 2013
    wtsullivan wrote: »
    I would still be interested in an option to have the grid cell edges on multiples of the output resolution, meaning the grid cell centers would be halfway between multiples of the output resolution.

    Mike, I noticed (from another thread on a similar topic) that there is an option called "Terrain Export: Specify Bounds as Pixel is Area". On first glance this option combined with the "Export: Snap Bounds to Spacing Boundary" option would theoretically achieve what I described above - having the edges (not the centers) of the grid cells line up with multiples of the resolution. However in testing I could not actually get this to happen; the Pixel is Area option seemed to make no difference to the export.

    What's your understanding of how these two options would interact with each other if they are both enabled?

    Are you still intending to have some of these options in a new Grid Export interface? What about having these options for grids generated by Global Mapper as a new layer (i.e. grid from vector data, terrain layer comparison, or watershed flow accumulation)?
  • global_mapper
    global_mapper Administrator
    edited June 2013
    The option to specify the elevation bounds as "pixel is area" should mean that elevation export bounds behave like imagery export bounds, so what you are specifying is the coordinates of the outer edge of the cell and not the center of the cell. Then if you also check to snap the bounds to a spacing boundary then that outer edge should be snapped to the nearest boundary in the specified spacing.

    I just looked at the export code that handles this and the snapping to bounds should happen after the bounds are interpreted as the grid cell edge of center, so if you provide the same numerical bounds there would be a half-spacing shift depending on whether that option was checked or not. The default bounds filled in should adjust themselves to this setting though so if you don't change anything you get the same results either way, you would just see the bounds displayed differently. And if you have snapping enabled that could adjust things depending on where the nearest snap boundary is.

    Once all of these options related to the automatic adjustment of the output bounds are on their own tab it should be easy to add them wherever they are applicable.

    Thanks,

    Mike
    Global Mapper Guru
    geohelp@bluemarblegeo.com
    Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation