Package org.goplanit.converter
Class BaseWriterImpl<T>
- java.lang.Object
-
- org.goplanit.converter.BaseWriterImpl<T>
-
- All Implemented Interfaces:
ConverterEntity
,ConverterWriter<T>
- Direct Known Subclasses:
MatsimWriter
,PlanitWriterImpl
public abstract class BaseWriterImpl<T> extends Object implements ConverterWriter<T>
abstract base class implementation to write a PLANit network to disk with id mapping sorted for convenience- 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
BaseWriterImpl(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.goplanit.converter.ConverterEntity
getTypeDescription, reset
-
Methods inherited from interface org.goplanit.converter.ConverterWriter
getSettings, write
-
-
-
-
Field Detail
-
idMapper
protected IdMapperType idMapper
the id mapper to use
-
-
Constructor Detail
-
BaseWriterImpl
protected BaseWriterImpl(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 interfaceConverterWriter<T>
- Returns:
- the idmapping choice
-
setIdMapperType
public void setIdMapperType(IdMapperType idMapper)
set the way ids should be mapped- Specified by:
setIdMapperType
in interfaceConverterWriter<T>
- Parameters:
idMapper
- to use
-
-