uk.me.parabola.mkgmap.reader.test
Class ElementTestDataSource

java.lang.Object
  extended by uk.me.parabola.mkgmap.reader.MapperBasedMapDataSource
      extended by uk.me.parabola.mkgmap.reader.test.ElementTestDataSource
All Implemented Interfaces:
LoadableMapDataSource, MapDataSource, Configurable

public class ElementTestDataSource
extends MapperBasedMapDataSource
implements LoadableMapDataSource

This is a map data source that just generates maps without reference to any external data.

Author:
Steve Ratcliffe

Field Summary
 
Fields inherited from class uk.me.parabola.mkgmap.reader.MapperBasedMapDataSource
mapper
 
Constructor Summary
ElementTestDataSource()
           
 
Method Summary
 void config(EnhancedProperties props)
          Used to mark that a reader needs to be configured by command line properties.
 java.lang.String[] copyrightMessages()
          Get a suitable copyright message for this map source.
 boolean isFileSupported(java.lang.String name)
          'Filenames' that are supported begin with test-map:
 void load(java.lang.String name)
          Load a map by generating it in code.
 LevelInfo[] mapLevels()
          Get the map levels for this map.
 
Methods inherited from class uk.me.parabola.mkgmap.reader.MapperBasedMapDataSource
addBackground, addBackground, addBoundaryLine, getBounds, getConfig, getLines, getMapper, getOverviews, getPoints, getRoadNetwork, getShapes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface uk.me.parabola.mkgmap.general.MapDataSource
getBounds, getLines, getOverviews, getPoints, getRoadNetwork, getShapes
 

Constructor Detail

ElementTestDataSource

public ElementTestDataSource()
Method Detail

isFileSupported

public boolean isFileSupported(java.lang.String name)
'Filenames' that are supported begin with test-map:

Specified by:
isFileSupported in interface LoadableMapDataSource
Parameters:
name - The name to check.
Returns:
True If a recognised test name beginning with test-map:

load

public void load(java.lang.String name)
          throws java.io.FileNotFoundException
Load a map by generating it in code.

Specified by:
load in interface LoadableMapDataSource
Parameters:
name - The name of the map to generate.
Throws:
java.io.FileNotFoundException - If the name is not recognised.

mapLevels

public LevelInfo[] mapLevels()
Description copied from interface: LoadableMapDataSource
Get the map levels for this map. This is an array of @{link LevelInfo} structures that map a level to a resolution. Some map data sources may actually have the concept of map layers that can be used to construct this information. Others may just have to provide a default that is useful with the map source. In the latter case it would be important to be able to configure the levels separately while creating the map.

Note that it does not include the top empty level as we will always generate that in the main program automatically.

Specified by:
mapLevels in interface LoadableMapDataSource
Returns:
Array of structures that map the level to the resolution. Never returns null. Some kind of default should always be returned and this must include at least one level.

copyrightMessages

public java.lang.String[] copyrightMessages()
Description copied from interface: LoadableMapDataSource
Get a suitable copyright message for this map source. You can get this information from the input file, if the file has such information or as in the case of OSM the data has a well known copyright, so we can return fixed strings referring to it.

Specified by:
copyrightMessages in interface LoadableMapDataSource
Returns:
An array of strings with copyright information. If there are none then return a zero length array.

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
Overrides:
config in class MapperBasedMapDataSource
Parameters:
props - The input properties.