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

Add geo-traits crate #1157

Merged
merged 40 commits into from
Oct 26, 2024
Merged
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
e337d8a
Add geo-traits crate
kylebarron Feb 26, 2024
7f68df2
Update doc
kylebarron Feb 26, 2024
34ed5be
Update geo-traits/Cargo.toml
kylebarron Feb 27, 2024
d57995e
Merge branch 'main' into kyle/geo-traits-crate
kylebarron Oct 10, 2024
7308df3
Merge branch 'kyle/geo-traits-crate' of github.com:kylebarron/geo int…
kylebarron Oct 10, 2024
ee04201
Update docker images
kylebarron Oct 10, 2024
ad48ee1
Remove CoordTrait and add multiple dimensions
kylebarron Oct 10, 2024
4261836
Module docs
kylebarron Oct 10, 2024
449b39f
rename
kylebarron Oct 10, 2024
f54fffc
Add logical Dimension
kylebarron Oct 11, 2024
db08c55
partialeq and hash
kylebarron Oct 11, 2024
7ecdb7e
return impl Iterator
kylebarron Oct 12, 2024
03f6615
rename to min/max
kylebarron Oct 12, 2024
31435e8
Merge branch 'main' into kyle/geo-traits-crate
kylebarron Oct 12, 2024
1d30066
Specialized implementations of GeometryTrait
kylebarron Oct 13, 2024
ab0bf7b
clearer GeometryTrait naming
kylebarron Oct 13, 2024
33c1ef9
Rename ItemType
kylebarron Oct 13, 2024
6363ad8
Unimplemented versions
kylebarron Oct 14, 2024
9421e05
Add LineTrait and TriangleTrait and improve trait docs
kylebarron Oct 14, 2024
9552705
Fix geo-types empty Polygon
kylebarron Oct 14, 2024
3725844
Merge branch 'main' into kyle/geo-traits-crate
kylebarron Oct 14, 2024
7a2effd
Make iterators private
kylebarron Oct 14, 2024
8dcbe50
Rename Dimension -> Dimensions
kylebarron Oct 14, 2024
6889cae
No default x() and y()
kylebarron Oct 14, 2024
de7ca8a
More descriptive point panics
kylebarron Oct 14, 2024
0fb5ab8
Change to DoubleEndedIterator + ExactSizeIterator
kylebarron Oct 15, 2024
58117ce
change dimensions case
kylebarron Oct 15, 2024
6b697dd
Update geo-traits/src/point.rs
kylebarron Oct 16, 2024
2eb3b03
reorder unchecked
kylebarron Oct 16, 2024
1f68cc3
`PointTrait::is_empty`
kylebarron Oct 16, 2024
b1364ef
Merge branch 'main' into kyle/geo-traits-crate
kylebarron Oct 16, 2024
d49873b
Add sentence to is_empty
kylebarron Oct 16, 2024
7c0e90f
fix doc link
kylebarron Oct 16, 2024
09de278
Use array
kylebarron Oct 18, 2024
8418780
Update geo-traits/src/line.rs
kylebarron Oct 18, 2024
4a9b3cc
typo
kylebarron Oct 22, 2024
ba9bf98
Merge branch 'main' into kyle/geo-traits-crate
kylebarron Oct 22, 2024
4764343
Restore CoordTrait, PointTrait yields Option<CoordTrait>
kylebarron Oct 24, 2024
2b77691
Merge branch 'main' into kyle/geo-traits-crate
kylebarron Oct 24, 2024
711dfac
Update geo-traits/src/coord.rs
kylebarron Oct 25, 2024
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
Prev Previous commit
Next Next commit
rename to min/max
kylebarron committed Oct 12, 2024
commit 03f66157bc860fe85b0903c284e8e0918c2dd9d0
24 changes: 12 additions & 12 deletions geo-traits/src/rect.rs
Original file line number Diff line number Diff line change
@@ -15,11 +15,11 @@ pub trait RectTrait {
/// The dimension of this geometry
fn dim(&self) -> Dimension;

/// The lower coordinate of this Rect
fn lower(&self) -> Self::ItemType<'_>;
/// The minimum coordinate of this Rect
fn min(&self) -> Self::ItemType<'_>;

/// The upper coordinate of this Rect
fn upper(&self) -> Self::ItemType<'_>;
/// The maximum coordinate of this Rect
fn max(&self) -> Self::ItemType<'_>;
}

impl<'a, T: CoordNum + 'a> RectTrait for Rect<T> {
@@ -30,12 +30,12 @@ impl<'a, T: CoordNum + 'a> RectTrait for Rect<T> {
Dimension::XY
}

fn lower(&self) -> Self::ItemType<'_> {
self.min()
fn min(&self) -> Self::ItemType<'_> {
Rect::min(*self)
}

fn upper(&self) -> Self::ItemType<'_> {
self.max()
fn max(&self) -> Self::ItemType<'_> {
Rect::max(*self)
}
}

@@ -47,11 +47,11 @@ impl<'a, T: CoordNum + 'a> RectTrait for &'a Rect<T> {
Dimension::XY
}

fn lower(&self) -> Self::ItemType<'_> {
self.min()
fn min(&self) -> Self::ItemType<'_> {
Rect::min(**self)
}

fn upper(&self) -> Self::ItemType<'_> {
self.max()
fn max(&self) -> Self::ItemType<'_> {
Rect::max(**self)
}
}