Class OsmIntermodalReader
- java.lang.Object
-
- org.goplanit.osm.converter.intermodal.OsmIntermodalReader
-
- All Implemented Interfaces:
ConverterEntity
,IntermodalReader
,MultiConverterReader<MacroscopicNetwork,Zoning>
public class OsmIntermodalReader extends Object implements IntermodalReader
Parse OSM input in either *.osm or *.osm.pbf format and return PLANit intermodal network which includes the transfer zones of a zoning instance. By default an intermodal reader will activate parsing transfer infrastructure as well as the network infrastructure (including rail which for a "regular" network reader is turned off by default, since we assume that more often than not, once desires to include rail when parsing pt networks. One can manually change these defaults via the various settings made available.- Author:
- markr
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
OsmIntermodalReader(String countryName, PlanitOsmNetwork osmNetworkToPopulate, Zoning zoningToPopulate)
Constructorprotected
OsmIntermodalReader(URL inputSource, String countryName, PlanitOsmNetwork osmNetworkToPopulate, Zoning zoningToPopulate)
Constructorprotected
OsmIntermodalReader(OsmIntermodalReaderSettings settings, Zoning zoningToPopulate)
Constructorprotected
OsmIntermodalReader(OsmNetworkReaderSettings networkSettings, OsmPublicTransportReaderSettings ptSettings, PlanitOsmNetwork osmNetworkToPopulate, Zoning zoningToPopulate)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OsmIntermodalReaderSettings
getSettings()
any settings to configure the reader can be configured by collecting these settingsPair<MacroscopicNetwork,Zoning>
read()
Parse a local *.osm or *.osm.pbf file and convert it into a Macroscopic network and zoning given the configuration options that have been setvoid
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.intermodal.IntermodalReader
getTypeDescription
-
-
-
-
Constructor Detail
-
OsmIntermodalReader
protected OsmIntermodalReader(String countryName, PlanitOsmNetwork osmNetworkToPopulate, Zoning zoningToPopulate)
Constructor- Parameters:
countryName
- to use for parsing the geometries in desired projectionosmNetworkToPopulate
- to populatezoningToPopulate
- to populate
-
OsmIntermodalReader
protected OsmIntermodalReader(URL inputSource, String countryName, PlanitOsmNetwork osmNetworkToPopulate, Zoning zoningToPopulate)
Constructor- Parameters:
inputSource
- to use for all intermodal parsingcountryName
- to use for parsing the geometries in desired projectionosmNetworkToPopulate
- to populatezoningToPopulate
- to populate
-
OsmIntermodalReader
protected OsmIntermodalReader(OsmNetworkReaderSettings networkSettings, OsmPublicTransportReaderSettings ptSettings, PlanitOsmNetwork osmNetworkToPopulate, Zoning zoningToPopulate) throws PlanItException
Constructor- Parameters:
networkSettings
- to useptSettings
- to useosmNetworkToPopulate
- to populatezoningToPopulate
- to populate- Throws:
PlanItException
- throws if network settings are inconsistent with network and country provided
-
OsmIntermodalReader
protected OsmIntermodalReader(OsmIntermodalReaderSettings settings, Zoning zoningToPopulate)
Constructor- Parameters:
settings
- to usezoningToPopulate
- to populate
-
-
Method Detail
-
read
public Pair<MacroscopicNetwork,Zoning> read() throws PlanItException
Parse a local *.osm or *.osm.pbf file and convert it into a Macroscopic network and zoning given the configuration options that have been set- Specified by:
read
in interfaceMultiConverterReader<MacroscopicNetwork,Zoning>
- Returns:
- network and zoning that has been parsed, or null if detected problem has occurred and logged
- 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 OsmIntermodalReaderSettings getSettings()
any settings to configure the reader can be configured by collecting these settings- Specified by:
getSettings
in interfaceMultiConverterReader<MacroscopicNetwork,Zoning>
- Returns:
- the settings to configrue the reader
-
-