Class GeometryIoWriter<T>

    • Constructor Detail

      • GeometryIoWriter

        protected GeometryIoWriter()
        Constructor
      • GeometryIoWriter

        protected GeometryIoWriter​(String networkPath)
        Constructor
        Parameters:
        networkPath - to persist network on
      • GeometryIoWriter

        protected GeometryIoWriter​(String networkPath,
                                   String countryName)
        Constructor
        Parameters:
        networkPath - to persist network on
        countryName - to optimise projection for (if available, otherwise ignore)
      • GeometryIoWriter

        protected GeometryIoWriter​(GeoIoWriterSettings settings)
        Constructor
        Parameters:
        settings - to use
    • Method Detail

      • findFeaturePairForPlanitEntity

        protected Pair<org.opengis.feature.simple.SimpleFeatureType,​PlanitEntityFeatureTypeContext<? extends ManagedId>> findFeaturePairForPlanitEntity​(Class<? extends ManagedId> planitEntityClass,
                                                                                                                                                              List<Pair<org.opengis.feature.simple.SimpleFeatureType,​PlanitEntityFeatureTypeContext<? extends ManagedId>>> geoFeatureTypesByPlanitEntity)
        Given the feature contexts for the available GIS features, find the one where the context matches a given PLANit entity class
        Parameters:
        planitEntityClass - to find entry for
        geoFeatureTypesByPlanitEntity - available entries to search in
        Returns:
        found entry or throw run time exception
      • findFeature

        protected <TT extends ExternalIdAblePair<org.opengis.feature.simple.SimpleFeatureType,​PlanitEntityFeatureTypeContext<TT>> findFeature​(Class<TT> clazz,
                                                                                                                                                      Map<org.opengis.feature.simple.SimpleFeatureType,​PlanitEntityFeatureTypeContext<? extends ExternalIdAble>> geoFeatureTypes)
        find feature and context based on the class present in context
        Type Parameters:
        TT - the type of geometry
        Parameters:
        clazz - to find feature for
        geoFeatureTypes - to find from
        Returns:
        found entry, null if not present
      • writeGeometryLayerForEntity

        protected <TT extends ManagedId> void writeGeometryLayerForEntity​(org.opengis.feature.simple.SimpleFeatureType featureType,
                                                                          PlanitEntityFeatureTypeContext<TT> planitEntityFeatureContext,
                                                                          String loggingPrefix,
                                                                          org.geotools.data.DataStore entityDataStore,
                                                                          String featureSchemaName,
                                                                          Iterable<TT> planitEntities)
        Writer the geometry layer with the PLANit entities available in the container
        Type Parameters:
        TT - type of PLANit entity to write
        Parameters:
        featureType - to use
        planitEntityFeatureContext - the context to convert instances to features
        loggingPrefix - to use
        entityDataStore - to use for persistence
        featureSchemaName - the feature lives under on the datastore
        planitEntities - container to persist
      • findDataStore

        protected <TT extends ManagedId> org.geotools.data.DataStore findDataStore​(PlanitEntityFeatureTypeContext<TT> featureContext,
                                                                                   Path fullOutputPath)
        Find data store to use, if not present, create it if possible
        Type Parameters:
        TT - type of PLANit entity the data store is to be used for
        Parameters:
        featureContext - to create data store for and register on GeoIODataStoreManager
        fullOutputPath - on where to store results
        Returns:
        dataStore to use
      • reset

        public void reset()
        reset the reader to allow for marking unnecessary resources for garbage collection
      • getSettings

        public GeoIoWriterSettings getSettings()
        any settings to configure the writer can be configured by collecting these settings
        Returns:
        the settings to configure the writer