Class OsmZoningReader
- java.lang.Object
-
- org.goplanit.osm.converter.zoning.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 Summary
Constructors Modifier Constructor Description protected
OsmZoningReader(URL inputSource, String countryName, Zoning zoningToPopulate)
Constructor.protected
OsmZoningReader(URL inputSource, String countryName, Zoning zoningToPopulate, PlanitOsmNetwork referenceNetwork)
Constructor.protected
OsmZoningReader(URL inputSource, String countryName, Zoning zoningToPopulate, PlanitOsmNetwork referenceNetwork, OsmNetworkToZoningReaderData network2ZoningData)
Constructorprotected
OsmZoningReader(OsmPublicTransportReaderSettings settings, Zoning zoningToPopulate)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OsmPublicTransportReaderSettings
getSettings()
Collect the settings which can be used to configure the readerZoning
read()
Parse a local *.osm or *.osm.pbf file and convert it into a PLANit Zoning instance given the configuration options that have been setprotected void
read(de.topobyte.osm4j.core.access.OsmReader osmReader, OsmZoningHandlerBase osmHandler)
conduct reading of data with given reader and handlervoid
reset()
reset the reader to allow for marking unnecessary resources for garbage collection-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.goplanit.converter.zoning.ZoningReader
getTypeDescription
-
-
-
-
Constructor Detail
-
OsmZoningReader
protected OsmZoningReader(OsmPublicTransportReaderSettings settings, Zoning zoningToPopulate)
Constructor. Requires user to set reference network and networkToZoning data manually afterwards- Parameters:
settings
- to usezoningToPopulate
- 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 fromcountryName
- this zoning is used forzoningToPopulate
- 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 fromcountryName
- this zoning is used forzoningToPopulate
- zoning to populatereferenceNetwork
- to use
-
OsmZoningReader
protected OsmZoningReader(URL inputSource, String countryName, Zoning zoningToPopulate, PlanitOsmNetwork referenceNetwork, OsmNetworkToZoningReaderData network2ZoningData)
Constructor- Parameters:
inputSource
- to parse fromcountryName
- this zoning is used forzoningToPopulate
- zoning to populatereferenceNetwork
- to usenetwork2ZoningData
- 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 useosmHandler
- 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 interfaceConverterReader<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 interfaceConverterEntity
-
getSettings
public OsmPublicTransportReaderSettings getSettings()
Collect the settings which can be used to configure the reader- Specified by:
getSettings
in interfaceConverterReader<Zoning>
- Returns:
- the settings
-
-