Show / Hide Table of Contents

    Class NetTopologySuiteGpxFeatureConverter

    Contains helper methods to convert back and forth between instances and the corresponding GPX data object.

    Inheritance
    Object
    NetTopologySuiteGpxFeatureConverter
    Inherited Members
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: NetTopologySuite.IO
    Assembly: NetTopologySuite.IO.GPX.dll
    Syntax
    public static class NetTopologySuiteGpxFeatureConverter

    Methods

    | Improve this Doc View Source

    ToFeature(GpxRoute, GeometryFactory)

    Creates a that contains the same data stored in a given GpxRoute.

    Declaration
    public static Feature ToFeature(GpxRoute route, GeometryFactory geometryFactory)
    Parameters
    Type Name Description
    GpxRoute route

    The GpxRoute source.

    GeometryFactory geometryFactory

    The to use to create the , or null to create a new one to use on-the-fly using the current .

    Returns
    Type Description
    Feature

    A that contains the same data as route.

    Remarks

    The values of will be populated with the values of the GpxRoute properties, even when null.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown when route is null

    | Improve this Doc View Source

    ToFeature(GpxTrack, GeometryFactory)

    Creates a that contains the same data stored in a given GpxTrack.

    Declaration
    public static Feature ToFeature(GpxTrack track, GeometryFactory geometryFactory)
    Parameters
    Type Name Description
    GpxTrack track

    The GpxTrack source.

    GeometryFactory geometryFactory

    The to use to create the , or null to create a new one to use on-the-fly using the current .

    Returns
    Type Description
    Feature

    A that contains the same data as track.

    Remarks

    The values of will be populated with the values of the GpxTrack properties, even when null.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown when track is null

    | Improve this Doc View Source

    ToFeature(GpxWaypoint, GeometryFactory)

    Creates a that contains the same data stored in a given GpxWaypoint.

    Declaration
    public static Feature ToFeature(GpxWaypoint waypoint, GeometryFactory geometryFactory)
    Parameters
    Type Name Description
    GpxWaypoint waypoint

    The GpxWaypoint source.

    GeometryFactory geometryFactory

    The to use to create the , or null to create a new one to use on-the-fly using the current .

    Returns
    Type Description
    Feature

    A that contains the same data as waypoint.

    Remarks

    The values of will be populated with the values of the GpxWaypoint properties, even when null, with exceptions:

    • Longitude goes to instead,
    • Latitude goes to instead, and
    • ElevationInMeters goes to instead (when it's set)
    Exceptions
    Type Condition
    ArgumentNullException

    Thrown when waypoint is null

    | Improve this Doc View Source

    ToGpxRoute(IFeature)

    Turns a into the GpxRoute instance that's equivalent to it.

    Declaration
    public static GpxRoute ToGpxRoute(IFeature feature)
    Parameters
    Type Name Description
    IFeature feature

    The to convert.

    Returns
    Type Description
    GpxRoute

    A more-or-less equivalent GpxRoute to feature.

    Remarks

    Values from with keys whose names match the names of properties of GpxRoute will be used to populate those corresponding property values.

    When the "Waypoints" attribute is populated in , its values will be used for Waypoints, and the will be ignored except to validate that it is, in fact, . Otherwise, waypoints will be built with only values for:

    • Longitude,
    • Latitude, and
    • ElevationInMeters (where is set).

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown when feature is null.

    ArgumentOutOfRangeException

    Thrown by GpxLongitude(Double) or GpxLatitude(Double).

    ArgumentException

    Thrown when feature's is not an instance of .

    | Improve this Doc View Source

    ToGpxTrack(IFeature)

    Turns a into the GpxTrack instance that's equivalent to it.

    Declaration
    public static GpxTrack ToGpxTrack(IFeature feature)
    Parameters
    Type Name Description
    IFeature feature

    The to convert.

    Returns
    Type Description
    GpxTrack

    A more-or-less equivalent GpxTrack to feature.

    Remarks

    Values from with keys whose names match the names of properties of GpxTrack will be used to populate those corresponding property values.

    When the "Segments" attribute is populated in , its values will be used for Segments, and the will be ignored except to validate that it is, in fact, . Otherwise, segments will be built without anything for Extensions, and whose waypoints only have these set:

    • Longitude,
    • Latitude, and
    • ElevationInMeters (if has the flag).

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown when feature is null.

    ArgumentOutOfRangeException

    Thrown by GpxLongitude(Double) or GpxLatitude(Double).

    ArgumentException

    Thrown when feature's is not an instance of .

    | Improve this Doc View Source

    ToGpxWaypoint(IFeature)

    Turns a into the GpxWaypoint instance that's equivalent to it.

    Declaration
    public static GpxWaypoint ToGpxWaypoint(IFeature feature)
    Parameters
    Type Name Description
    IFeature feature

    The to convert.

    Returns
    Type Description
    GpxWaypoint

    A more-or-less equivalent GpxWaypoint to feature.

    Remarks

    Values from with keys whose names match the names of properties of GpxWaypoint will be used to populate those corresponding property values, with a few exceptions:

    • Longitude comes from ,
    • Latitude comes from , and
    • ElevationInMeters comes from (when it's set)
    Exceptions
    Type Condition
    ArgumentNullException

    Thrown when feature is null.

    ArgumentOutOfRangeException

    Thrown by GpxLongitude(Double) or GpxLatitude(Double).

    ArgumentException

    Thrown when feature's is not an instance of .

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