-
Notifications
You must be signed in to change notification settings - Fork 233
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
extend NextRelation/FindInRelation to nodes #632
Merged
Merged
Commits on Jan 2, 2024
-
extend NextRelation/FindInRelation to nodes
This also makes `NextRelation` return a tuple of ID, role rather than just ID. According to https://www.lua.org/pil/5.1.html, I think that's not a breaking change. Motivation: When I naively try to create labels from OSM entities with the `place` tag, I occasionally get duplicates due to relations. For example, the city of Guelph has [relation 7486148](https://www.openstreetmap.org/relation/7486148), which has [node 36576733](https://www.openstreetmap.org/node/36576733) as its `label` member. They both have `place=city`, so my Lua script faithfully spits out two labels. This PR allows me to suppress the label from the node, which is a start. Ideally, I'd actually prefer to use the node, as it'll likely have a nicely human-curated location. For that, I'd need the relation to be able to interrogate its members. Would you be open to me extending this PR to add `NextMember`, `FindInMember` and `RestartMembers` functions that mirror the ones used by nodes/ways ?
Configuration menu - View commit details
-
Copy full SHA for 65c8380 - Browse repository at this point
Copy the full SHA 65c8380View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3ce355a - Browse repository at this point
Copy the full SHA 3ce355aView commit details -
Configuration menu - View commit details
-
Copy full SHA for ac30cbd - Browse repository at this point
Copy the full SHA ac30cbdView commit details
Commits on Jan 3, 2024
-
I dunno what I was thinking, this is much better. (And I see now that there are many more roles than these four.)
Configuration menu - View commit details
-
Copy full SHA for a401dad - Browse repository at this point
Copy the full SHA a401dadView commit details -
Configuration menu - View commit details
-
Copy full SHA for 94ea972 - Browse repository at this point
Copy the full SHA 94ea972View commit details -
openmaptiles: don't pass false to LayerAsCentroid
Ugh, I guess this could be considered a breaking change after all. If a user previously passed `LayerAsCentroid("layername", false)`, we'd ignore the false. With this change, the false causes us to fail, because we expect a string. I'd normally just say this was undefined behaviour, and those users deserve to be broken...but it's tricky, since this is a script from the official tilemaker repo.
Configuration menu - View commit details
-
Copy full SHA for 154d3ab - Browse repository at this point
Copy the full SHA 154d3abView commit details
Commits on Jan 4, 2024
-
These seems to work well and, at least for large polygons (city parks, national parks), is faster than Boost's centroid algorithm. That surprised me! I haven't benchmarked it on building polygons yet. There are several todos here around making it configurable, and making it play well with lazy geometries. Going to finish off the relation memory stuff then fix those.
Configuration menu - View commit details
-
Copy full SHA for 77fb64a - Browse repository at this point
Copy the full SHA 77fb64aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9ca08b3 - Browse repository at this point
Copy the full SHA 9ca08b3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0910d8a - Browse repository at this point
Copy the full SHA 0910d8aView commit details -
::LayerAsCentroid(layer, algorithm, role, ...)
You can now pass the preferred algorithm to use to LayerAsCentroid. Still to do: teach lazy geometries about which algorithm was used.
Configuration menu - View commit details
-
Copy full SHA for c74e4c1 - Browse repository at this point
Copy the full SHA c74e4c1View commit details -
always materialize centroids if polylabel
This ensures that the user gets the same, correct behaviour both in --materialize-geometries and --lazy-geometries. We can extend support to materialize geometries, but this PR is already getting big (and it has conflicts with the other 2 PRs), so I'm leery of getting further out over my skis.
Configuration menu - View commit details
-
Copy full SHA for 3f35ff6 - Browse repository at this point
Copy the full SHA 3f35ff6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6b06eb5 - Browse repository at this point
Copy the full SHA 6b06eb5View commit details
Commits on Jan 6, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 2f5ca20 - Browse repository at this point
Copy the full SHA 2f5ca20View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.