From 01ca2f5f833aa40affd482676df5a34422b10f1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20H=C3=BCgel?= Date: Mon, 13 May 2024 15:18:52 +0100 Subject: [PATCH] Update README, metadata, and edition --- CHANGELOG.md | 5 +++++ Cargo.toml | 7 ++++--- README.md | 25 +++++++++++++++++++------ 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bdabad2..d641284 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ * Speed up encode function (now runs in ~72% less time / 3.5x improvement): * https://github.com/georust/polyline/pull/42 +* Add structured errors and more speedups + * https://github.com/georust/polyline/pull/48 + * https://github.com/georust/polyline/pull/50 +* Update to 2021 edition, README, metadata and dependency updates + * https://github.com/georust/polyline/pull/51 ## 0.10.2 diff --git a/Cargo.toml b/Cargo.toml index 0395177..cf91e86 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,12 +2,13 @@ name = "polyline" description = "Encoder and decoder for the Google Encoded Polyline format" version = "0.10.2" -authors = ["Tom MacWright ", "The GeoRust Developers "] repository = "https://github.com/georust/polyline" +documentation = "https://docs.rs/polyline/" readme = "README.md" -keywords = ["polyline", "geo"] +keywords = ["polyline", "geo", "gis"] license = "MIT/Apache-2.0" -edition = "2018" +edition = "2021" +categories = ["science::geo"] [dependencies] geo-types = "0.7.8" diff --git a/README.md b/README.md index b631450..659c796 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,28 @@ # polyline -[![Crates.io](https://img.shields.io/crates/d/polyline.svg?maxAge=2592000?style=plastic)](https://crates.io/crates/polyline) -[![Build Status](https://travis-ci.org/georust/polyline.svg?branch=master)](https://travis-ci.org/georust/polyline) +[![polyline](https://avatars1.githubusercontent.com/u/10320338?v=4&s=50)](https://github.com/georust) -Google Encoded Polyline encoding & decoding in Rust. +[![polyline on Crates.io](https://img.shields.io/crates/v/polyline.svg?color=brightgreen)](https://crates.io/crates/polyline) +[![Documentation](https://img.shields.io/docsrs/polyline/latest.svg)](https://docs.rs/polyline) +[![Discord](https://img.shields.io/discord/598002550221963289)](https://discord.gg/Fp2aape) -## A Note on Coordinate Order +Fast Google Encoded Polyline encoding & decoding in Rust. -This crate uses `Coord` and `LineString` types from the `geo-types` crate, which encodes coordinates in `(x, y)` order. The Polyline algorithm and first-party documentation assumes the _opposite_ coordinate order. It is thus advisable to pay careful attention to the order of the coordinates you use for encoding and decoding. +# Example +```rust +use polyline; +use geo_types::line_string; +let coord = line_string![(x: -120.2, y: 38.5), (x: -120.95, y: 40.7), (x: -126.453, y: 43.252)]; +let output = "_p~iF~ps|U_ulLnnqC_mqNvxq`@"; +let result = polyline::encode_coordinates(coord, 5).unwrap(); +assert_eq!(result, output) +``` + +# A Note on Coordinate Order + +This crate uses `Coord` and `LineString` types from the `geo-types` crate, which encodes coordinates in `(x, y)` / `(lon, lat)` order. The Polyline algorithm and its first-party documentation assumes the _opposite_ coordinate order. It is thus advisable to pay careful attention to the order of the coordinates you use for encoding and decoding. [Documentation](https://docs.rs/polyline/) -## FFI +# FFI C-compatible FFI bindings for this crate are provided by the [polyline-ffi](https://crates.io/crates/polyline-ffi) crate.