Package edu.ucsb.nceas.metacat.spatial
Class SpatialDataset
java.lang.Object
edu.ucsb.nceas.metacat.spatial.SpatialDataset
Class providing direct read/write access to the
persistent spatial cache.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a new feature (from a SpatialDocument) This is faster than insertOrUpdate but relying on this method might cause duplication of docids in the spatial cache.void
Deletes given docid from the spatial cache.void
insertOrUpdate
(String geomType, org.opengis.feature.simple.SimpleFeature feature, String docid) Either inserts or updates the spatial cache with the new spatial document depending on if it currently exists.void
save()
Saves the SpatialDataset object to the spatial cache.
-
Constructor Details
-
SpatialDataset
empty constructor for SpatialDataset- Throws:
IOException
-
-
Method Details
-
add
Adds a new feature (from a SpatialDocument) This is faster than insertOrUpdate but relying on this method might cause duplication of docids in the spatial cache. Therefore, its really only useful when regenerating the entire cache.- Parameters:
geomType
- The kind of feature to be added. Currently "polygon" and "point" supported.feature
- The geotools feature to be added to the spatial cache.
-
delete
Deletes given docid from the spatial cache.- Parameters:
geomType
- The kind of feature to be added. Currently "polygon" and "point" supported.docid
- The document to be deleted from the spatial cache.- Throws:
IOException
-
insertOrUpdate
public void insertOrUpdate(String geomType, org.opengis.feature.simple.SimpleFeature feature, String docid) throws IOException Either inserts or updates the spatial cache with the new spatial document depending on if it currently exists. Docid is also passed in for quicker searching.- Parameters:
geomType
- The kind of feature to be added. Currently "polygon" and "point" supported.feature
- The geotools feature to be added to the spatial cache.docid
- The document id to be inserted or updated. Used to filter for existing features.- Throws:
IOException
-
save
public void save()Saves the SpatialDataset object to the spatial cache.
-