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 protected
OsmNetworkReader(String countryName, PlanitOsmNetwork osmNetwork)
Constructorprotected
OsmNetworkReader(URL inputSource, String countryName, PlanitOsmNetwork osmNetworkToPopulate)
Constructorprotected
OsmNetworkReader(OsmNetworkReaderSettings settings, PlanitOsmNetwork osmNetworkToPopulate)
Constructorprotected
OsmNetworkReader(PlanitOsmNetwork osmNetwork)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.protected OsmNetworkReaderData
getNetworkReaderData()
Collect the network data gatheredprotected PlanitOsmNetwork
getOsmNetworkToPopulate()
Collect the osm network to populateOsmNetworkReaderSettings
getSettings()
Collect the settings which can be used to configure the readervoid
initialiseBeforeParsing()
Call this BEFORE we parse the OSM network to initialise the handler(s) properlyMacroscopicNetwork
read()
Parse a local *.osm or *.osm.pbf file and convert it into a Macroscopic network given the configuration options that have been setprotected void
removeDanglingSubNetworks()
Remove dangling subnetworks when settings dictate itvoid
removeDanglingSubNetworks(Zoning zoning)
remove dangling subnetworks when settings dictate it.void
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.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:
read
in 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:
getSettings
in interfaceConverterReader<LayeredNetwork<?,?>>
- Returns:
- the settings
-
reset
public void reset()
reset the reader to allow for marking unnecessary resources for garbage collection- Specified by:
reset
in 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
-
-