Class OsmZoningReader

  • All Implemented Interfaces:
    ConverterEntity, ConverterReader<Zoning>, ZoningReader

    public class OsmZoningReader
    extends Object
    implements ZoningReader
    Parse OSM input in either *.osm or *.osm.pbf format and return PLANit zoning instance comprising of the identified transfer zones. Note that OSM data does not contain any information regarding OD zones, so this will be empty.

    Further note that because a PLANit zoning relies on the network, we must first initialise the zoning reader before calling the read() method with the necessary data obtained by the related Osm network reader, otherwise parsing the zoning information will fail.

    Author:
    markr
    • Constructor Detail

      • OsmZoningReader

        protected OsmZoningReader​(OsmPublicTransportReaderSettings settings,
                                  Zoning zoningToPopulate)
        Constructor. Requires user to set reference network and networkToZoning data manually afterwards
        Parameters:
        settings - to use
        zoningToPopulate - zoning to populate
      • OsmZoningReader

        protected OsmZoningReader​(URL inputSource,
                                  String countryName,
                                  Zoning zoningToPopulate)
        Constructor. Requires user to set reference network and networkToZoning data manually afterwards
        Parameters:
        inputSource - to parse from
        countryName - this zoning is used for
        zoningToPopulate - zoning to populate
      • OsmZoningReader

        protected OsmZoningReader​(URL inputSource,
                                  String countryName,
                                  Zoning zoningToPopulate,
                                  PlanitOsmNetwork referenceNetwork)
        Constructor. Requires user to set networkToZoning data manually afterwards
        Parameters:
        inputSource - to parse from
        countryName - this zoning is used for
        zoningToPopulate - zoning to populate
        referenceNetwork - to use
      • OsmZoningReader

        protected OsmZoningReader​(URL inputSource,
                                  String countryName,
                                  Zoning zoningToPopulate,
                                  PlanitOsmNetwork referenceNetwork,
                                  OsmNetworkToZoningReaderData network2ZoningData)
        Constructor
        Parameters:
        inputSource - to parse from
        countryName - this zoning is used for
        zoningToPopulate - zoning to populate
        referenceNetwork - to use
        network2ZoningData - to use
    • Method Detail

      • read

        protected void read​(de.topobyte.osm4j.core.access.OsmReader osmReader,
                            OsmZoningHandlerBase osmHandler)
                     throws PlanItException
        conduct reading of data with given reader and handler
        Parameters:
        osmReader - to use
        osmHandler - to use
        Throws:
        PlanItException - thrown if error
      • read

        public Zoning read()
                    throws PlanItException
        Parse a local *.osm or *.osm.pbf file and convert it into a PLANit Zoning instance given the configuration options that have been set
        Specified by:
        read in interface ConverterReader<Zoning>
        Returns:
        macroscopic zoning that has been parsed
        Throws:
        PlanItException - thrown if error
      • reset

        public void reset()
        reset the reader to allow for marking unnecessary resources for garbage collection
        Specified by:
        reset in interface ConverterEntity