Package org.planit.io.zoning
Class PlanitZoningReader
- java.lang.Object
-
- org.planit.io.xml.util.PlanitXmlReader<org.planit.xml.generated.XMLElementMacroscopicZoning>
-
- org.planit.io.zoning.PlanitZoningReader
-
public class PlanitZoningReader extends PlanitXmlReader<org.planit.xml.generated.XMLElementMacroscopicZoning>
Class to parse zoning from native XML format- Author:
- markr
-
-
Field Summary
Fields Modifier and Type Field Description protected PlanitZoningReaderSettings
settings
settings for the zoning readerprotected Zoning
zoning
the zoning to populate
-
Constructor Summary
Constructors Constructor Description PlanitZoningReader(String pathDirectory, String xmlFileExtension, Zoning zoning)
constructorPlanitZoningReader(org.planit.xml.generated.XMLElementMacroscopicZoning xmlMacroscopicZoning, Zoning zoning)
constructor where file has already been parsed and we only need to convert from raw XML objects to PLANit memory model
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PlanitZoningReaderSettings
getSettings()
settings for this readerprotected void
populateIntermodal(Modes modes, Map<String,MacroscopicLinkSegment> linkSegmentsByXmlId)
parse the intermodal zones, i.e., platforms, stops, stations, etc.protected void
populateODZones(Map<String,Node> nodesByXmlIds)
parse the OD zones from Xml element into Planit memoryZoning
read(InfrastructureNetwork network, Map<String,Node> nodesByXmlId, Map<String,MacroscopicLinkSegment> linkSegmentsByXmlId)
read the zoning from diskprotected void
setZoning(Zoning zoning)
set the zoning to populate-
Methods inherited from class org.planit.io.xml.util.PlanitXmlReader
clearXmlContent, getXmlRootElement, initialiseAndParseXmlRootElement
-
-
-
-
Field Detail
-
settings
protected final PlanitZoningReaderSettings settings
settings for the zoning reader
-
zoning
protected Zoning zoning
the zoning to populate
-
-
Constructor Detail
-
PlanitZoningReader
public PlanitZoningReader(String pathDirectory, String xmlFileExtension, Zoning zoning) throws PlanItException
constructor- Parameters:
pathDirectory
- to usexmlFileExtension
- to usezoning
- to populate- Throws:
PlanItException
- thrown if error
-
PlanitZoningReader
public PlanitZoningReader(org.planit.xml.generated.XMLElementMacroscopicZoning xmlMacroscopicZoning, Zoning zoning) throws PlanItException
constructor where file has already been parsed and we only need to convert from raw XML objects to PLANit memory model- Parameters:
xmlMacroscopicZoning
- to extract fromzoning
- to populate- Throws:
PlanItException
- thrown if error
-
-
Method Detail
-
setZoning
protected void setZoning(Zoning zoning)
set the zoning to populate- Parameters:
zoning
- to populate
-
populateODZones
protected void populateODZones(Map<String,Node> nodesByXmlIds) throws PlanItException
parse the OD zones from Xml element into Planit memory- Parameters:
nodesByXmlIds
- nodes indexed by xml id to use- Throws:
PlanItException
- thrown if error
-
populateIntermodal
protected void populateIntermodal(Modes modes, Map<String,MacroscopicLinkSegment> linkSegmentsByXmlId) throws PlanItException
parse the intermodal zones, i.e., platforms, stops, stations, etc. from Xml element into Planit memory- Parameters:
modes
- that can be referred tolinkSegmentsByXmlId
- to identify mapping between (transfer) connectoids and network- Throws:
PlanItException
- thrown if error
-
read
public Zoning read(InfrastructureNetwork network, Map<String,Node> nodesByXmlId, Map<String,MacroscopicLinkSegment> linkSegmentsByXmlId) throws PlanItException
read the zoning from disk- Parameters:
network
- this zoning is compatible withnodesByXmlId
- to identify mapping between OD zones and network (via nodes)linkSegmentsByXmlId
- to identify mapping between (transfer) connectoids and network- Returns:
- zoning parsed
- Throws:
PlanItException
- thrown if error
-
getSettings
public PlanitZoningReaderSettings getSettings()
settings for this reader- Returns:
- settings
-
-