Class OsmZoningPreProcessingHandler

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

    public class OsmZoningPreProcessingHandler
    extends OsmZoningHandlerBase
    Handler that is applied before we conduct the actual handling of the zones by exploring the OSM relations in the file and highlighting a subset of ways that we are supposed to retain even though they are not tagged by themselves in a way that warrants keeping them. However, because they are vital to the OSM relations we should keep them.

    To avoid keeping all ways and nodes in memory, we preprocess by first identifying which nodes/ways we must keep to be able to properly parse the OSM relations (that are always parsed last).

    Run pre-processing twice, first stage with IDENTIFY_PLATFORM_AS_RELATIONS, then when these platforms have been identified run again with IDENTIFY_PT_NODES which will pre-register all nodes for the ways that were identified as platform AND will pre-register all remaining unregistered OSM nodes part of relations that are not part of the physical network, such as station nodes

    Author:
    markr
    • Constructor Detail

      • OsmZoningPreProcessingHandler

        public OsmZoningPreProcessingHandler​(PlanitOsmNetwork referenceNetwork,
                                             Zoning zoningToPopulate,
                                             OsmPublicTransportReaderSettings transferSettings,
                                             OsmZoningReaderData zoningReaderData,
                                             OsmNetworkToZoningReaderData network2ZoningData,
                                             OsmZoningPreProcessingHandler.Stage stage,
                                             OsmZoningHandlerProfiler profiler)
        Constructor
        Parameters:
        referenceNetwork - to use
        zoningToPopulate - to populate
        transferSettings - for the handler
        zoningReaderData - to use for storage of temporary information, or data that is to be made available to later handlers
        network2ZoningData - data transferred from parsing network to be used by zoning reader.
        stage - indicating what stage this pre-processing is in.Depending on the stage different pre-processing actinos are undertaken
        profiler - to use
    • Method Detail

      • handle

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