User Tools

Site Tools


api:dk11:net:tatukgis.ndk.tgis_isochronemap

TGIS_IsochroneMap class

DK11 for .NET | TatukGIS.NDK.TGIS_IsochroneMap | Classes | Constructors | Methods | Properties

Network analysis tool for creating isochrone maps - for a given point finds the network area reachable within a given maximum network traversing cost.

Available also on: Delphi | Java | ActiveX.

Syntax

// C#
public class TGIS_IsochroneMap : TGIS_BaseObjectDisposable
{
}
' VisualBasic
Public Class TGIS_IsochroneMap
  Inherits TGIS_BaseObjectDisposable
End Class
// Oxygene
type
  TGIS_IsochroneMap = public class( TGIS_BaseObjectDisposable )
  end;

Inheritance

→ TGIS_BaseObjectDisposable

Constructors

Inherited Overrides Protected
Name Visibility Description
TGIS_IsochroneMap() public Creates an instance.
TGIS_IsochroneMap(IGIS_Viewer) public Creates an instance.

Methods

Inherited Overrides Protected
Name Visibility Description
Generate public Finds the network area reachable within a given cost and outputs the result to the destination layer as shape(s).

Properties

Inherited Protected
Name Visibility Description
OutputCostFieldName public Specifies the name of the attribute field which will be added to the destination layer.

Remarks

For general information about isochrone maps see this article on Wikipedia.

TGIS_IsochroneMap uses topological network (TGIS_Network) for calculations (the same as TGIS_ShortestPath). If the network is not available for the analyzed layer then it will be created automatically. Depending on the size of the layer it may be a prolonged operation. Once created the network is saved into a set of files and can be reused.

The creation of an isochrone map can also be a time consuming operation for large and complicated networks and/or relatively big traversing cost.

Sample results from isochrone analyses:

Points Arcs Polygons Interpolation (splines)

Steps to achieve:

  • Points
    1. Use Generate() with TGIS_ShapePoint as the output type
    2. Colorize the layer by the cost field (GIS_COST by default)
  • Arcs
    1. Use Generate() with TGIS_ShapeArc as the output type
    2. Colorize the layer by the cost field (GIS_COST by default)
  • Polygons
    1. Use Generate() with TGIS_ShapePolygon as the output type
    2. Repeat above desired number of times decreasing the cost each time
    3. Colorize the layer by the cost field (GIS_COST by default)
  • Interpolation
    1. Use Generate() with TGIS_ShapePoint as an output type
    2. Use TGIS_InterpolationSplines to genearte interpolated grid layer
    3. Colorize the grid layer

Example

C#

// GIS is TGIS_ViewerWnd
 
// simple LinkCostEvent handler which uses shape length as the network cost
private void doLinkCostEvent( Object _sender, TGIS_LinkCostEventArgs _e )
{
  if( _e.Shape.Layer.CS is TGIS_CSUnknownCoordinateSystem )
  {
    _e.Cost = _e.Shape.Length() ;
  }
  else
  {
    _e.Cost = _e.Shape.LengthCS() ;
  }
  _e.RevCost = _e.Cost ;
}
 
public void MakeIsochroneMap( TGIS_Point _pt )
{
  // get a layer for which an isochrone map will be created
  TGIS_LayerVector ls = (TGIS_LayerVector)GIS.Get( "Roads" ) ;
 
  // create a layer to store the isochrone map on
  TGIS_LayerVector lr = new TGIS_LayerVector() ;
  lr.Name = "Isochrone map for Roads" ;
  lr.CS = ls.CS ;
  lr.Open() ;
 
  // maximum traversing cost for the isochrone map
  double cst = 10.0 ;  
 
  TGIS_ShortestPath sp = new TGIS_ShortestPath( GIS ) ;
  sp.LinkCostEvent += doLinkCostEvent ;
 
  TGIS_IsochroneMap im = new TGIS_IsochroneMap( GIS ) ;
  // generate the isochrone map
  im.Generate( ls, sp, lr, TGIS_ShapeType.Arc, _pt, cst, 0 ) ;
 
  // add the layer with the isochrone map to the viewer
  GIS.Add( lr ) ;  
  // and update
  GIS.InvalidateWholeMap() ;
}

References

2019/08/13 10:53