use-geo-coordinate 0.1.0

Primitive geographic coordinate vocabulary for RustUse
Documentation
  • Coverage
  • 11.11%
    3 out of 27 items documented1 out of 18 items with examples
  • Size
  • Source code size: 11.76 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 760.45 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 4s Average build duration of successful builds.
  • all releases: 4s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • RustUse/use-geography
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

use-geo-coordinate

Primitive geographic coordinate vocabulary for RustUse.

use-geo-coordinate provides small Earth-oriented coordinate primitives such as latitude, longitude, geographic coordinates, coordinate pairs, and coordinate format labels.

Scope

  • latitude and longitude validation for Earth-oriented coordinates
  • simple coordinate pair composition
  • descriptive coordinate format vocabulary

Non-goals

  • geodesic calculations
  • projection conversion
  • routing behavior
  • geometry-engine primitives

Example

use use_geo_coordinate::{CoordinateFormat, CoordinatePair, GeoCoordinate, Latitude, Longitude};

# fn main() -> Result<(), Box<dyn std::error::Error>> {
let latitude = Latitude::new(51.5074)?;
let longitude = Longitude::new(-0.1278)?;
let pair = CoordinatePair::new(latitude, longitude);
let coordinate = GeoCoordinate::from(pair);

assert_eq!(coordinate.latitude(), latitude);
assert_eq!(coordinate.longitude(), longitude);
assert_eq!(CoordinateFormat::DegreesMinutesSeconds.to_string(), "degrees-minutes-seconds");
# Ok(())
# }