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 protectedOsmZoningReader(URL inputSource, String countryName, Zoning zoningToPopulate, PlanitOsmNetwork referenceNetwork, OsmNetworkToZoningReaderData network2ZoningData)ConstructorprotectedOsmZoningReader(OsmPublicTransportReaderSettings settings, Zoning zoningToPopulate, PlanitOsmNetwork referenceNetwork, OsmNetworkToZoningReaderData network2ZoningData)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected PlanitOsmNetworkgetReferenceNetwork()OsmPublicTransportReaderSettingsgetSettings()Collect the settings which can be used to configure the readerZoningread()Parse a local *.osm or *.osm.pbf file and convert it into a PLANit Zoning instance given the configuration options that have been setprotected voidread(de.topobyte.osm4j.core.access.OsmReader osmReader, OsmZoningHandlerBase osmHandler)conduct reading of data with given reader and handlervoidreset()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(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
-
OsmZoningReader
protected OsmZoningReader(OsmPublicTransportReaderSettings settings, Zoning zoningToPopulate, PlanitOsmNetwork referenceNetwork, OsmNetworkToZoningReaderData network2ZoningData)
Constructor. Requires user to set reference network and networkToZoning data manually afterwards- Parameters:
settings- to usereferenceNetwork- to usezoningToPopulate- zoning to populatenetwork2ZoningData- to use
-
-
Method Detail
-
getReferenceNetwork
protected PlanitOsmNetwork getReferenceNetwork()
-
read
protected void read(de.topobyte.osm4j.core.access.OsmReader osmReader, OsmZoningHandlerBase osmHandler)conduct reading of data with given reader and handler- Parameters:
osmReader- to useosmHandler- to use
-
read
public Zoning read()
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:
readin interfaceConverterReader<Zoning>- Returns:
- macroscopic zoning that has been parsed
-
reset
public void reset()
reset the reader to allow for marking unnecessary resources for garbage collection- Specified by:
resetin interfaceConverterEntity
-
getSettings
public OsmPublicTransportReaderSettings getSettings()
Collect the settings which can be used to configure the reader- Specified by:
getSettingsin interfaceConverterReader<Zoning>- Returns:
- the settings
-
-