Class SidecarFootprintProvider

  • All Implemented Interfaces:
    FootprintGeometryProvider

    public class SidecarFootprintProvider
    extends Object
    implements FootprintGeometryProvider
    A footprint provider looking for sidecar files (SHP, WKB, WKT, ...). By default, footprints are searched as files living beside the data file. In case a "FOOTPRINTS_DATA_DIR" property is specified, footprints are searched into an external directory too in case they aren't found on the main folder.

    This can be useful for cases where the data file lives into a read only folder.

    Suppose data is in /path/to/mydata/tile.tif In the need of supporting footprints into a different location, users should replicate that path within a common folder and define that common folder through the "FOOTPRINTS_DATA_DIR" system property.

    As an instance, users may put a tile.wkb into /footprints/path/to/mydata/tile.wkb having specified -DFOOTPRINTS_DATA_DIR=/footprints at startup.

    Author:
    Andrea Aime - GeoSolutions, Daniele Romagnoli - GeoSolutions
    See Also:
    MultiLevelROIProviderFactory#FOOTPRINTS_DATA_DIR_KEY
    • Field Detail

      • FOOTPRINTS_DATA_DIR_KEY

        public static final String FOOTPRINTS_DATA_DIR_KEY
        String associated to the footprints data directory property
        See Also:
        Constant Field Values
    • Constructor Detail

      • SidecarFootprintProvider

        public SidecarFootprintProvider​(File reference)
    • Method Detail

      • getFootprint

        public Geometry getFootprint​(SimpleFeature feature)
                              throws IOException
        Description copied from interface: FootprintGeometryProvider
        Retrieves the footprint. If a feature is specified, return the footprint from the current granule representative feature as it comes from the index.
        Specified by:
        getFootprint in interface FootprintGeometryProvider
        Parameters:
        feature - the granule representative feature (if any). Specifying a null feature will return a default footprint (this is used in general for single-granule stores)
        Throws:
        IOException
      • getFootprint

        public Geometry getFootprint​(String path)
                              throws IOException
        Return the footprint (if any) for a file referred by its path
        Throws:
        IOException
      • getAlternativeFile

        public static File getAlternativeFile​(File file)
      • getFootprintsDataDir

        public static String getFootprintsDataDir()
      • getSidecars

        public List<File> getSidecars​(SimpleFeature feature)
                               throws IOException
        Description copied from interface: FootprintGeometryProvider
        Returns the list of sidecar files defining masks for the specified feature. The default implementation returns an empty list.
        Specified by:
        getSidecars in interface FootprintGeometryProvider
        Parameters:
        feature - the granule representative feature (if any)
        Returns:
        A list of files defining the masks for this granule (might be more than one)
        Throws:
        IOException
      • getSidecars

        public List<File> getSidecars​(String path)
                               throws IOException
        Throws:
        IOException