All Implemented Interfaces:
AutoCloseable, ResourceOnFileSystem, StoreResource, DataSet, FeatureSet, Resource, Localized
Direct Known Subclasses:
WritableStore

public class Store extends StaxDataStore implements FeatureSet
A data store backed by GPX files. This store does not cache the feature instances. Any new request for features will re-read from the file.
Since:
0.8
Version:
1.3
Author:
Johann Sorel (Geomatys), Martin Desruisseaux (Geomatys)
  • Constructor Details

  • Method Details

    • getVersion

      public Version getVersion() throws DataStoreException
      Returns the GPX file version.
      Returns:
      the GPX file version, or null if none.
      Throws:
      DataStoreException - if an error occurred while reading the metadata.
    • setVersion

      public void setVersion(Version version) throws DataStoreException
      Sets the version of the file to write.
      Parameters:
      version - the target GPX file format.
      Throws:
      DataStoreException - if an error occurred while setting the format.
    • getMetadata

      public org.opengis.metadata.Metadata getMetadata() throws DataStoreException
      Returns information about the dataset as a whole.
      Specified by:
      getMetadata in interface Resource
      Specified by:
      getMetadata in class DataStore
      Returns:
      information about the dataset, or null if none.
      Throws:
      DataStoreException - if an error occurred while reading the metadata.
      See Also:
    • getEnvelope

      public Optional<org.opengis.geometry.Envelope> getEnvelope() throws DataStoreException
      Returns the spatiotemporal envelope of this resource.
      Specified by:
      getEnvelope in interface DataSet
      Returns:
      the spatiotemporal resource extent.
      Throws:
      DataStoreException - if an error occurred while reading or computing the envelope.
    • getType

      public DefaultFeatureType getType()
      Returns the base type of all GPX types.
      Specified by:
      getType in interface FeatureSet
      Returns:
      base type of all GPX types.
    • getFeatureType

      @Deprecated public DefaultFeatureType getFeatureType(String name) throws IllegalNameException
      Deprecated.
      We are not sure yet if we will keep this method. Decision is pending acquisition of more experience with the API proposed by FeatureSet.
      Returns the feature type for the given name. The name argument should be the result of calling GenericName.toString() on the name of one of the feature types in this data store.
      Parameters:
      name - the name or alias of the feature type to get.
      Returns:
      the feature type of the given name or alias (never null).
      Throws:
      IllegalNameException - if the given name was not found or is ambiguous.
    • features

      public final Stream<AbstractFeature> features(boolean parallel) throws DataStoreException
      Returns the stream of features. This store does not cache the features. Any new iteration over features will re-read from the file. The XML file is kept open until the feature stream is closed; callers should not modify the file while an iteration is in progress.
      Specified by:
      features in interface FeatureSet
      Parameters:
      parallel - ignored in current implementation.
      Returns:
      a stream over all features in the XML file.
      Throws:
      DataStoreException - if an error occurred while creating the feature stream.
    • close

      public void close() throws DataStoreException
      Closes this data store and releases any underlying resources.
      Specified by:
      close in interface AutoCloseable
      Overrides:
      close in class StaxDataStore
      Throws:
      DataStoreException - if an error occurred while closing this data store.
      See Also: