uk.me.parabola.mkgmap.general
Class MapDetails

java.lang.Object
  extended by uk.me.parabola.mkgmap.general.MapDetails
All Implemented Interfaces:
MapCollector, MapDataSource

public class MapDetails
extends java.lang.Object
implements MapCollector, MapDataSource

The map features that we are going to map are collected here.

Author:
Steve Ratcliffe

Constructor Summary
MapDetails()
           
 
Method Summary
 void addLine(MapLine line)
          Add a line to the map.
 void addPoint(MapPoint point)
          Add a point to the map.
 void addRestriction(CoordNode fromNode, CoordNode toNode, CoordNode viaNode, byte exceptMask)
          Add a routing restriction to the map.
 void addRoad(MapRoad road)
          For adding a road.
 void addShape(MapShape shape)
          Add the given shape (polygon) to the map.
 void addThroughRoute(long junctionNodeId, long roadIdA, long roadIdB)
          Add a through route to the map.
 void addToBounds(Coord p)
          Add the given point to the total bounds for the map.
 void config(EnhancedProperties props)
           
 Area getBounds()
          Get the bounds of this map.
 java.util.List<MapLine> getLines()
          Get all the lines for this map.
 java.util.List<Overview> getOverviews()
          Get the overviews.
 java.util.List<MapPoint> getPoints()
          Get the list of points that need to be rendered on the map.
 RoadNetwork getRoadNetwork()
          Get the high level view of the road network.
 java.util.List<MapShape> getShapes()
          Get the list of shapes that need to be rendered to the map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapDetails

public MapDetails()
Method Detail

config

public void config(EnhancedProperties props)

addPoint

public void addPoint(MapPoint point)
Add a point to the map.

Specified by:
addPoint in interface MapCollector
Parameters:
point - Point to add.

addLine

public void addLine(MapLine line)
Add a line to the map.

Specified by:
addLine in interface MapCollector
Parameters:
line - The line information.

addShape

public void addShape(MapShape shape)
Add the given shape (polygon) to the map. A shape is very similar to a line but they are separate because they need to be put in different sections in the output map.

Specified by:
addShape in interface MapCollector
Parameters:
shape - The polygon to add.

addRoad

public void addRoad(MapRoad road)
Description copied from interface: MapCollector
For adding a road. Although a road is a kind of line, it is treated differently so that we can join up roads that are split into several segments and to do routing etc.

Specified by:
addRoad in interface MapCollector

addRestriction

public void addRestriction(CoordNode fromNode,
                           CoordNode toNode,
                           CoordNode viaNode,
                           byte exceptMask)
Description copied from interface: MapCollector
Add a routing restriction to the map. This is something such as no left turn.

Specified by:
addRestriction in interface MapCollector
exceptMask - For exceptions eg. no-left-turn except for buses.

addThroughRoute

public void addThroughRoute(long junctionNodeId,
                            long roadIdA,
                            long roadIdB)
Description copied from interface: MapCollector
Add a through route to the map.

Specified by:
addThroughRoute in interface MapCollector

addToBounds

public void addToBounds(Coord p)
Add the given point to the total bounds for the map.

Specified by:
addToBounds in interface MapCollector
Parameters:
p - The coordinates of the point to add.

getBounds

public Area getBounds()
Get the bounds of this map.

Specified by:
getBounds in interface MapDataSource
Returns:
An area covering all the points in the map.

getPoints

public java.util.List<MapPoint> getPoints()
Description copied from interface: MapDataSource
Get the list of points that need to be rendered on the map.

Specified by:
getPoints in interface MapDataSource
Returns:
A list of MapPoint objects.

getLines

public java.util.List<MapLine> getLines()
Get all the lines for this map.

Specified by:
getLines in interface MapDataSource
Returns:
A list of all lines defined for this map.

getShapes

public java.util.List<MapShape> getShapes()
Description copied from interface: MapDataSource
Get the list of shapes that need to be rendered to the map.

Specified by:
getShapes in interface MapDataSource
Returns:
A list of MapShape objects.

getRoadNetwork

public RoadNetwork getRoadNetwork()
Description copied from interface: MapDataSource
Get the high level view of the road network. This is used to write the net and nod sections. Note that information from the net section is needed to write the RGN section if routing is wanted.

Specified by:
getRoadNetwork in interface MapDataSource
Returns:
A RoadNetwork object with all the connections between roads. If this returns null, then the NET and NOD sections should not be written.

getOverviews

public java.util.List<Overview> getOverviews()
Get the overviews. We construct them at this point from the information that we have built up. Perhaps this could be a separate class rather than a list.

Specified by:
getOverviews in interface MapDataSource
Returns:
A list of overviews.