-
Notifications
You must be signed in to change notification settings - Fork 200
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 "Orient" trait for Polygon #108
Conversation
Could I get a review of this, if someone's got time? |
src/algorithm/orient.rs
Outdated
/// and its inner ring(s) oriented clockwise. Selecting `Reversed` will result in a Polygon | ||
/// with a clockwise-oriented exterior ring, and counter-clockwise interior ring(s) | ||
#[derive(Debug)] | ||
pub enum Direction { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you added #[derive(Copy, Clone, Debug)]
here, you wouldn't need to pass &Direction
references everywhere since it's just as cheap to pass the enum value than it is to pass a reference to the enum value.
src/algorithm/orient.rs
Outdated
pub enum Direction { | ||
Default, | ||
Reversed, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be good to explicitly mention:
enum Direction {
/// exterior ring is oriented counter-clockwise, interior rings are oriented clockwise
Default,
/// exterior ring is oriented clockwise, interior rings are oriented counter-clockwise
Reversed,
}
Sorry about that, this PR slipped by me. Feel free to ping me directly if you need a review for GeoRust things. I also just realized you aren't part of the GeoRust GitHub organization, sorry about that! Just added you. r=me after my couple minor comments (you should be able to add a comment |
bors r- no bors, stop, not yet |
Canceled |
Unrelated to this PR, I've been working on a geospatial data viewer. My next steps are to add a basic UI and add in some of the operations/algorithms you've implemented in this repository, so thanks for all your work here :) |
bors r=frewsxcv |
Build succeeded |
This returns a correctly-oriented copy of the polygon;
Default
returns counter-clockwise exterior rings and clockwise interior rings.Reversed
returns rings with the opposite orientation.