Show / Hide Table of Contents

    Class GpxMetadata

    Represents metadata about a GPX document.

    Inheritance
    Object
    GpxMetadata
    Inherited Members
    Object.Equals(Object, Object)
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    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 Source

    GpxMetadata(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

    creator is null.

    | Improve this Doc View Source

    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

    creator is null.

    Properties

    | Improve this Doc View Source

    Author

    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.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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.

    The value, if present, will have its Kind set to Utc.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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
    ConvertMetadataExtensionElement(IEnumerable<XElement>)
    ConvertMetadataExtension(Object)
    | Improve this Doc View Source

    IsTrivial

    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.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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 Source

    Equals(Object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    Object obj
    Returns
    Type Description
    Boolean
    Overrides
    Object.Equals(Object)
    | Improve this Doc View Source

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    Int32
    Overrides
    Object.GetHashCode()
    | Improve this Doc View Source

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    String
    Overrides
    Object.ToString()
    | Improve this Doc View Source

    WithAuthor(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 author.

    | Improve this Doc View Source

    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 bounds.

    | Improve this Doc View Source

    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 copyright.

    | Improve this Doc View Source

    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 creationTimeUtc.

    | Improve this Doc View Source

    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 creator.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown when creator is null.

    | Improve this Doc View Source

    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 description.

    | Improve this Doc View Source

    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 extensions.

    | Improve this Doc View Source

    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 keywords.

    | Improve this Doc View Source

    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 links.

    | Improve this Doc View Source

    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 name.

    • Improve this Doc
    • View Source
    Back to top Generated by DocFX