Class GpxFile
A container that holds all the individual pieces of a GPX file and contains helper methods to (somwehat) easily read / write them on-the-fly.
Inherited Members
Namespace: NetTopologySuite.IO
Assembly: NetTopologySuite.IO.GPX.dll
Syntax
public sealed class GpxFile
Properties
| Improve this Doc View SourceExtensions
Gets or sets the top-level extensions for the entire file.
Declaration
public object Extensions { get; set; }
Property Value
| Type | Description |
|---|---|
| Object |
Metadata
Gets or sets the GpxMetadata instance that describes the contents of this GPX file.
Declaration
public GpxMetadata Metadata { get; set; }
Property Value
| Type | Description |
|---|---|
| GpxMetadata |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown by the property setter, when trying to set the value to null. |
Routes
Gets the list of GpxRoute instances that describe the routes contained in this GPX file.
Declaration
public List<GpxRoute> Routes { get; }
Property Value
| Type | Description |
|---|---|
| List<GpxRoute> |
Tracks
Gets the list of GpxTrack instances that describe the tracks contained in this GPX file.
Declaration
public List<GpxTrack> Tracks { get; }
Property Value
| Type | Description |
|---|---|
| List<GpxTrack> |
Waypoints
Gets the list of GpxWaypoint instances that describe the top-level waypoints in this GPX file.
Declaration
public List<GpxWaypoint> Waypoints { get; }
Property Value
| Type | Description |
|---|---|
| List<GpxWaypoint> |
Methods
| Improve this Doc View SourceBuildString(GpxWriterSettings)
Builds the string representation of this file.
Declaration
public string BuildString(GpxWriterSettings settings)
Parameters
| Type | Name | Description |
|---|---|---|
| GpxWriterSettings | settings | The GpxWriterSettings instance to use to control how GPX instances get
written out, or |
Returns
| Type | Description |
|---|---|
| String | The string representation of this file. |
Parse(String, GpxReaderSettings)
Reads the XML representation of a GPX file, and returns the result as an instance of GpxFile.
Declaration
public static GpxFile Parse(string text, GpxReaderSettings settings)
Parameters
| Type | Name | Description |
|---|---|---|
| String | text | The string representation of the GPX file. |
| GpxReaderSettings | settings | The GpxReaderSettings instance to use to control how GPX instances get
read in, or |
Returns
| Type | Description |
|---|---|
| GpxFile | A GpxFile instance that contains the same contents as the given GPX file. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown when |
| XmlException | Thrown when |
ReadFrom(XmlReader, GpxReaderSettings)
Reads the XML representation of a GPX file, and returns the result as an instance of GpxFile.
Declaration
public static GpxFile ReadFrom(XmlReader reader, GpxReaderSettings settings)
Parameters
| Type | Name | Description |
|---|---|---|
| XmlReader | reader | The XmlReader to read from. |
| GpxReaderSettings | settings | The GpxReaderSettings instance to use to control how GPX instances get
read in, or |
Returns
| Type | Description |
|---|---|
| GpxFile | A GpxFile instance that contains the same contents as the given GPX file. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown when |
| XmlException | Thrown when |
WriteTo(XmlWriter, GpxWriterSettings)
Writes this file to an XmlWriter.
Declaration
public void WriteTo(XmlWriter writer, GpxWriterSettings settings)
Parameters
| Type | Name | Description |
|---|---|---|
| XmlWriter | writer | The XmlWriter to write to. |
| GpxWriterSettings | settings | The GpxWriterSettings instance to use to control how GPX instances get
written out, or |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown when |