Class SpatialDataset

java.lang.Object
edu.ucsb.nceas.metacat.spatial.SpatialDataset

public class SpatialDataset extends Object
Class providing direct read/write access to the persistent spatial cache.
  • Constructor Summary

    Constructors
    Constructor
    Description
    empty constructor for SpatialDataset
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(String geomType, org.opengis.feature.simple.SimpleFeature feature)
    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
    delete(String geomType, String docid)
    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
    Saves the SpatialDataset object to the spatial cache.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SpatialDataset

      public SpatialDataset() throws IOException
      empty constructor for SpatialDataset
      Throws:
      IOException
  • Method Details

    • add

      public void add(String geomType, org.opengis.feature.simple.SimpleFeature feature)
      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

      public void delete(String geomType, String docid) throws IOException
      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.