Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update edition, metadata, README, dependencies #51

Merged
merged 2 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

* Speed up encode function (now runs in ~72% less time / 3.5x improvement):
* https://github.com/georust/polyline/pull/42
* BREAKING: Return typed errors rather than String
* Performance improvements
* 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

Expand Down
7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
name = "polyline"
description = "Encoder and decoder for the Google Encoded Polyline format"
version = "0.10.2"
authors = ["Tom MacWright <[email protected]>", "The GeoRust Developers <[email protected]>"]
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"
Expand Down
25 changes: 19 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.