Class OsmNetworkReader
- java.lang.Object
-
- org.goplanit.osm.converter.network.OsmNetworkReader
-
- All Implemented Interfaces:
ConverterEntity,ConverterReader<LayeredNetwork<?,?>>,NetworkReader
public class OsmNetworkReader extends Object implements NetworkReader
Parse OSM input in either *.osm or *.osm.pbf format and return PLANit network instance- Author:
- markr
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedOsmNetworkReader(String countryName, PlanitOsmNetwork osmNetwork)ConstructorprotectedOsmNetworkReader(URL inputSource, String countryName, PlanitOsmNetwork osmNetworkToPopulate)ConstructorprotectedOsmNetworkReader(OsmNetworkReaderSettings settings, PlanitOsmNetwork osmNetworkToPopulate)ConstructorprotectedOsmNetworkReader(PlanitOsmNetwork osmNetwork)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OsmNetworkToZoningReaderDatacreateNetworkToZoningReaderData()Factory method to create bridging data required for an OSM zoning reader to successfully parse the Pt zones based on the osm network parsed by this network reader.protected OsmNetworkReaderDatagetNetworkReaderData()Collect the network data gatheredprotected PlanitOsmNetworkgetOsmNetworkToPopulate()Collect the osm network to populateOsmNetworkReaderSettingsgetSettings()Collect the settings which can be used to configure the readervoidinitialiseBeforeParsing()Call this BEFORE we parse the OSM network to initialise the handler(s) properlyMacroscopicNetworkread()Parse a local *.osm or *.osm.pbf file and convert it into a Macroscopic network given the configuration options that have been setprotected voidremoveDanglingSubNetworks()Remove dangling subnetworks when settings dictate itvoidremoveDanglingSubNetworks(Zoning zoning)remove dangling subnetworks when settings dictate it.voidreset()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.network.NetworkReader
getTypeDescription
-
-
-
-
Constructor Detail
-
OsmNetworkReader
protected OsmNetworkReader(PlanitOsmNetwork osmNetwork)
Constructor- Parameters:
osmNetwork- network to populate
-
OsmNetworkReader
protected OsmNetworkReader(String countryName, PlanitOsmNetwork osmNetwork)
Constructor- Parameters:
countryName- to useosmNetwork- network to populate
-
OsmNetworkReader
protected OsmNetworkReader(URL inputSource, String countryName, PlanitOsmNetwork osmNetworkToPopulate)
Constructor- Parameters:
inputSource- to usecountryName- to useosmNetworkToPopulate- network to populate
-
OsmNetworkReader
protected OsmNetworkReader(OsmNetworkReaderSettings settings, PlanitOsmNetwork osmNetworkToPopulate)
Constructor- Parameters:
settings- for populating the networkosmNetworkToPopulate- network to populate
-
-
Method Detail
-
initialiseBeforeParsing
public void initialiseBeforeParsing()
Call this BEFORE we parse the OSM network to initialise the handler(s) properly
-
getNetworkReaderData
protected OsmNetworkReaderData getNetworkReaderData()
Collect the network data gathered- Returns:
- network data
-
removeDanglingSubNetworks
protected void removeDanglingSubNetworks()
Remove dangling subnetworks when settings dictate it
-
removeDanglingSubNetworks
public void removeDanglingSubNetworks(Zoning zoning)
remove dangling subnetworks when settings dictate it. In case the removal of subnetworks causes zones to become dangling the user is required to remove those afterwards themselves, by providing the zoning, only the directly impacted connectoids are removed if affected.- Parameters:
zoning- to also remove connectoids from when they reference removed road/rail subnetworks
-
getOsmNetworkToPopulate
protected PlanitOsmNetwork getOsmNetworkToPopulate()
Collect the osm network to populate- Returns:
- osm network
-
read
public MacroscopicNetwork read()
Parse a local *.osm or *.osm.pbf file and convert it into a Macroscopic network given the configuration options that have been set- Specified by:
readin interfaceConverterReader<LayeredNetwork<?,?>>- Returns:
- macroscopic network that has been parsed
-
getSettings
public OsmNetworkReaderSettings getSettings()
Collect the settings which can be used to configure the reader- Specified by:
getSettingsin interfaceConverterReader<LayeredNetwork<?,?>>- Returns:
- the settings
-
reset
public void reset()
reset the reader to allow for marking unnecessary resources for garbage collection- Specified by:
resetin interfaceConverterEntity
-
createNetworkToZoningReaderData
public OsmNetworkToZoningReaderData createNetworkToZoningReaderData()
Factory method to create bridging data required for an OSM zoning reader to successfully parse the Pt zones based on the osm network parsed by this network reader. Without this data it is not possible to relate the two properly- Returns:
- created network to zoning reader data to use
-
-