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

Easy methods to convert a Geometry to the underlying type #184

Merged
merged 1 commit into from
Mar 1, 2018

Conversation

amandasaurus
Copy link
Member

Added a few .as_point() etc. methods to "unwrap" Geometrys. It helps with ergonomics

Copy link
Member

@frewsxcv frewsxcv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minus my comment about naming, lgtm! 👌

}

/// If this Geometry is a LineString, then return that LineString, else None.
pub fn as_linestring(self) -> Option<LineString<T>> {
Copy link
Member

@frewsxcv frewsxcv Feb 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't feel strongly about this, but should this be as_line_string since the struct is called a LineString (and not a Linestring)? if we end up doing this, it would make as_multi_line_string a little verbose 😅

@amandasaurus
Copy link
Member Author

So if this is good, can it be merged? Should I do it?

@frewsxcv
Copy link
Member

frewsxcv commented Mar 1, 2018

@rory i think it's mergeable, though i didn't merge it earlier in case you had any thoughts about this comment here

@amandasaurus
Copy link
Member Author

Ah yes, sorry. I'm not fussed about the wording change. Obviously I have mentally been using linestring as the lowercase of LineString (and multipolygon instead of multi_polygon etc.). But I don't feel strongly about it too much. If you'd rather, I can change it.

@frewsxcv
Copy link
Member

frewsxcv commented Mar 1, 2018

I don't feel strongly either, so I'm fine with it as is. Can you try approving this pull request with bors? I'm curious why the other one you approved didn't work

@amandasaurus
Copy link
Member Author

bors r=frewsxcv

bors bot added a commit that referenced this pull request Mar 1, 2018
184: Easy methods to convert a Geometry to the underlying type r=frewsxcv a=rory

Added a few `.as_point()` etc. methods to "unwrap" `Geometry`s. It helps with ergonomics
@bors
Copy link
Contributor

bors bot commented Mar 1, 2018

Build succeeded

@bors bors bot merged commit 8fd0dcd into georust:master Mar 1, 2018
@amandasaurus amandasaurus deleted the convert-geom-to-inner branch March 2, 2018 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants