uk.me.parabola.mkgmap.reader
Class MapperBasedMapDataSource

java.lang.Object
  extended by uk.me.parabola.mkgmap.reader.MapperBasedMapDataSource
All Implemented Interfaces:
MapDataSource, Configurable
Direct Known Subclasses:
ElementTestDataSource, OsmMapDataSource, OverviewMapDataSource, PolishMapDataSource

public abstract class MapperBasedMapDataSource
extends java.lang.Object
implements MapDataSource, Configurable

A convenient base class for all map data that is based on the MapDetails class (which is all of them so far).

Author:
Steve Ratcliffe

Field Summary
protected  MapDetails mapper
           
 
Constructor Summary
MapperBasedMapDataSource()
           
 
Method Summary
protected  void addBackground()
          We add the background polygons if the map is not transparent.
protected  void addBackground(boolean mapHasPolygon4B)
           
 void addBoundaryLine(Area area, int type, java.lang.String name)
           
 void config(EnhancedProperties props)
          Used to mark that a reader needs to be configured by command line properties.
 Area getBounds()
          Get the area that this map covers.
protected  EnhancedProperties getConfig()
           
 java.util.List<MapLine> getLines()
          Get the list of lines that need to be rendered to the map.
 MapDetails getMapper()
           
 java.util.List<Overview> getOverviews()
          Get a list of every feature that is used in the map.
 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
 

Field Detail

mapper

protected final MapDetails mapper
Constructor Detail

MapperBasedMapDataSource

public MapperBasedMapDataSource()
Method Detail

getBounds

public Area getBounds()
Get the area that this map covers. Delegates to the map collector.

Specified by:
getBounds in interface MapDataSource
Returns:
The area the map covers.

getLines

public java.util.List<MapLine> getLines()
Get the list of lines that need to be rendered to the map. Delegates to the map collector.

Specified by:
getLines in interface MapDataSource
Returns:
A list of MapLine objects.

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 a list of every feature that is used in the map. As features are created a list is kept of each separate feature that is used. This goes into the .img file and is important for points and polygons although it doesn't seem to matter if lines are represented or not on my Legend Cx anyway.

Specified by:
getOverviews in interface MapDataSource
Returns:
A list of all the types of point, polygon and polyline that are used 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.

config

public void config(EnhancedProperties props)
Description copied from interface: Configurable
Used to mark that a reader needs to be configured by command line properties. The MapReader will be given the command line properties that were set before it is asked to load the map.

Specified by:
config in interface Configurable
Parameters:
props - The input properties.

getConfig

protected EnhancedProperties getConfig()

getMapper

public MapDetails getMapper()

addBackground

protected void addBackground()
We add the background polygons if the map is not transparent.


addBackground

protected void addBackground(boolean mapHasPolygon4B)

addBoundaryLine

public void addBoundaryLine(Area area,
                            int type,
                            java.lang.String name)