Package org.goplanit.osm.defaults
Class OsmInfrastructureConfiguration
- java.lang.Object
-
- org.goplanit.osm.defaults.OsmInfrastructureConfiguration
-
- Direct Known Subclasses:
OsmHighwayTypeConfiguration,OsmRailwayTypeConfiguration
public class OsmInfrastructureConfiguration extends Object
Base class with common functionality for configuration OSM ways (highway/rail)- Author:
- markr
-
-
Field Summary
Fields Modifier and Type Field Description protected Set<String>activatedOsmTypesthe OSM types that are marked as supported OSM types, i.e., will be processed when parsingprotected Set<String>deactivatedOsmTypesthe OSM types that are marked as deactivate OSM types, i.e., will be ignored when parsing unless activated.protected StringosmWayKeyway key this configuration applies to
-
Constructor Summary
Constructors Modifier Constructor Description protectedOsmInfrastructureConfiguration(String osmWayKey)Default constructorOsmInfrastructureConfiguration(String osmWayKey, Set<String> activatedOsmTypes, Set<String> deactivatedOsmTypes)Construct with defaults being populated
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate(String... osmWayValues)Choose to add a given way value to be on top of the defaults, e.g.voidactivate(List<String> osmWayValues)Choose to add a given way value to be on top of the defaults, e.g.voidactivateAll()activate all types explicitlyvoiddeactivate(String osmWayValue)Choose to not parse the given combination of way subtype, e.g.voiddeactivateAll()deactivate all types explicitlybooleanisActivated(String osmWayValue)Verify if the passed in OSM way type is explicitly supported.booleanisDeactivated(String osmWayValue)Verify if the passed in OSM way type is explicitly unsupported.voidlogDeactivatedTypes()Log all de-activated OSM way typesSet<String>setOfActivatedTypes()create a copy of the currently supported way types in set formSet<String>setOfDeactivatedTypes()create a copy of the currently unsupported way types in set form
-
-
-
Field Detail
-
activatedOsmTypes
protected final Set<String> activatedOsmTypes
the OSM types that are marked as supported OSM types, i.e., will be processed when parsing
-
deactivatedOsmTypes
protected final Set<String> deactivatedOsmTypes
the OSM types that are marked as deactivate OSM types, i.e., will be ignored when parsing unless activated. This differs from unactivatableOsmTypes because deactivatesOsmTypes can in fact be activated whereas unactivatableOsmTypes cannot
-
osmWayKey
protected final String osmWayKey
way key this configuration applies to
-
-
Constructor Detail
-
OsmInfrastructureConfiguration
protected OsmInfrastructureConfiguration(String osmWayKey)
Default constructor- Parameters:
osmWayKey- to apply
-
-
Method Detail
-
logDeactivatedTypes
public void logDeactivatedTypes()
Log all de-activated OSM way types
-
isDeactivated
public boolean isDeactivated(String osmWayValue)
Verify if the passed in OSM way type is explicitly unsupported. Unsupported types will be ignored when processing ways.- Parameters:
osmWayValue- , e.g. primary, road- Returns:
- true when unSupported, false if not (which means it is either supported, or not registered)
-
isActivated
public boolean isActivated(String osmWayValue)
Verify if the passed in OSM way type is explicitly supported. Supported types will be processed and converted into link(segments).- Parameters:
osmWayValue- , e.g. primary- Returns:
- true when supported, false if not (which means it is unsupported, or not registered)
-
deactivate
public void deactivate(String osmWayValue)
Choose to not parse the given combination of way subtype, e.g. highway=road- Parameters:
osmWayValue- to use
-
activate
public void activate(String... osmWayValues)
Choose to add a given way value to be on top of the defaults, e.g. highway=road- Parameters:
osmWayValues- to activate
-
activate
public void activate(List<String> osmWayValues)
Choose to add a given way value to be on top of the defaults, e.g. highway=road- Parameters:
osmWayValues- to activate
-
setOfActivatedTypes
public Set<String> setOfActivatedTypes()
create a copy of the currently supported way types in set form- Returns:
- set of supported highway types, any modifications on this set have no impact on the instance internals
-
setOfDeactivatedTypes
public Set<String> setOfDeactivatedTypes()
create a copy of the currently unsupported way types in set form- Returns:
- set of supported highway types, any modifications on this set have no impact on the instance internals
-
deactivateAll
public void deactivateAll()
deactivate all types explicitly
-
activateAll
public void activateAll()
activate all types explicitly
-
-