Class Metadata

java.lang.Object
org.apache.sis.internal.simple.SimpleMetadata
org.apache.sis.internal.storage.gpx.Metadata
All Implemented Interfaces:
org.opengis.metadata.citation.Citation, org.opengis.metadata.identification.DataIdentification, org.opengis.metadata.identification.Identification, org.opengis.metadata.Metadata

public final class Metadata extends SimpleMetadata
Information about the GPX file, author, and copyright restrictions. This is the root of the <metadata> element in a GPX file. At most one such element may appear in the document. The XML content is like below: Those properties can be read or modified directly. All methods defined in this class are bridges to the ISO 19115 metadata model and can be ignored if the user only wants to manipulate the GPX model.
Since:
0.8
Version:
1.1
  • Field Details

    • store

      Store store
      The data store that created this metadata, or null if none. This information is used for fetching information that are constants for all GPX files, for example the feature types and the format description.

      This field needs to be set after construction. It cannot be set at construction time because JAXB needs to invoke a no-argument constructor.

    • creator

      public String creator
      The creator of the GPX file. The creator is a property of the GPX node; it is not part of the content marshalled in a GPX <metadata> element.
    • name

      public String name
      The name of the GPX file.
      See Also:
    • description

      public String description
      A description of the contents of the GPX file.
      See Also:
    • author

      public Person author
      The person or organization who created the GPX file.
      See Also:
    • time

      public Date time
      The creation date of the file.
      See Also:
    • keywords

      public List<String> keywords
      Keywords associated with the file, or null if unspecified. Search engines or databases can use this information to classify the data.
      See Also:
    • bounds

      public Bounds bounds
      Minimum and maximum coordinates which describe the extent of the coordinates in the file. The GPX 1.1 specification restricts the coordinate reference system to WGS84.
      See Also:
    • format

      private org.opengis.metadata.distribution.Format format
      The format returned by getResourceFormats(), created when first needed.
      See Also:
  • Constructor Details

    • Metadata

      public Metadata()
      Creates an initially empty metadata object.
    • Metadata

      Metadata(org.opengis.metadata.Metadata md, Locale locale)
      Copies properties from the given ISO 19115 metadata. If a property has more than one value, only the first one will be retained (except for links and keywords where multi-values are allowed).
  • Method Details

    • castOrCopy

      public static Metadata castOrCopy(org.opengis.metadata.Metadata md, Locale locale)
      Returns the given ISO 19115 metadata as a Metadata instance. This method copies the data only if needed.
      Parameters:
      md - the ISO 19115 metadata, or null.
      locale - the locale to use for localized strings.
      Returns:
      the GPX metadata, or null.
    • getTitle

      public org.opengis.util.InternationalString getTitle()
      ISO 19115 metadata property determined by the name field. This is part of the information returned by SimpleMetadata.getCitation().
      Specified by:
      getTitle in interface org.opengis.metadata.citation.Citation
      Overrides:
      getTitle in class SimpleMetadata
      Returns:
      the cited resource name.
    • getAbstract

      public org.opengis.util.InternationalString getAbstract()
      ISO 19115 metadata property determined by the description field. This is part of the information returned by SimpleMetadata.getIdentificationInfo().
      Specified by:
      getAbstract in interface org.opengis.metadata.identification.Identification
      Overrides:
      getAbstract in class SimpleMetadata
      Returns:
      brief narrative summary of the resource.
    • getDescriptiveKeywords

      public Collection<org.opengis.metadata.identification.Keywords> getDescriptiveKeywords()
      ISO 19115 metadata property determined by the keywords field. This is part of the information returned by SimpleMetadata.getIdentificationInfo().
      Specified by:
      getDescriptiveKeywords in interface org.opengis.metadata.identification.Identification
      Overrides:
      getDescriptiveKeywords in class SimpleMetadata
      Returns:
      category keywords, their type, and reference source.
    • getPointOfContacts

      public Collection<org.opengis.metadata.citation.ResponsibleParty> getPointOfContacts()
      ISO 19115 metadata property determined by the author field. This is part of the information returned by SimpleMetadata.getIdentificationInfo().
      Specified by:
      getPointOfContacts in interface org.opengis.metadata.identification.Identification
      Overrides:
      getPointOfContacts in class SimpleMetadata
      Returns:
      means of communication with person(s) and organisations(s) associated with the resource.
    • getResourceConstraints

      public Collection<org.opengis.metadata.constraint.Constraints> getResourceConstraints()
      ISO 19115 metadata property determined by the copyright field. This is part of the information returned by SimpleMetadata.getIdentificationInfo().
      Specified by:
      getResourceConstraints in interface org.opengis.metadata.identification.Identification
      Overrides:
      getResourceConstraints in class SimpleMetadata
      Returns:
      constraints which apply to the resource(s).
    • getExtents

      public Collection<org.opengis.metadata.extent.Extent> getExtents()
      ISO 19115 metadata property determined by the bounds field. This is part of the information returned by SimpleMetadata.getIdentificationInfo().
      Specified by:
      getExtents in interface org.opengis.metadata.identification.DataIdentification
      Overrides:
      getExtents in class SimpleMetadata
      Returns:
      spatial and temporal extent of the resource.
    • getReferenceSystemInfo

      public Collection<org.opengis.referencing.ReferenceSystem> getReferenceSystemInfo()
      Description of the spatial and temporal reference systems used in the dataset. This is fixed to WGS 84 in GPX files. We use (latitude, longitude) axis order.
      Specified by:
      getReferenceSystemInfo in interface org.opengis.metadata.Metadata
      Overrides:
      getReferenceSystemInfo in class SimpleMetadata
      Returns:
      WGS 84 (EPSG:4326).
    • getDates

      public Collection<org.opengis.metadata.citation.CitationDate> getDates()
      ISO 19115 metadata property determined by the time field. This is part of the information returned by SimpleMetadata.getCitation().
      Specified by:
      getDates in interface org.opengis.metadata.citation.Citation
      Overrides:
      getDates in class SimpleMetadata
      Returns:
      reference dates for the cited resource.
    • getContentInfo

      public Collection<org.opengis.metadata.content.ContentInformation> getContentInfo()
      Names of features types available for the GPX format, or an empty list if none. This property is not part of metadata described in GPX file; it is rather a hard-coded value shared by all GPX files. Users could however filter the list of features, for example with only routes and no tracks.
      Specified by:
      getContentInfo in interface org.opengis.metadata.Metadata
      Overrides:
      getContentInfo in class SimpleMetadata
      Returns:
      information about the feature characteristics.
    • getResourceFormats

      public Collection<org.opengis.metadata.distribution.Format> getResourceFormats()
      Description of the format of the resource(s). This is part of the information returned by SimpleMetadata.getIdentificationInfo().
      Specified by:
      getResourceFormats in interface org.opengis.metadata.identification.Identification
      Overrides:
      getResourceFormats in class SimpleMetadata
      Returns:
      description of the format of the resource(s).
    • equals

      public boolean equals(Object obj)
      Compares this Metadata with the given object for equality.
      Overrides:
      equals in class Object
      Parameters:
      obj - the object to compare with this Metadata.
      Returns:
      true if both objects are equal.
    • hashCode

      public int hashCode()
      Returns a hash code value for this Metadata.
      Overrides:
      hashCode in class Object
      Returns:
      a hash code value.
    • toString

      public String toString()
      Returns a string representation of this metadata object.
      Overrides:
      toString in class Object
      Returns:
      a string representation of this metadata.
    • append

      private static void append(TableAppender table, String label, Object value)
      Appends a row to the given table if the given value is non-null.
      Parameters:
      table - the table where to append a row.
      label - the label.
      value - the value, or null if none.
    • append

      private static void append(TableAppender table, String label, List<?> values, String separator)
      Appends a multi-values to the given table if the given list is non-null.
      Parameters:
      table - the table where to append a row.
      label - the label.
      values - the values, or null if none.
      separator - the separator to insert between each value.
    • addIfNonNull

      static <T> List<T> addIfNonNull(List<T> list, T element)
      Adds the given element to the given list if non null, or do nothing otherwise. This is a convenience method for storing <link> elements in way points, routes or tracks among others.
      Parameters:
      list - the list where to add the element, or null if not yet created.
      element - the element to add, or null if none.
      Returns:
      the list where the element has been added.