Class OsmZoningProcessingHandler

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

    public class OsmZoningProcessingHandler
    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

      • OsmZoningProcessingHandler

        public OsmZoningProcessingHandler​(OsmPublicTransportReaderSettings transferSettings,
                                          OsmZoningReaderData zoningReaderData,
                                          Zoning zoningToPopulate,
                                          OsmZoningHandlerProfiler profiler)
        Constructor
        Parameters:
        transferSettings - for the handler
        zoningReaderData - gather data during parsing and utilise available data from pre-processing
        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)
                                              throws PlanItException
        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
        Throws:
        PlanItException - thrown if error
      • extractTransferInfrastructure

        protected void extractTransferInfrastructure​(de.topobyte.osm4j.core.model.iface.OsmWay osmWay,
                                                     OsmPtVersionScheme ptVersion,
                                                     Map<String,​String> tags)
                                              throws PlanItException
        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
        Throws:
        PlanItException - thrown if error
      • handle

        public void handle​(de.topobyte.osm4j.core.model.iface.OsmNode osmNode)
                    throws IOException
        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
        Throws:
        IOException
      • handle

        public void handle​(de.topobyte.osm4j.core.model.iface.OsmWay osmWay)
                    throws IOException
        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
        Throws:
        IOException
      • handle

        public void handle​(de.topobyte.osm4j.core.model.iface.OsmRelation osmRelation)
                    throws IOException
        Specified by:
        handle in interface de.topobyte.osm4j.core.access.OsmHandler
        Overrides:
        handle in class de.topobyte.osm4j.core.access.DefaultOsmHandler
        Throws:
        IOException
      • 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