uk.me.parabola.mkgmap.reader.osm
Class OsmMapDataSource

java.lang.Object
  extended by uk.me.parabola.mkgmap.reader.MapperBasedMapDataSource
      extended by uk.me.parabola.mkgmap.reader.osm.OsmMapDataSource
All Implemented Interfaces:
LoadableMapDataSource, MapDataSource, Configurable
Direct Known Subclasses:
Osm5MapDataSource, OsmBinMapDataSource

public abstract class OsmMapDataSource
extends MapperBasedMapDataSource
implements LoadableMapDataSource

Base class for OSM map sources. It exists so that more than one version of the api can be supported at a time.

Author:
Steve Ratcliffe

Field Summary
protected  ElementSaver elementSaver
           
protected  OsmReadingHooks osmReadingHooks
           
 
Fields inherited from class uk.me.parabola.mkgmap.reader.MapperBasedMapDataSource
mapper
 
Constructor Summary
OsmMapDataSource()
           
 
Method Summary
 java.lang.String[] copyrightMessages()
          There are no copyright messages in the OSM files themselves.
protected  void createElementSaver()
           
 OsmConverter getConverter()
           
 ElementSaver getElementSaver()
           
protected  OsmReadingHooks[] getPossibleHooks()
           
 java.util.Set<java.lang.String> getUsedTags()
           
 LevelInfo[] mapLevels()
          Get the maps levels to be used for the current map.
protected  OsmReadingHooks pluginChain(ElementSaver saver, EnhancedProperties props)
           
protected  void setStyle(Style style)
           
protected  void setupHandler(OsmHandler handler)
          Common code to setup the file handler.
 
Methods inherited from class uk.me.parabola.mkgmap.reader.MapperBasedMapDataSource
addBackground, addBackground, addBoundaryLine, config, 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.LoadableMapDataSource
isFileSupported, load
 
Methods inherited from interface uk.me.parabola.mkgmap.general.MapDataSource
getBounds, getLines, getOverviews, getPoints, getRoadNetwork, getShapes
 
Methods inherited from interface uk.me.parabola.util.Configurable
config
 

Field Detail

elementSaver

protected ElementSaver elementSaver

osmReadingHooks

protected OsmReadingHooks osmReadingHooks
Constructor Detail

OsmMapDataSource

public OsmMapDataSource()
Method Detail

mapLevels

public LevelInfo[] mapLevels()
Get the maps levels to be used for the current map. This can be specified in a number of ways in order:
  1. On the command line with the --levels flag. The format is a comma (or space) separated list of level/resolution pairs. Eg --levels=0:24,1:22,2:20 If the flag is given without an argument then the command line override is turned off for maps following that option.
  2. In the style options file. This works just like the command line option, but it applies whenever the given style is used and not overridden on the command line.
  3. A default setting.

I'd advise that new styles specify their own set of levels.

Specified by:
mapLevels in interface LoadableMapDataSource
Returns:
An array of level information, basically a [level,resolution] pair.

copyrightMessages

public java.lang.String[] copyrightMessages()
There are no copyright messages in the OSM files themselves. So we include a fixed set of strings on the assumption that .osm files are probably going to have the OSM copyright statements.

Specified by:
copyrightMessages in interface LoadableMapDataSource
Returns:
A list of copyright messages as a String array.

setStyle

protected void setStyle(Style style)

setupHandler

protected void setupHandler(OsmHandler handler)
Common code to setup the file handler.

Parameters:
handler - The file handler.

createElementSaver

protected void createElementSaver()

getElementSaver

public ElementSaver getElementSaver()

getPossibleHooks

protected OsmReadingHooks[] getPossibleHooks()

pluginChain

protected OsmReadingHooks pluginChain(ElementSaver saver,
                                      EnhancedProperties props)

getConverter

public OsmConverter getConverter()

getUsedTags

public java.util.Set<java.lang.String> getUsedTags()