-
-
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
Compute centroid of relations with multiple outer members #103
Compute centroid of relations with multiple outer members #103
Conversation
👍 for reformatting/cleaning up the code, this was one of the first projects I wrote in Go ~6 years ago. |
… return map of members and geo coordinates
…at long Maps to PointSet
…uter area centroid from non-closed ways
…g functionality to print and refactor entrance extraction
Sorry for the delay, uni stuff... I committed relation_centroid which includes the functionality of merging open outer ways together and calculating the geo centroid of it. Since there can be multiple outer areas, it connects where either the first coordinates matches the last or the other way around and also checks if for clockwise ways. So in the end there might be one complete polygon or multiple ones (and maybe in some cases broken ones, meaning first coords != last cords, they will be ignored). Please also check the small changes I made for Relations in the pbf2json file. Some things that are not covered:
Some things that need to be clarified:
__ |
Same for me, this is my first experience with go. So please be gentle :) |
Nice work, ok, let's look at getting this merged-in. I've split out moving the 'cache' functions to their own file in #104 That should clear up the diff a bit, are you comfortable to rebase it? There will be some minor conflicts with the casing of the function names, I've left them as lowercase which is a Golang convention to indicate they are private to the scope of the module (as opposed to Capitalized which indicates a public API), in this project it's not such a big deal since everything is in the So you can probably just remove your copy of git origin add pelias https://github.com/pelias/pbf2json.git
git fetch pelias
git rebase pelias/master
# or
# git merge pelias/master Let me know if you need a hand doing that, which will leave us with a cleaner diff with just your awesome centroid changes. [edit] or what might be easier is just removing this one commit. |
… operations in util.go
… return map of members and geo coordinates
…at long Maps to PointSet
…uter area centroid from non-closed ways
…g functionality to print and refactor entrance extraction
… to cache.go" This reverts commit 1152e2f
… into relation-outer-members-centroid # Conflicts: # cache.go # pbf2json.go
this should do the job. @missinglink |
Adds the functionality to calculate a centroid for relations that have multiple outer members that are non-closed ways.
Here's the reason for this change 🚀
Should completely implement #96
Also, this PR moves some utility functions and the interactions with LevelDB into files.
Here's what actually got changed 👏
Here's how others can test the changes 👀
Run the relation_centroid tests or run the program with a pbf that includes relations with multiple outer ways and check the centroid.