griddist_zonal - ObjectVision/GeoDMS GitHub Wiki

Grid functions griddist_zonal

The griddist_zonal function calculates grid-based distances with additional impedance penalties when crossing zone boundaries.

syntax

griddist_zonal(impedanceGrid: raster->Float, pointset_raster_rel: pointset->raster, zoneGrid: raster->UInt16, zoneBarrier: Float)
griddist_zonal(impedanceGrid: raster->Float, pointset_raster_rel: pointset->raster, zoneGrid: raster->UInt16, zoneBarrier: Float, startvalues: pointset->Float)

Additional variants:

  • griddist_zonal_maximp - with maximum impedance cutoff
  • griddist_zonal_untiled - non-tiled variant
  • griddist_zonal_latitude_specific - accounts for latitude-dependent cell sizes
  • Combinations of the above suffixes

definition

Similar to Griddist, but with additional zonal boundary handling. When the shortest path crosses from one zone to another (cells with different zoneGrid values), an extra impedance penalty (zoneBarrier) is added.

arguments

argument description type
impedanceGrid Impedance value for each cell (non-negative) raster->Float
pointset_raster_rel Relation from points to raster cells pointset->raster
zoneGrid Zone identifier for each cell raster->UInt16
zoneBarrier Extra impedance added when crossing zone boundaries Float
startvalues (optional) Initial impedance values at start points pointset->Float

performance

The algorithm uses Dijkstra's shortest path algorithm with zone boundary checking. Complexity is O(n × log n) where n is the number of grid cells.

The zone boundary check adds minimal overhead as it only compares adjacent cell zone values during path expansion.

conditions

  • impedanceGrid values must be non-negative
  • zoneBarrier must be non-negative
  • Value types of impedanceGrid, zoneBarrier, and startvalues must be compatible Float types

use cases

  • Transportation modeling where crossing administrative boundaries incurs extra costs
  • Ecological modeling where habitat patches have different traversal resistance
  • Market analysis where service areas span multiple jurisdictions

example

attribute<Float64> travel_time (GridDomain) := griddist_zonal(
    travel_cost,
    destination/GridDomain_rel,
    municipality_grid,
    60.0  // 60 seconds penalty at municipal boundaries
);

see also

since version

5.85

⚠️ **GitHub.com Fallback** ⚠️