uk.me.parabola.mkgmap.osmstyle
Class StyleImpl

java.lang.Object
  extended by uk.me.parabola.mkgmap.osmstyle.StyleImpl
All Implemented Interfaces:
Style

public class StyleImpl
extends java.lang.Object
implements Style

A style is a collection of files that describe the mapping between the OSM features and the garmin features. This file reads in those files and provides methods for using the information. The files are either contained in a directory, in a package or in a zip'ed file.

Author:
Steve Ratcliffe

Constructor Summary
StyleImpl(java.lang.String loc, java.lang.String name)
          Create a style from the given location and name.
 
Method Summary
 void applyOptionOverride(java.util.Properties config)
          After the style is loaded we override any options that might have been set in the style itself with the command line options.
 StyleInfo getInfo()
           
 Rule getLineRules()
          Get the rules that apply to lines.
 java.lang.String[] getNameTagList()
           
 Rule getNodeRules()
          Get the rules that apply to nodes.
 java.lang.String getOption(java.lang.String name)
           
 LineAdder getOverlays(LineAdder lineAdder)
          Get the overlay definitions.
 Rule getPolygonRules()
          Get the rules that apply to polygons.
 Rule getRelationRules()
          Get the relation rules.
 java.util.Set<java.lang.String> getUsedTags()
          Get the tags that are used by this style.
 Rule getWayRules()
          Get the rules that apply to ways.
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StyleImpl

public StyleImpl(java.lang.String loc,
                 java.lang.String name)
          throws java.io.FileNotFoundException
Create a style from the given location and name.

Parameters:
loc - The location of the style. Can be null to mean just check the classpath.
name - The name. Can be null if the location isn't. If it is null then we just check for the first version file that can be found.
Throws:
java.io.FileNotFoundException - If the file doesn't exist. This can include the version file being missing.
Method Detail

getNameTagList

public java.lang.String[] getNameTagList()
Specified by:
getNameTagList in interface Style

getOption

public java.lang.String getOption(java.lang.String name)
Specified by:
getOption in interface Style

getInfo

public StyleInfo getInfo()
Specified by:
getInfo in interface Style

applyOptionOverride

public void applyOptionOverride(java.util.Properties config)
After the style is loaded we override any options that might have been set in the style itself with the command line options. We may have to filter some options that we don't ever want to set on the command line.

Specified by:
applyOptionOverride in interface Style
Parameters:
config - The command line options.

getNodeRules

public Rule getNodeRules()
Description copied from interface: Style
Get the rules that apply to nodes.

Specified by:
getNodeRules in interface Style

getWayRules

public Rule getWayRules()
Description copied from interface: Style
Get the rules that apply to ways. This includes lines and polygons as they are not separate primitives in osm. It is a merge of the line rules and the polygon rules.

Specified by:
getWayRules in interface Style

getLineRules

public Rule getLineRules()
Description copied from interface: Style
Get the rules that apply to lines.

Specified by:
getLineRules in interface Style

getPolygonRules

public Rule getPolygonRules()
Description copied from interface: Style
Get the rules that apply to polygons.

Specified by:
getPolygonRules in interface Style

getRelationRules

public Rule getRelationRules()
Description copied from interface: Style
Get the relation rules.

Specified by:
getRelationRules in interface Style

getOverlays

public LineAdder getOverlays(LineAdder lineAdder)
Description copied from interface: Style
Get the overlay definitions. Most styles will not use this.

Specified by:
getOverlays in interface Style

getUsedTags

public java.util.Set<java.lang.String> getUsedTags()
Description copied from interface: Style
Get the tags that are used by this style.

Specified by:
getUsedTags in interface Style

main

public static void main(java.lang.String[] args)
                 throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException