Class GpxMetadata
Represents metadata about a GPX document.
Inherited Members
Namespace: NetTopologySuite.IO
Assembly: NetTopologySuite.IO.GPX.dll
Syntax
public sealed class GpxMetadata
  Remarks
In the official XSD schema for GPX 1.1, this corresponds to the complex type "metadataType", plus the "creator" attribute from the complex type "gpxType".
Constructors
| Improve this Doc View SourceGpxMetadata(String)
Initializes a new instance of the GpxMetadata class.
Declaration
public GpxMetadata(string creator)
  Parameters
| Type | Name | Description | 
|---|---|---|
| String | creator | The value for Creator.  | 
      
Remarks
IsTrivial will always be true for instances initialized using this constructor.
Exceptions
| Type | Condition | 
|---|---|
| ArgumentNullException | 
  | 
      
GpxMetadata(String, String, String, GpxPerson, GpxCopyright, ImmutableArray<GpxWebLink>, Nullable<DateTime>, String, GpxBoundingBox, Object)
Initializes a new instance of the GpxMetadata class.
Declaration
public GpxMetadata(string creator, string name, string description, GpxPerson author, GpxCopyright copyright, ImmutableArray<GpxWebLink> links, DateTime? creationTimeUtc, string keywords, GpxBoundingBox bounds, object extensions)
  Parameters
| Type | Name | Description | 
|---|---|---|
| String | creator | The value for Creator.  | 
      
| String | name | The value for Name.  | 
      
| String | description | The value for Description.  | 
      
| GpxPerson | author | The value for Author.  | 
      
| GpxCopyright | copyright | The value for Copyright.  | 
      
| ImmutableArray<GpxWebLink> | links | The value for Links.  | 
      
| Nullable<DateTime> | creationTimeUtc | The value for CreationTimeUtc.  | 
      
| String | keywords | The value for Keywords.  | 
      
| GpxBoundingBox | bounds | The value for Bounds.  | 
      
| Object | extensions | The value for Extensions.  | 
      
Remarks
IsTrivial will be false for instances initialized using
this constructor, unless links contains no elements and all other
parameters besides creator are null.
Exceptions
| Type | Condition | 
|---|---|
| ArgumentNullException | 
  | 
      
Properties
| Improve this Doc View SourceAuthor
Gets an optional representation of the person who created this GPX file.
Declaration
public GpxPerson Author { get; }
  Property Value
| Type | Description | 
|---|---|
| GpxPerson | 
Remarks
In the official XSD schema for GPX 1.1, this corresponds to the "author" element.
Bounds
Gets an optional representation of the lat/lon extents covered by this GPX file.
Declaration
public GpxBoundingBox Bounds { get; }
  Property Value
| Type | Description | 
|---|---|
| GpxBoundingBox | 
Remarks
In the official XSD schema for GPX 1.1, this corresponds to the "bounds" element.
The system does not currently validate that this value is an accurate representation of the extents of the contents of a GPX file.
Copyright
Gets an optional representation of the copyright that this GPX file was created under.
Declaration
public GpxCopyright Copyright { get; }
  Property Value
| Type | Description | 
|---|---|
| GpxCopyright | 
Remarks
In the official XSD schema for GPX 1.1, this corresponds to the "copyright" element.
CreationTimeUtc
Gets an optional timestamp indicating when this GPX file was created.
Declaration
public DateTime? CreationTimeUtc { get; }
  Property Value
| Type | Description | 
|---|---|
| Nullable<DateTime> | 
Remarks
In the official XSD schema for GPX 1.1, this corresponds to the "time" element.
Creator
Gets the creator of this GPX document.
Declaration
public string Creator { get; }
  Property Value
| Type | Description | 
|---|---|
| String | 
Remarks
In the official XSD schema for GPX 1.1, this corresponds to the "creator" attribute of the top-level "gpx" element.
Description
Gets an optional description of the contents of this GPX file.
Declaration
public string Description { get; }
  Property Value
| Type | Description | 
|---|---|
| String | 
Remarks
In the official XSD schema for GPX 1.1, this corresponds to the "desc" element.
Extensions
Gets an optional representation of arbitrary data associated with the metadata of this GPX file.
Declaration
public object Extensions { get; }
  Property Value
| Type | Description | 
|---|---|
| Object | 
Remarks
In the official XSD schema for GPX 1.1, this corresponds to the "extensions" element.
This contains the extension content of the "metadata" element itself, not the extension content of the outermost "gpx" element.
See Also
| Improve this Doc View SourceIsTrivial
Gets a value indicating whether or not Creator is the only relevant data element. Used to determine when we can skip writing out a "metadata" element.
Declaration
public bool IsTrivial { get; }
  Property Value
| Type | Description | 
|---|---|
| Boolean | 
Remarks
This behavior is not completely round-trip safe. An instance loaded from XML that has a bare "metadata" element without any content will look the same as an instance that had no "metadata" element at all. It will be written out without a "metadata" element.
Keywords
Gets an optional list of keywords associated with this GPX file.
Declaration
public string Keywords { get; }
  Property Value
| Type | Description | 
|---|---|
| String | 
Remarks
In the official XSD schema for GPX 1.1, this corresponds to the "keywords" element.
GPX does not define, by construction, how this string should be built when multiple keywords exist, so check with your provider / consumer what convention to use.
Links
Gets a representation of URLs associated with the contents of this GPX file.
Declaration
public ImmutableArray<GpxWebLink> Links { get; }
  Property Value
| Type | Description | 
|---|---|
| ImmutableArray<GpxWebLink> | 
Remarks
In the official XSD schema for GPX 1.1, this corresponds to the "link" elements.
Name
Gets an optional name for this GPX file.
Declaration
public string Name { get; }
  Property Value
