Class OsmZoningReaderOsmData


  • public class OsmZoningReaderOsmData
    extends Object
    Data specifically required in the zoning reader while parsing OSM data
    Author:
    markr
    • Constructor Detail

      • OsmZoningReaderOsmData

        public OsmZoningReaderOsmData()
    • Method Detail

      • 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 for
        osmId - id to collect for
        Returns:
        pair of version and unprocessed station, null otherwise
      • getUnprocessedPtv1Stations

        public Map<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:
        unprocess ptv1 stations
      • addUnprocessedPtv1Station

        public void addUnprocessedPtv1Station​(de.topobyte.osm4j.core.model.iface.OsmEntity osmEntity)
        add unprocessed ptv1 station
        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 Map<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 Set<Long> getUnprocessedStopPositions()
        collect unprocessed stop positions
        Returns:
        unprocessed stop positions (unmodifiable)
      • removeUnprocessedStopPosition

        public void removeUnprocessedStopPosition​(long osmId)
        remove unprocessed stop position
        Parameters:
        osmId - to remove
      • addUnprocessedStopPosition

        public void addUnprocessedStopPosition​(long osmId)
        add unprocessed stop position
        Parameters:
        osmId - 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 this
        osmEntity - 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
      • 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 for
        type - 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
      • addInvalidStopAreaStopPosition

        public void addInvalidStopAreaStopPosition​(de.topobyte.osm4j.core.model.iface.EntityType type,
                                                   long osmId)
        add identified osm entity as invalid stop_position. When converting stop_positions to connectoids it will be skipped without further issue or warning
        Parameters:
        type - entity type
        osmId - osm entity to mark as invalid stop_position
      • isInvalidStopAreaStopPosition

        public boolean isInvalidStopAreaStopPosition​(de.topobyte.osm4j.core.model.iface.EntityType type,
                                                     long osmId)
        Verify if marked as invalid
        Parameters:
        type - entity type
        osmId - 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 type
        osmId - 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 type
        osmId - 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