Skip to content

Commit

Permalink
Merge #629
Browse files Browse the repository at this point in the history
629: centroid fixups r=michaelkirk a=michaelkirk

- [x] I agree to follow the project's [code of conduct](https://github.com/georust/geo/blob/master/CODE_OF_CONDUCT.md).
- [x] I added an entry to `CHANGES.md` if knowledge of this change could be valuable to users.
---

- Fixes the implementation for a MultiLineString with zero length lines
- `impl Centroid for Geometry` and it's remaining variants.

FYI: I found these via the JTS test suite runner I'm working on here: https://github.com/michaelkirk/jts-test-runner/pull/1/files 


Status:
- [x] integrate jts-test-runner centroid tests
- [x] needs review http://github.com/michaelkirk/jts-test-runner/pull/1
- [x] move http://github.com/michaelkirk/jts-test-runner/pull/1 to georust
- [ ] publish jts-test-runner? (alternatively, we could leave it unpublished and just reference GH for this unique crate)
- [x] publish wkt
- [x] remove unpublished references from `patch.crates-io`

Co-authored-by: Michael Kirk <michael.code@endoftheworl.de>
  • Loading branch information
bors[bot] and michaelkirk committed Mar 8, 2021
2 parents 168726a + 9187c86 commit 6e37af2
Show file tree
Hide file tree
Showing 8 changed files with 578 additions and 268 deletions.
6 changes: 6 additions & 0 deletions Cargo.toml
@@ -1,2 +1,8 @@
[workspace]
members = ["geo", "geo-types", "geo-postgis"]

[patch.crates-io]

# Ensure any transitive dependencies also use the local geo/geo-types
geo = { path = "geo" }
geo-types = { path = "geo-types" }
8 changes: 8 additions & 0 deletions geo/CHANGES.md
Expand Up @@ -8,6 +8,14 @@

* Rewrite the crate documentation
* <https://github.com/georust/geo/pull/619>
* Fix `Centroid` algorithm for `MultiLineString` when all members have only one
point.
* <https://github.com/georust/geo/pull/629>
* Implement `Centroid` algorithm on `Geometry` and its remaining variants.
* <https://github.com/georust/geo/pull/629>

## 0.17.1

* Add `GeodesicIntermediate` algorithm
* <https://github.com/georust/geo/pull/608>

Expand Down
5 changes: 4 additions & 1 deletion geo/Cargo.toml
Expand Up @@ -22,7 +22,7 @@ geographiclib-rs = { version = "0.2" }

proj = { version = "0.20.3", optional = true }

geo-types = { version = "0.7.0", path = "../geo-types", features = ["approx", "use-rstar"] }
geo-types = { version = "0.7.0", features = ["approx", "use-rstar"] }

robust = { version = "0.2.2" }

Expand All @@ -34,6 +34,9 @@ use-serde = ["serde", "geo-types/serde"]
[dev-dependencies]
approx = "0.4.0"
criterion = { version = "0.3" }
# jts-test-runner is an internal crate which exists only to be part of the geo test suite.
# As such it's kept unpublished. It's in a separate repo primarily because it's kind of large.
jts-test-runner = { git = "https://github.com/georust/jts-test-runner", rev = "3294b9af1d3e64fcc9caf9646a93d0116f7d8321" }
rand = "0.8.0"

[[bench]]
Expand Down
6 changes: 4 additions & 2 deletions geo/fuzz/Cargo.toml
Expand Up @@ -12,10 +12,8 @@ cargo-fuzz = true
libfuzzer-sys = "0.4"

[dependencies.geo]
path = ".."

[dependencies.geo-types]
path = "../../geo-types"
features = ["arbitrary"]

# Prevent this from interfering with workspaces
Expand All @@ -27,3 +25,7 @@ name = "simplify"
path = "fuzz_targets/simplify.rs"
test = false
doc = false

[patch.crates-io]
geo = { path = ".." }
geo-types = { path = "../../geo-types" }

0 comments on commit 6e37af2

Please sign in to comment.