| Type | Description | 
|---|---|
| String | 
Remarks
In the official XSD schema for GPX 1.1, this corresponds to the "name" element.
Methods
| Improve this Doc View SourceEquals(Object)
Declaration
public override bool Equals(object obj)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Object | obj | 
Returns
| Type | Description | 
|---|---|
| Boolean | 
Overrides
| Improve this Doc View SourceGetHashCode()
Declaration
public override int GetHashCode()
  Returns
| Type | Description | 
|---|---|
| Int32 | 
Overrides
| Improve this Doc View SourceToString()
Declaration
public override string ToString()
  Returns
| Type | Description | 
|---|---|
| String | 
Overrides
| Improve this Doc View SourceWithAuthor(GpxPerson)
Builds a new instance of GpxMetadata as a copy of this instance, but with Author replaced by the given value.
Declaration
public GpxMetadata WithAuthor(GpxPerson author)
  Parameters
| Type | Name | Description | 
|---|---|---|
| GpxPerson | author | The new value for Author.  | 
      
Returns
| Type | Description | 
|---|---|
| GpxMetadata | A new GpxMetadata instance that's a copy of the current instance, but
with its Author value set to   | 
      
WithBounds(GpxBoundingBox)
Builds a new instance of GpxMetadata as a copy of this instance, but with Bounds replaced by the given value.
Declaration
public GpxMetadata WithBounds(GpxBoundingBox bounds)
  Parameters
| Type | Name | Description | 
|---|---|---|
| GpxBoundingBox | bounds | The new value for Bounds.  | 
      
Returns
| Type | Description | 
|---|---|
| GpxMetadata | A new GpxMetadata instance that's a copy of the current instance, but
with its Bounds value set to   | 
      
WithCopyright(GpxCopyright)
Builds a new instance of GpxMetadata as a copy of this instance, but with Copyright replaced by the given value.
Declaration
public GpxMetadata WithCopyright(GpxCopyright copyright)
  Parameters
| Type | Name | Description | 
|---|---|---|
| GpxCopyright | copyright | The new value for Copyright.  | 
      
Returns
| Type | Description | 
|---|---|
| GpxMetadata | A new GpxMetadata instance that's a copy of the current instance, but
with its Copyright value set to   | 
      
WithCreationTimeUtc(Nullable<DateTime>)
Builds a new instance of GpxMetadata as a copy of this instance, but with CreationTimeUtc replaced by the given value.
Declaration
public GpxMetadata WithCreationTimeUtc(DateTime? creationTimeUtc)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Nullable<DateTime> | creationTimeUtc | The new value for CreationTimeUtc.  | 
      
Returns
| Type | Description | 
|---|---|
| GpxMetadata | A new GpxMetadata instance that's a copy of the current instance, but
with its CreationTimeUtc value set to   | 
      
WithCreator(String)
Builds a new instance of GpxMetadata as a copy of this instance, but with Creator replaced by the given value.
Declaration
public GpxMetadata WithCreator(string creator)
  Parameters
| Type | Name | Description | 
|---|---|---|
| String | creator | The new value for Creator.  | 
      
Returns
| Type | Description | 
|---|---|
| GpxMetadata | A new GpxMetadata instance that's a copy of the current instance, but
with its Creator value set to   | 
      
Exceptions
| Type | Condition | 
|---|---|
| ArgumentNullException | Thrown when   | 
      
WithDescription(String)
Builds a new instance of GpxMetadata as a copy of this instance, but with Description replaced by the given value.
Declaration
public GpxMetadata WithDescription(string description)
  Parameters
| Type | Name | Description | 
|---|---|---|
| String | description | The new value for Description.  | 
      
Returns
| Type | Description | 
|---|---|
| GpxMetadata | A new GpxMetadata instance that's a copy of the current instance, but
with its Description value set to   | 
      
WithExtensions(Object)
Builds a new instance of GpxMetadata as a copy of this instance, but with Extensions replaced by the given value.
Declaration
public GpxMetadata WithExtensions(object extensions)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Object | extensions | The new value for Extensions.  | 
      
Returns
| Type | Description | 
|---|---|
| GpxMetadata | A new GpxMetadata instance that's a copy of the current instance, but
with its Extensions value set to   | 
      
WithKeywords(String)
Builds a new instance of GpxMetadata as a copy of this instance, but with Keywords replaced by the given value.
Declaration
public GpxMetadata WithKeywords(string keywords)
  Parameters
| Type | Name | Description | 
|---|---|---|
| String | keywords | The new value for Keywords.  | 
      
Returns
| Type | Description | 
|---|---|
| GpxMetadata | A new GpxMetadata instance that's a copy of the current instance, but
with its Keywords value set to   | 
      
WithLinks(ImmutableArray<GpxWebLink>)
Builds a new instance of GpxMetadata as a copy of this instance, but with Links replaced by the given value.
Declaration
public GpxMetadata WithLinks(ImmutableArray<GpxWebLink> links)
  Parameters
| Type | Name | Description | 
|---|---|---|
| ImmutableArray<GpxWebLink> | links | The new value for Links.  | 
      
Returns
| Type | Description | 
|---|---|
| GpxMetadata | A new GpxMetadata instance that's a copy of the current instance, but
with its Links value set to   | 
      
WithName(String)
Builds a new instance of GpxMetadata as a copy of this instance, but with Name replaced by the given value.
Declaration
public GpxMetadata WithName(string name)
  Parameters
| Type | Name | Description | 
|---|---|---|
| String | name | The new value for Name.  | 
      
Returns
| Type | Description | 
|---|---|
| GpxMetadata | A new GpxMetadata instance that's a copy of the current instance, but
with its Name value set to   |