Skip to content

Commit

Permalink
Update README, metadata, and edition
Browse files Browse the repository at this point in the history
  • Loading branch information
urschrei committed May 13, 2024
1 parent 09bc263 commit 01ca2f5
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 9 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

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 <tom@macwright.org>", "The GeoRust Developers <mods@georust.org>"]
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.

0 comments on commit 01ca2f5

Please sign in to comment.