Class GeoData


  • public class GeoData
    extends Object
    Some generic function to load data from mainstream data formats: gpkg, shp, geojson.
    Author:
    julien Gaffuri
    • Constructor Detail

      • GeoData

        public GeoData​(String filePath)
        Build a GeoData from a file.
        Parameters:
        filePath -
      • GeoData

        public GeoData​(String filePath,
                       String idAtt)
        Build a GeoData from a file.
        Parameters:
        filePath -
        idAtt -
      • GeoData

        public GeoData​(String filePath,
                       String idAtt,
                       org.opengis.filter.Filter filter)
        Build a GeoData from a file.
        Parameters:
        filePath -
        idAtt -
        filter -
    • Method Detail

      • getSchema

        public org.opengis.feature.simple.SimpleFeatureType getSchema()
        Returns:
        The schema
      • getCRS

        public org.opengis.referencing.crs.CoordinateReferenceSystem getCRS()
        Returns:
        The coordinate reference system
      • getFeatures

        public static ArrayList<Feature> getFeatures​(String filePath)
        Get features
        Parameters:
        filePath -
        Returns:
      • getFeatures

        public static ArrayList<Feature> getFeatures​(String filePath,
                                                     String idAtt,
                                                     org.opengis.filter.Filter filter)
        Get features
        Parameters:
        filePath -
        idAtt -
        filter -
        Returns:
        Throws:
        Exception
      • getSchema

        public static org.opengis.feature.simple.SimpleFeatureType getSchema​(String filePath)
        Parameters:
        filePath -
        Returns:
        Throws:
        Exception
      • getCRS

        public static org.opengis.referencing.crs.CoordinateReferenceSystem getCRS​(String filePath)
        Parameters:
        filePath -
        Returns:
      • save

        public static <T extends Feature> void save​(Collection<T> fs,
                                                    String filePath,
                                                    org.opengis.referencing.crs.CoordinateReferenceSystem crs,
                                                    boolean createSpatialIndex)
        Parameters:
        fs -
        filePath -
        crs -
        createSpatialIndex -
      • save

        public static <T extends Feature> void save​(Collection<T> fs,
                                                    String filePath,
                                                    org.opengis.referencing.crs.CoordinateReferenceSystem crs)
        Parameters:
        fs -
        filePath -
        crs -
      • saveGeoms

        public static <T extends org.locationtech.jts.geom.Geometry> void saveGeoms​(Collection<T> geoms,
                                                                                    String outFile,
                                                                                    org.opengis.referencing.crs.CoordinateReferenceSystem crs,
                                                                                    boolean createSpatialIndex)
        Type Parameters:
        T -
        Parameters:
        geoms -
        outFile -
        crs -
        createSpatialIndex -