Class SidecarFootprintProvider
- Object
-
- 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 Summary
Fields Modifier and Type Field Description static String
FOOTPRINTS_DATA_DIR_KEY
String associated to the footprints data directory property
-
Constructor Summary
Constructors Constructor Description SidecarFootprintProvider(File reference)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
Close up the provider (in case it holds onto persistent resources such as files or database connections)static File
getAlternativeFile(File file)
Geometry
getFootprint(String path)
Return the footprint (if any) for a file referred by its pathGeometry
getFootprint(SimpleFeature feature)
Retrieves the footprint.static String
getFootprintsDataDir()
List<File>
getSidecars(String path)
List<File>
getSidecars(SimpleFeature feature)
Returns the list of sidecar files defining masks for the specified feature.
-
-
-
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 interfaceFootprintGeometryProvider
- 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
-
dispose
public void dispose()
Description copied from interface:FootprintGeometryProvider
Close up the provider (in case it holds onto persistent resources such as files or database connections)- Specified by:
dispose
in interfaceFootprintGeometryProvider
-
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 interfaceFootprintGeometryProvider
- 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
-
-