georust / geo

Rust geospatial primitives & algorithms
https://crates.io/crates/geo
Other
1.58k stars 199 forks source link

`LineString` contains contradictory information in docs #1256

Closed frewsxcv closed 2 weeks ago

frewsxcv commented 3 weeks ago

https://docs.rs/geo-types/latest/geo_types/geometry/struct.LineString.html

The first line says:

An ordered collection of two or more Coords, representing a path between locations.

Whereas the following line says:

A LineString is closed if it is empty, or if the first and last coordinates are the same.

So is it "two or more" or can it be "empty"?

frewsxcv commented 3 weeks ago

Oh well later it says:

A LineString is valid if it is either empty or contains 2 or more coordinates.

So maybe it's just the first line of the docs that could be tweaked that could indicate it could also be empty 🤷🏻 Or maybe it's not worth changing