gpxb

Types

pub type Coordinate {
  Coordinate(latitude: Float, longitude: Float)
}

Constructors

  • Coordinate(latitude: Float, longitude: Float)

    Arguments

    • latitude

      The latitude of the point. Decimal degrees, WGS84 datum.

      -90.0 <= value <= 90.0

    • longitude

      The longitude of the point. Decimal degrees, WGS84 datum.

      -180.0 <= value < 180.0

pub type Gpx {
  Gpx(
    metadata: Option(Metadata),
    waypoints: List(Waypoint),
    routes: List(Route),
    tracks: List(Track),
  )
}

Constructors

  • Gpx(
      metadata: Option(Metadata),
      waypoints: List(Waypoint),
      routes: List(Route),
      tracks: List(Track),
    )

A link to an external resource (Web page, digital photo, video clip, etc) with additional information.

pub type Link {
  Link(href: String, text: Option(String), type_: Option(String))
}

Constructors

  • Link(href: String, text: Option(String), type_: Option(String))

Information about the GPX file, author, and copyright restrictions goes in the metadata section. Providing rich, meaningful information about your GPX files allows others to search for and use your GPS data.

pub type Metadata {
  Metadata(
    name: Option(String),
    description: Option(String),
    author: Option(Person),
  )
}

Constructors

  • Metadata(
      name: Option(String),
      description: Option(String),
      author: Option(Person),
    )

A person or organization.

pub type Person {
  Person(
    name: Option(String),
    email: Option(String),
    link: Option(Link),
  )
}

Constructors

  • Person(
      name: Option(String),
      email: Option(String),
      link: Option(Link),
    )

An ordered series of waypoints representing a suggested series of turn points leading to a destination.

pub type Route {
  Route(
    name: Option(String),
    description: Option(String),
    source: Option(String),
    links: List(Link),
    waypoints: List(Waypoint),
  )
}

Constructors

  • Route(
      name: Option(String),
      description: Option(String),
      source: Option(String),
      links: List(Link),
      waypoints: List(Waypoint),
    )

    Arguments

    • source

      Source of data. Included to give user some idea of reliability and accuracy of data.

    • links

      Links to external information about the route.

    • waypoints

      The points of the route

Date and time in are in Univeral Coordinated Time (UTC), not local time!

Conforms to ISO 8601 specification for date/time representation. Fractional seconds are allowed for millisecond timing in tracklogs.

pub type Time {
  Time(
    year: Int,
    month: Int,
    day: Int,
    hour: Int,
    minute: Int,
    second: Int,
    millisecond: Int,
  )
}

Constructors

  • Time(
      year: Int,
      month: Int,
      day: Int,
      hour: Int,
      minute: Int,
      second: Int,
      millisecond: Int,
    )

An ordered series of points describing a path that has been taken.

pub type Track {
  Track(
    name: Option(String),
    description: Option(String),
    source: Option(String),
    links: List(Link),
    segments: List(TrackSegment),
  )
}

Constructors

  • Track(
      name: Option(String),
      description: Option(String),
      source: Option(String),
      links: List(Link),
      segments: List(TrackSegment),
    )

    Arguments

    • source

      Source of data. Included to give user some idea of reliability and accuracy of data.

    • links

      Links to external information about the route.

A Track Segment holds a list of Track Points which are logically connected in order. To represent a single GPS track where GPS reception was lost, or the GPS receiver was turned off, start a new TrackSegment for each continuous span of track data.

pub type TrackSegment {
  TrackSegment(waypoints: List(Waypoint))
}

Constructors

  • TrackSegment(waypoints: List(Waypoint))

A waypoint, point of interest, or named feature on a map.

pub type Waypoint {
  Waypoint(
    coordinate: Coordinate,
    name: Option(String),
    description: Option(String),
    time: Option(Time),
  )
}

Constructors

  • Waypoint(
      coordinate: Coordinate,
      name: Option(String),
      description: Option(String),
      time: Option(Time),
    )

    Arguments

    • time

      Creation/modification timestamp for element.

Functions

pub fn render(gpx: Gpx) -> StringBuilder
Search Document