Class OsmZoningMainProcessingHandler

  • All Implemented Interfaces:
    de.topobyte.osm4j.core.access.OsmHandler

    public class OsmZoningMainProcessingHandler
    extends OsmZoningHandlerBase
    Handler that handles, i.e., converts, nodes, ways, and relations to the relevant transfer zones. This handler conducts the main processing pass whereas there also exist a pre- and post-processing handlers to initialise and finalise the parsing when the ordering of how OSM entities are parsed from file and offered to the handlers do not allow us to parse the OSM data in a single pass due to interdependencies.
    Author:
    markr
    • Constructor Detail

      • OsmZoningMainProcessingHandler

        public OsmZoningMainProcessingHandler​(OsmPublicTransportReaderSettings transferSettings,
                                              OsmZoningReaderData zoningReaderData,
                                              OsmNetworkToZoningReaderData network2ZoningData,
                                              PlanitOsmNetwork referenceNetwork,
                                              Zoning zoningToPopulate,
                                              OsmZoningHandlerProfiler profiler)
        Constructor
        Parameters:
        transferSettings - for the handler
        zoningReaderData - gather data during parsing and utilise available data from pre-processing
        network2ZoningData - data transferred from parsing network to be used by zoning reader.
        referenceNetwork - to use
        zoningToPopulate - to populate
        profiler - to use
    • Method Detail

      • extractTransferInfrastructure

        protected void extractTransferInfrastructure​(de.topobyte.osm4j.core.model.iface.OsmNode osmNode,
                                                     OsmPtVersionScheme ptVersion,
                                                     Map<String,​String> tags)
        extract the transfer infrastructure which will contribute to newly created transfer zones on the zoning instance
        Parameters:
        osmNode - to parse
        ptVersion - this node adheres to
        tags - to use
      • extractTransferInfrastructure

        protected void extractTransferInfrastructure​(de.topobyte.osm4j.core.model.iface.OsmWay osmWay,
                                                     OsmPtVersionScheme ptVersion,
                                                     Map<String,​String> tags)
        extract the transfer infrastructure which will contribute to newly created transfer zones on the zoning instance
        Parameters:
        osmWay - to parse
        ptVersion - this way adheres to
        tags - to use
      • handlePtOsmWay

        protected void handlePtOsmWay​(de.topobyte.osm4j.core.model.iface.OsmWay osmWay,
                                      OsmPtVersionScheme ptVersion,
                                      Map<String,​String> tags)
        Conduct actual processing of an OSM way that is deemed compatible and contains public transport features that ought to be parsed
        Parameters:
        osmWay - to parse
        ptVersion - identified for this OSM way
        tags - of this OSM way
      • handleOsmPtRelation

        protected void handleOsmPtRelation​(de.topobyte.osm4j.core.model.iface.OsmRelation osmRelation,
                                           Map<String,​String> tags)
        Handle eligible PT OSM relation to either extract an OSM Ptv2 stop area or multipolygon that represents a public transport platform
        Parameters:
        osmRelation - to handle
        tags - of the relation
      • handle

        public void handle​(de.topobyte.osm4j.core.model.iface.OsmNode osmNode)
        Construct PLANit nodes/connectoids/transferzones from OSM nodes when relevant
        Specified by:
        handle in interface de.topobyte.osm4j.core.access.OsmHandler
        Overrides:
        handle in class de.topobyte.osm4j.core.access.DefaultOsmHandler
        Parameters:
        osmNode - node to parse
      • handle

        public void handle​(de.topobyte.osm4j.core.model.iface.OsmWay osmWay)
        Parse an OSM way to extract for example platforms, or other transfer zone related geometry
        Specified by:
        handle in interface de.topobyte.osm4j.core.access.OsmHandler
        Overrides:
        handle in class de.topobyte.osm4j.core.access.DefaultOsmHandler
        Parameters:
        osmWay - to handle
      • handle

        public void handle​(de.topobyte.osm4j.core.model.iface.OsmRelation osmRelation)
        Specified by:
        handle in interface de.topobyte.osm4j.core.access.OsmHandler
        Overrides:
        handle in class de.topobyte.osm4j.core.access.DefaultOsmHandler
      • complete

        public void complete()
                      throws IOException
        Specified by:
        complete in interface de.topobyte.osm4j.core.access.OsmHandler
        Overrides:
        complete in class de.topobyte.osm4j.core.access.DefaultOsmHandler
        Throws:
        IOException
      • reset

        public void reset()
        reset the contents, mainly to free up unused resources
        Specified by:
        reset in class OsmZoningHandlerBase