Generated Elevation grid cells offset from projection grid

JakeJake Global Mapper UserPosts: 276Trusted User
edited June 2013 in Elevation Data
I was wondering if there was a reason why the Generated Elevation grid cells are all offset from the graticule (Marcator).

Attached you will see the 1km x 1km graticule and two individual 1km cells plus the elevation points. A zoomed version of one cell is attached. As you can see the individual cells are offset 350 m from a multiple of 1000m in Y and 10m in X. This is consistent across the entire grid.

The generated elevation grid has a pixel width of 1000 m x 1000 m. See attached metadata.
The depths are from a CSV file in lat/long and remain geographic. Depth units are in metres.
The workspace projection is Mercator (scaling lat 45N). As is the elevation grid layer.
The graticule display was set to "Current Projection Grid | Custom | 1000 ground units".
The graticule lines up perfectly at a multiple of 1000 m in X and Y.
The Elevation Grid Creation Options are attached below.


elevation_grid_options.png elevation_cell_meta.pngelevation_cell_offset.pngelevation_cell_offset_zoom.png

Comments

  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited June 2013
    Your Grid Bounds aren't set to line up with the graticule, so your 1000 meter apart samples are based on a top-left coordinate that is not a multiple of 1000 meters. If you change that on the Grid Bounds tab when you export then they should line up. Since the originals were lat/lon values when reprojected to Mercator they could end up aligned to anything.

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    Global Mapper
  • JakeJake Global Mapper User Posts: 276Trusted User
    edited June 2013
    OK thanks. I assumed the grid corner value would be based on the workspace coordinate system not the source coordinate system since it produces the grid on the workspace system.

    Also, are you saying that if the depths are in Mercator and the top-left value is not a multiple of 1000 m all the cells will still be offset from the grid?
  • JakeJake Global Mapper User Posts: 276Trusted User
    edited June 2013
    OK I can confirm that indeed the elevation grid will be offset from the projection grid when using projected coordinates. This seems unusual since most grids I have seen don't have the cell corners expressed in fractional values. This would also mean that the cells from different datasets will have offsets despite having the same cell size and projection.

    I realize I can force the grid bounds to specific corner values but that means manually calculating the next integer cell corner and editing the North, West, South and East values.
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited June 2013
    There is no requirement that the grid cells line up on a multiple of the spacing, although that is common. If you don't reproject or clip they will stay on the original boundaries, but once you reproject the size and alignment of the cells could be any non-whole numbers.

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    Global Mapper
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited June 2013
    Also note that a cell center that is on some grid boundary in one projection would have to actually be moved on the earth to line up with some fixed grid cell boundary in another projection. If you are projecting a single point at a time the grid values should retain their exact same location on the earth as the original samples in their native projection so as not to lose any position information.

    Of course if you export a grid instead of individual points whatever grid you defined is used and the source data is resampled from whatever collection of input files in whatever their native projections are to the target output projection system and grid definition. The default settings for all of those is to export to the smallest bounding box which incorporates all of the input data boxes (after reprojection) and maintain the full resolution of the most detailed layer. You can of course change the defaults though if you require a particular alignment.

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    Global Mapper
  • JakeJake Global Mapper User Posts: 276Trusted User
    edited June 2013
    It would be a nice option to have. Under Grid Options | Grid Spacing, a toggle or check box (align to GRID or align to TOP-LEFT). That would eliminate the many error-prone edits required otherwise in the Grid Bounds tab.
  • JakeJake Global Mapper User Posts: 276Trusted User
    edited June 2013
    I can add this feature request via the appropriate forum or you can lift it from here.

    Also, I noticed some elevations points do not have a cell at all. Any reason for that? So far I have found 4 or 5 points that did not produce a cell. At first I thought it was the min/max ones but that is not the case in the one attached.

    elevation_cell_missing.png
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited June 2013
    I think the issue with the grid cells may be the tightness. It is so tight that the threshold ends up being a fraction of a cell so if the point sample is more than that tightness fraction from any cell center no cell is created. Just bump it up a tiny notch and you should get cells for every point.

    For the alignment, I forgot there already is an option in the Advanced section of the General tab of the Configuration dialog labeled 'Export: Snap Export Bounds to Nearest Spacing Boundary'. That option should give you what you want.

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    Global Mapper
  • JakeJake Global Mapper User Posts: 276Trusted User
    edited June 2013
    RE: Advanced section.

    Bingo that was it. I saw that option earlier but thought it only applied to exported ASCII data sets and not the grid layers.

    The only caveat is that the cell centroid is snapped not the corner. (edit I think I found that option too).

    Regarding the tightness I will try a few things but that is not critical at this point.

  • JakeJake Global Mapper User Posts: 276Trusted User
    edited June 2013
    The only caveat is that the cell centroid is snapped not the corner

    Regarding cell justification. I tried to enable the Advanced Option "Export: Snap Export Bounds to Pixel Boundary if Possible" so that the cells are top-left justified but it still anchors to the cell centroid. I am Ok leaving them cetre justified but if there is that option I may take advantage of it in the future.
    elevation_cell_offset_snap.png
  • JakeJake Global Mapper User Posts: 276Trusted User
    edited June 2013
    Ok I discovered an older thread talking about pixel-is-point versus pixel-is-area. Along with the Advanced Option, Terrain Export: Specify Bounds as Pixel is Area.

    I will take some time to digest all this and if I have any follow Q's I will post here.
Sign In or Register to comment.