Package org.planit.network.converter
Class NetworkWriterImpl
- java.lang.Object
-
- org.planit.network.converter.NetworkWriterImpl
-
- All Implemented Interfaces:
NetworkWriter
- Direct Known Subclasses:
PlanitNetworkWriter
public abstract class NetworkWriterImpl extends Object implements NetworkWriter
abstract class implementation to write a PLANit network to disk- Author:
- markr
-
-
Field Summary
Fields Modifier and Type Field Description protected IdMapperType
idMapper
the id mapper to use
-
Constructor Summary
Constructors Modifier Constructor Description protected
NetworkWriterImpl(IdMapperType idMapperType)
constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IdMapperType
getIdMapperType()
collect the way the ids should be mappedprotected org.opengis.referencing.crs.CoordinateReferenceSystem
identifyDestinationCoordinateReferenceSystem(org.opengis.referencing.crs.CoordinateReferenceSystem overwriteCrs, String countryName, org.opengis.referencing.crs.CoordinateReferenceSystem fallBackCrs)
identify what the destination Crs is supposed to be.void
setIdMapperType(IdMapperType idMapper)
set the way ids should be mapped-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.planit.network.converter.NetworkWriter
write
-
-
-
-
Field Detail
-
idMapper
protected IdMapperType idMapper
the id mapper to use
-
-
Constructor Detail
-
NetworkWriterImpl
protected NetworkWriterImpl(IdMapperType idMapperType)
constructor- Parameters:
idMapperType
- to use as default
-
-
Method Detail
-
identifyDestinationCoordinateReferenceSystem
protected org.opengis.referencing.crs.CoordinateReferenceSystem identifyDestinationCoordinateReferenceSystem(org.opengis.referencing.crs.CoordinateReferenceSystem overwriteCrs, String countryName, org.opengis.referencing.crs.CoordinateReferenceSystem fallBackCrs) throws PlanItException
identify what the destination Crs is supposed to be. If directly set by user we use the overwrite Crs, if null then we try to extract an appropriate Crs by the country name. If no such mapping exists, we return the fall back option that must be provided.- Parameters:
overwriteCrs
- this Crs takes precedence and is returned if presentcountryName
- extract appropriate Crs based on countryname if overwriteCrs is not providedfallBackCrs
- returned when none of the two other options yielded a result- Returns:
- crs for destination
- Throws:
PlanItException
- thrown if error
-
getIdMapperType
public IdMapperType getIdMapperType()
collect the way the ids should be mapped- Specified by:
getIdMapperType
in interfaceNetworkWriter
- Returns:
- the idmapping choice
-
setIdMapperType
public void setIdMapperType(IdMapperType idMapper)
set the way ids should be mapped- Specified by:
setIdMapperType
in interfaceNetworkWriter
- Parameters:
idMapper
- to use
-
-