Skip to content

Commit

Permalink
Merge wkt repo with history as /wkt dir
Browse files Browse the repository at this point in the history
This merges the entire history of the wkt repository from

https://github.com/georust/wkt/tree/dbd80f22099fc11ad69a1d072c3516f9a1ca4376

as a `/wkt` directory, and adds the CI and adds path links from Crates.toml files:
* wkt/Cargo.toml - link to `/geo-types`
* geo/tests/data/Cargo.toml - link to `/wkt`
* geo-test-fixtures/Cargo.toml - link to `/wkt`

TBD:
* should wkt path be added to the root `/Cargo.toml` (see comment in that file)
* does wkt CI need `rust-src` rust component?
  • Loading branch information
nyurik committed Mar 19, 2022
2 parents 62903e7 + eecc431 commit 3cffb9c
Show file tree
Hide file tree
Showing 23 changed files with 3,434 additions and 2 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
- geo_postgis
- geo_fuzz
- bench
- wkt
steps:
- name: Mark the job as a success
if: success()
Expand Down Expand Up @@ -161,3 +162,32 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2
- run: cargo bench --no-run

wkt:
name: wkt
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
defaults:
run:
working-directory: wkt
strategy:
matrix:
container_image:
# We aim to support rust-stable plus (at least) the prior 3 releases,
# giving us about 6 months of coverage.
#
# Minimum supported rust version (MSRV)
- "georust/geo-ci:rust-1.56"
# Two most recent releases - we omit older ones for expedient CI
- "georust/geo-ci:rust-1.58"
- "georust/geo-ci:rust-1.59"
container:
image: ${{ matrix.container_image }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- run: rustup component add rustfmt clippy # rust-src
- run: cargo fmt --all -- --check
- run: cargo clippy --all-features --all-targets -- -Dwarnings
- run: cargo test --all-features
- run: cargo test --no-default-features
5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
[workspace]
members = ["geo", "geo-types", "geo-postgis", "geo-test-fixtures"]
members = ["geo", "geo-types", "geo-postgis", "geo-test-fixtures", "wkt"]

[patch.crates-io]

# Ensure any transitive dependencies also use the local geo/geo-types
geo = { path = "geo" }
geo-types = { path = "geo-types" }

# do we need this?
#wkt = { path = "wkt" }
2 changes: 1 addition & 1 deletion geo-test-fixtures/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ edition = "2021"
publish = false

[dependencies]
wkt = { version = "0.10.0", default-features = false }
wkt = { path = "../wkt", version = "0.10.0", default-features = false }
geo-types = { path = "../geo-types" }
53 changes: 53 additions & 0 deletions wkt/CHANGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Changes

## 0.10.0 - 2022-02-24
### Changed
* Now accepts `MULTIPOINT`s with fewer parentheses, as output by `ST_AsText` in postgis:
`MULTIPOINT(0 1, 2 3)` in addition to `MULTIPOINT((0 1), (2 3))`
* BREAKING: Replace `Wkt::items` with `Wkt::item` and remove `Wkt::add_item()`.
* <https://github.com/georust/wkt/pull/72>
* BREAKING: Reject empty strings instead of parsing them into an empty `Wkt`.
* <https://github.com/georust/wkt/pull/72>
* BREAKING: move `Wkt::from_str` to `FromStr` trait. Add `use std::str::FromStr;` to your code to use it.
* <https://github.com/georust/wkt/pull/79>
* Switch to 2021 edition and add examples
* <https://github.com/georust/wkt/pull/65>
* Update to geo-types v0.7.3
* Add MIT license file

## 0.9.2 - 2020-04-30
### Added
* Minimal support for JTS extension: `LINEARRING` by parsing it as a `LINESTRING`.
* Support `POINT EMPTY` in conversion to `geo_types`.
Converts to `MultiPoint([])`.
* <https://github.com/georust/wkt/pull/64>
### Fixed
* Some "numeric" characters like `¾` and `` were being treated as digits.
### Changed
* Approximately 40% faster according to `cargo bench`.

## 0.9.1

* Add `serde::Deserialize` for `Wkt` and `Geometry`.
* <https://github.com/georust/wkt/pull/59>
* Add helper functions for deserializing from WKT format into
`geo_types::Geometry` and `geo_types::Point`
* <https://github.com/georust/wkt/pull/59>
* <https://github.com/georust/wkt/pull/62>

## 0.9.0

* WKT errors impl `std::error::Error`
* <https://github.com/georust/wkt/pull/57>
* Add TryFrom for converting directly to geo-types::Geometry enum members, such
as `geo_types::LineString::try_from(wkt)`
* <https://github.com/georust/wkt/pull/57>
* Add `geo-types::Geometry::from(wkt)`
* BREAKING: update geo-types, apply new `geo_types::CoordFloat`
* <https://github.com/georust/wkt/pull/53>
* BREAKING: Add Debug to Wkt structs by using new WktFloat instead of num_traits::Float
* <https://github.com/georust/wkt/pull/54>

## 0.8.0

* update geo-types
28 changes: 28 additions & 0 deletions wkt/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[package]
name = "wkt"
description = "Rust read/write support for well-known text (WKT)"
version = "0.10.0"
license = "MIT/Apache-2.0"
repository = "https://github.com/georust/wkt"
autobenches = true
readme = "README.md"
keywords = ["geo", "geospatial", "wkt"]
edition = "2021"

[dependencies]
geo-types = { path = "../geo-types", version = "0.7.3", optional = true }
num-traits = "0.2"
serde = { version = "1.0", default-features = false, optional = true }
thiserror = "1.0.23"

[dev-dependencies]
criterion = { version = "0.2" }
serde = { version = "1.0", default-features = false, features = ["derive"] }
serde_json = "1.0"

[features]
default = ["geo-types"]

[[bench]]
name = "parse"
harness = false
27 changes: 27 additions & 0 deletions wkt/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
wkt
===

Rust read/write support for [well-known text (WKT)](https://en.wikipedia.org/wiki/Well-known_text).

[![Crate][crates-badge]][crates-url]
[![API Documentation][docs-badge]][docs-url]

[crates-badge]: https://img.shields.io/crates/v/wkt.svg
[crates-url]: https://crates.io/crates/wkt
[docs-badge]: https://docs.rs/wkt/badge.svg
[docs-url]: https://docs.rs/wkt

## License

Licensed under either of

* Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)

at your option.

### Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any
additional terms or conditions.
1 change: 1 addition & 0 deletions wkt/benches/big.wkt

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions wkt/benches/parse.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#[macro_use]
extern crate criterion;
extern crate wkt;

use std::str::FromStr;

fn criterion_benchmark(c: &mut criterion::Criterion) {
c.bench_function("parse small", |bencher| {
let s = include_str!("./small.wkt");
bencher.iter(|| {
let _ = wkt::Wkt::<f64>::from_str(s).unwrap();
});
});

c.bench_function("parse big", |bencher| {
let s = include_str!("./big.wkt");
bencher.iter(|| {
let _ = wkt::Wkt::<f64>::from_str(s).unwrap();
});
});
}

criterion_group!(benches, criterion_benchmark);
criterion_main!(benches);
1 change: 1 addition & 0 deletions wkt/benches/small.wkt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
POLYGON ((35 10, 45 45, 15 40, 10 20, 35 10), (20 30, 35 35, 30 20, 20 30))
Loading

0 comments on commit 3cffb9c

Please sign in to comment.