Class OsmZoningReaderOsmData
- java.lang.Object
-
- org.goplanit.osm.converter.zoning.OsmZoningReaderOsmData
-
public class OsmZoningReaderOsmData extends Object
Data specifically required in the zoning reader while parsing OSM data- Author:
- markr
-
-
Constructor Summary
Constructors Constructor Description OsmZoningReaderOsmData()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addIgnoreStopAreaStopPosition(de.topobyte.osm4j.core.model.iface.EntityType type, long osmId)
add identified OSM entity to be ignored if it pops up as a stop_area stop_position.de.topobyte.osm4j.core.model.iface.OsmWay
addOsmRelationOuterRoleOsmWay(de.topobyte.osm4j.core.model.iface.OsmWay osmWay)
Add OSM way to keep.void
addUnprocessedPtv1FerryTerminal(de.topobyte.osm4j.core.model.iface.OsmEntity osmEntity)
add unprocessed ferry terminalvoid
addUnprocessedPtv1Station(de.topobyte.osm4j.core.model.iface.OsmEntity osmEntity)
add unprocessed ptv1 stationvoid
addUnprocessedPtv2Station(de.topobyte.osm4j.core.model.iface.OsmEntity osmEntity)
add unprocessed ptv2 stationvoid
addUnprocessedStopPosition(de.topobyte.osm4j.core.model.iface.OsmNode osmNode)
add unprocessed stop positionvoid
addWaitingAreaWithoutMappedPlanitMode(de.topobyte.osm4j.core.model.iface.EntityType type, long osmId)
Add identified OSM entity as valid waiting area (platform, pole), but it has no mapped PLANit mode, e.g.long
getNumberOfOuterRoleOsmWays()
collect number of oter role osm ways that we keptsOsmNodeData
getOsmNodeData()
Access to OSM node datade.topobyte.osm4j.core.model.iface.OsmWay
getOuterRoleOsmWay(long osmWayId)
collect an unprocessed osm way that is identified as an outer role that is eligible as a platform/transfer zonede.topobyte.osm4j.core.model.iface.OsmNode
getUnprocessedPtv1FerryTerminal(long osmId)
Collect an unprocessed ferry terminal if it existsSortedMap<Long,de.topobyte.osm4j.core.model.iface.OsmNode>
getUnprocessedPtv1FerryTerminals()
collect the ferry terminal that have been identified but not processed yet (unmodifiable)SortedMap<Long,de.topobyte.osm4j.core.model.iface.OsmEntity>
getUnprocessedPtv1Stations(de.topobyte.osm4j.core.model.iface.EntityType entityType)
collect the Ptv1 stations that have been identified but not processed yet (unmodifiable)SortedMap<Long,de.topobyte.osm4j.core.model.iface.OsmEntity>
getUnprocessedPtv2Stations(de.topobyte.osm4j.core.model.iface.EntityType entityType)
collect unprocces ptv2 stations (unmodifiable)Pair<OsmPtVersionScheme,de.topobyte.osm4j.core.model.iface.OsmEntity>
getUnprocessedStation(de.topobyte.osm4j.core.model.iface.EntityType entityType, long osmId)
Collect an unprocessed station if it existsSortedMap<Long,de.topobyte.osm4j.core.model.iface.OsmNode>
getUnprocessedStopPositions()
collect unprocessed stop positionsboolean
hasOsmRelationOuterRoleOsmWays()
check if outer role marked osm ways existboolean
hasOuterRoleOsmWay(long osmWayId)
Verify if osm way id is registered that qualifies as an outer role on that relationboolean
hasUnprocessedPtv1FerryTerminal(long osmId)
Verify existence of an unprocessed ferry terminalboolean
hasUnprocessedStopPosition(long osmId)
Verify if unprocessed stop_position is registeredboolean
isIgnoreStopAreaStopPosition(de.topobyte.osm4j.core.model.iface.EntityType type, long osmId)
Verify if marked as to be ignoredboolean
isWaitingAreaWithoutMappedPlanitMode(de.topobyte.osm4j.core.model.iface.EntityType type, long osmId)
Verify if marked as waiting area without a mapped planit modevoid
markOsmRelationOuterRoleOsmWayToKeep(long osmWayId)
mark an osm way to be kept even if it is not recognised as as valid PT supporting way.void
removeAllUnproccessedStations(OsmPtVersionScheme ptVersion)
Remove all unprocessed station of a particular pt version that are currently still registeredvoid
removeAllUnproccessedStations(OsmPtVersionScheme ptVersion, de.topobyte.osm4j.core.model.iface.EntityType type)
Remove all unprocessed station of a particular pt version and type that are currently still registeredvoid
removeAllUnprocessedPtv1FerryTerminals()
Remove all unprocessed ferry terminalsvoid
removeOsmRelationOuterRoleOsmWay(long osmWayId)
Remove marked entry for keepingvoid
removeUnproccessedStation(OsmPtVersionScheme ptVersion, de.topobyte.osm4j.core.model.iface.OsmEntity osmEntity)
remove an unprocessed stationvoid
removeUnprocessedPtv1FerryTerminal(long osmId)
remove unprocessed ferry terminalvoid
removeUnprocessedStopPosition(long osmId)
remove unprocessed stop positionvoid
reset()
reset the handlerboolean
shouldOsmRelationOuterRoleOsmWayBeKept(de.topobyte.osm4j.core.model.iface.OsmWay osmWay)
verify if the passed in OSM way should be kept (even if it is not converted to a PLANit link based on its current tags
-
-
-
Method Detail
-
getOsmNodeData
public OsmNodeData getOsmNodeData()
Access to OSM node data- Returns:
- OSM node data
-
getUnprocessedStation
public Pair<OsmPtVersionScheme,de.topobyte.osm4j.core.model.iface.OsmEntity> getUnprocessedStation(de.topobyte.osm4j.core.model.iface.EntityType entityType, long osmId)
Collect an unprocessed station if it exists- Parameters:
entityType
- to collect forosmId
- id to collect for- Returns:
- pair of version and unprocessed station, null otherwise
-
getUnprocessedPtv1FerryTerminal
public de.topobyte.osm4j.core.model.iface.OsmNode getUnprocessedPtv1FerryTerminal(long osmId)
Collect an unprocessed ferry terminal if it exists- Parameters:
osmId
- id to collect for- Returns:
- unprocessed ferry terminal found, null otherwise
-
hasUnprocessedPtv1FerryTerminal
public boolean hasUnprocessedPtv1FerryTerminal(long osmId)
Verify existence of an unprocessed ferry terminal- Parameters:
osmId
- id to collect for- Returns:
- true when unprocessed ferry terminal exists, false otherwise
-
getUnprocessedPtv1Stations
public SortedMap<Long,de.topobyte.osm4j.core.model.iface.OsmEntity> getUnprocessedPtv1Stations(de.topobyte.osm4j.core.model.iface.EntityType entityType)
collect the Ptv1 stations that have been identified but not processed yet (unmodifiable)- Parameters:
entityType
- to collect them for- Returns:
- unprocessed ptv1 stations
-
getUnprocessedPtv1FerryTerminals
public SortedMap<Long,de.topobyte.osm4j.core.model.iface.OsmNode> getUnprocessedPtv1FerryTerminals()
collect the ferry terminal that have been identified but not processed yet (unmodifiable)- Returns:
- unprocessed ferry terminal
-
addUnprocessedPtv1Station
public void addUnprocessedPtv1Station(de.topobyte.osm4j.core.model.iface.OsmEntity osmEntity)
add unprocessed ptv1 station- Parameters:
osmEntity
- to add
-
addUnprocessedPtv1FerryTerminal
public void addUnprocessedPtv1FerryTerminal(de.topobyte.osm4j.core.model.iface.OsmEntity osmEntity)
add unprocessed ferry terminal- Parameters:
osmEntity
- to add
-
addUnprocessedPtv2Station
public void addUnprocessedPtv2Station(de.topobyte.osm4j.core.model.iface.OsmEntity osmEntity)
add unprocessed ptv2 station- Parameters:
osmEntity
- to add
-
getUnprocessedPtv2Stations
public SortedMap<Long,de.topobyte.osm4j.core.model.iface.OsmEntity> getUnprocessedPtv2Stations(de.topobyte.osm4j.core.model.iface.EntityType entityType)
collect unprocces ptv2 stations (unmodifiable)- Parameters:
entityType
- to collect for (node, way)- Returns:
- unprocessed stations
-
getUnprocessedStopPositions
public SortedMap<Long,de.topobyte.osm4j.core.model.iface.OsmNode> getUnprocessedStopPositions()
collect unprocessed stop positions- Returns:
- unprocessed stop positions (unmodifiable)
-
removeUnprocessedStopPosition
public void removeUnprocessedStopPosition(long osmId)
remove unprocessed stop position- Parameters:
osmId
- to remove
-
removeUnprocessedPtv1FerryTerminal
public void removeUnprocessedPtv1FerryTerminal(long osmId)
remove unprocessed ferry terminal- Parameters:
osmId
- to remove
-
addUnprocessedStopPosition
public void addUnprocessedStopPosition(de.topobyte.osm4j.core.model.iface.OsmNode osmNode)
add unprocessed stop position- Parameters:
osmNode
- to add
-
hasUnprocessedStopPosition
public boolean hasUnprocessedStopPosition(long osmId)
Verify if unprocessed stop_position is registered- Parameters:
osmId
- to verify- Returns:
- true when registered, false otherwise
-
removeUnproccessedStation
public void removeUnproccessedStation(OsmPtVersionScheme ptVersion, de.topobyte.osm4j.core.model.iface.OsmEntity osmEntity)
remove an unprocessed station- Parameters:
ptVersion
- pt version thisosmEntity
- to remove
-
removeAllUnproccessedStations
public void removeAllUnproccessedStations(OsmPtVersionScheme ptVersion)
Remove all unprocessed station of a particular pt version that are currently still registered- Parameters:
ptVersion
- to remove all unprocessed station for
-
removeAllUnprocessedPtv1FerryTerminals
public void removeAllUnprocessedPtv1FerryTerminals()
Remove all unprocessed ferry terminals
-
removeAllUnproccessedStations
public void removeAllUnproccessedStations(OsmPtVersionScheme ptVersion, de.topobyte.osm4j.core.model.iface.EntityType type)
Remove all unprocessed station of a particular pt version and type that are currently still registered- Parameters:
ptVersion
- to remove stations fortype
- to remove all stations for
-
markOsmRelationOuterRoleOsmWayToKeep
public void markOsmRelationOuterRoleOsmWayToKeep(long osmWayId)
mark an osm way to be kept even if it is not recognised as as valid PT supporting way. This occurs when a way is part of for example a multi-polygon relation where the way itself has no tags, but the relation is a PT supporting entity. In that case the way member still holds information that we require when parsing the relation.- Parameters:
osmWayId
- to mark
-
removeOsmRelationOuterRoleOsmWay
public void removeOsmRelationOuterRoleOsmWay(long osmWayId)
Remove marked entry for keeping- Parameters:
osmWayId
- to remove from being flagged
-
shouldOsmRelationOuterRoleOsmWayBeKept
public boolean shouldOsmRelationOuterRoleOsmWayBeKept(de.topobyte.osm4j.core.model.iface.OsmWay osmWay)
verify if the passed in OSM way should be kept (even if it is not converted to a PLANit link based on its current tags- Parameters:
osmWay
- to verify- Returns:
- true when it should, false otherwise
-
addOsmRelationOuterRoleOsmWay
public de.topobyte.osm4j.core.model.iface.OsmWay addOsmRelationOuterRoleOsmWay(de.topobyte.osm4j.core.model.iface.OsmWay osmWay)
Add OSM way to keep. Should be based on a positive result from shouldOsmWayBeKept- Parameters:
osmWay
- to keep- Returns:
- osm way that was located in position of new osmWay, or null if none
-
hasOuterRoleOsmWay
public boolean hasOuterRoleOsmWay(long osmWayId)
Verify if osm way id is registered that qualifies as an outer role on that relation- Parameters:
osmWayId
- to verify- Returns:
- true when present false otherwise
-
getOuterRoleOsmWay
public de.topobyte.osm4j.core.model.iface.OsmWay getOuterRoleOsmWay(long osmWayId)
collect an unprocessed osm way that is identified as an outer role that is eligible as a platform/transfer zone- Parameters:
osmWayId
- to verify- Returns:
- the way, null if not marked/available
-
hasOsmRelationOuterRoleOsmWays
public boolean hasOsmRelationOuterRoleOsmWays()
check if outer role marked osm ways exist- Returns:
- true when present false otherwise
-
getNumberOfOuterRoleOsmWays
public long getNumberOfOuterRoleOsmWays()
collect number of oter role osm ways that we kepts- Returns:
- number of outer role osm ways present
-
addIgnoreStopAreaStopPosition
public void addIgnoreStopAreaStopPosition(de.topobyte.osm4j.core.model.iface.EntityType type, long osmId)
add identified OSM entity to be ignored if it pops up as a stop_area stop_position. For example, it was deemed incorrectly tagged already, or it pertains to a mode that is not being supported. The latter might not be verifiable when encountered as part of a relation, hence mark it here as such. It will then be skipped without further issue or warning- Parameters:
type
- entity typeosmId
- osm entity to mark as invalid stop_position
-
isIgnoreStopAreaStopPosition
public boolean isIgnoreStopAreaStopPosition(de.topobyte.osm4j.core.model.iface.EntityType type, long osmId)
Verify if marked as to be ignored- Parameters:
type
- entity typeosmId
- OSM entity id to verify for invalidity- Returns:
- true when marked invalid, false otherwise
-
addWaitingAreaWithoutMappedPlanitMode
public void addWaitingAreaWithoutMappedPlanitMode(de.topobyte.osm4j.core.model.iface.EntityType type, long osmId)
Add identified OSM entity as valid waiting area (platform, pole), but it has no mapped PLANit mode, e.g. a ferry stop when ferries are not included. By registering this one can check that if a waiting area cannot be collected later on, for example when a waiting area is part of a stop_area and it cannot be found a warning is issued, unless it is registered here- Parameters:
type
- entity typeosmId
- OSM entity to mark as waiting area without mapped PLANit mode
-
isWaitingAreaWithoutMappedPlanitMode
public boolean isWaitingAreaWithoutMappedPlanitMode(de.topobyte.osm4j.core.model.iface.EntityType type, long osmId)
Verify if marked as waiting area without a mapped planit mode- Parameters:
type
- entity typeosmId
- OSM entity id to verify for if the wainting area is marked as a valid one but simply not mapped to a planit mode- Returns:
- true when marked invalid, false otherwise
-
reset
public void reset()
reset the handler
-
-