Class PlanitWriterImpl<T>

    • Constructor Detail

      • PlanitWriterImpl

        protected PlanitWriterImpl​(IdMapperType idMapperType)
        Constructor
        Parameters:
        idMapperType - to use
    • Method Detail

      • extractSrsName

        protected static String extractSrsName​(PlanitXmlWriterSettings xmlSettings)
                                        throws PlanItException
        Extract the src name to use based on the available crs information on network and settings
        Parameters:
        xmlSettings - to use
        Returns:
        srsName to use
        Throws:
        PlanItException - thrown if error
      • createGmlDirectPositionType

        protected net.opengis.gml.DirectPositionType createGmlDirectPositionType​(org.locationtech.jts.geom.Point position)
        Create a position type based on point location
        Parameters:
        position - to convert to GML and transform if needed
        Returns:
        created GML pos
      • createGmlCoordType

        protected net.opengis.gml.CoordType createGmlCoordType​(org.locationtech.jts.geom.Coordinate coordinate)
        Create a GML coord type from the provided coordinate
        Parameters:
        coordinate - to convert to GML and transform if needed
        Returns:
        created GML coordinate
      • createGmlPointType

        protected net.opengis.gml.PointType createGmlPointType​(org.locationtech.jts.geom.Point position)
        Create a GML PointType from a JTS Point and account for any crs transformation if needed
        Parameters:
        position - to extract from
        Returns:
        created PointType
      • createGmlPolygonType

        protected net.opengis.gml.PolygonType createGmlPolygonType​(org.locationtech.jts.geom.Polygon polygon)
        create a GML PolygonType from a JTS Polygon and account for any crs transformation if needed
        Parameters:
        polygon - to extract from
        Returns:
        created PolygonType
      • createGmlLineStringType

        protected net.opengis.gml.LineStringType createGmlLineStringType​(org.locationtech.jts.geom.LineString lineString)
        Create a GML LineStringType from a JTS LineStringand account for any crs transformation if needed
        Parameters:
        lineString - to extract from
        Returns:
        created LineStringType
      • prepareCoordinateReferenceSystem

        protected void prepareCoordinateReferenceSystem​(org.opengis.referencing.crs.CoordinateReferenceSystem sourceCrs)
                                                 throws PlanItException
        prepare the Crs transformer (if any) based on the user configuration settings
        Parameters:
        sourceCrs - the crs used for the source material of this writer
        Throws:
        PlanItException - thrown if error
      • initialiseIdMappingFunctions

        protected void initialiseIdMappingFunctions()
                                             throws PlanItException
        depending on the chosen id mapping, create the mapping functions for all id carrying entities that are persisted
        Throws:
        PlanItException - thrown if error
      • getVertexIdMapper

        protected Function<Vertex,​String> getVertexIdMapper()
        get id mapper for nodes
        Returns:
        id mapper
      • getLinkIdMapper

        protected Function<Link,​String> getLinkIdMapper()
        get id mapper for links
        Returns:
        id mapper
      • getModeIdMapper

        protected Function<Mode,​String> getModeIdMapper()
        get id mapper for modes
        Returns:
        id mapper
      • getZoneIdMapper

        protected Function<Zone,​String> getZoneIdMapper()
        get id mapper for zones
        Returns:
        id mapper
      • getConnectoidIdMapper

        protected Function<Connectoid,​String> getConnectoidIdMapper()
        get id mapper for connectoids
        Returns:
        id mapper
      • getTransferZoneGroupIdMapper

        protected Function<TransferZoneGroup,​String> getTransferZoneGroupIdMapper()
        get id mapper for transfer zone groups
        Returns:
        id mapper
      • getGeoUtils

        protected PlanitJtsCrsUtils getGeoUtils()
        geo util class based on source Crs (if any)
        Returns:
        geoUtils
      • persist

        protected void persist​(Object xmlRootElement,
                               Class<?> rootElementClazz,
                               String planitSchemaName)
                        throws PlanItException
        Persist the populated XML memory model to disk using JAXb
        Parameters:
        xmlRootElement - to persist from
        rootElementClazz - the type of the root element object
        planitSchemaName - schema the XML complies with
        Throws:
        PlanItException - thrown if error