-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
linestring centroids #31
Conversation
…the polygon algo depending on the geometry
Nice, LGTM |
LGTM (small caveat: I don't really know Go) |
|
god this is exciting! |
👋 hi @riordan! |
I miss y'all! On Aug 10 2016, at 5:54 pm, Diana Shkolnikov [email protected] wrote:
|
this PR introduces a second centroid function for line strings, this is useful for things like roads and rail routes. see pelias/openstreetmap#72
it's easier to review the commits one-by-one
note: the method OSM uses to define polygons is a massive hack and so any
way
which does not have the same co-ordinate value for its first and last node will be considered a line, eg:this is technically correct as ways must be closed to be considered polygons, the above image shows the two different centroid algorithms used for http://www.openstreetmap.org/way/28596356
this makes a big difference for rail networks because the centroid now actually lies on the line string:
for all polygons (closed ways) the original sphere centroid calc is still used, I deleted it from this code base as it's now been merged in to the go.geo library.
resolves: pelias/openstreetmap#72