Idea for more flexible access to relations #540
geoneutrino
started this conversation in
Ideas
Replies: 2 comments
-
That's a good idea - do you want to create an issue for it? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
way_function in lua is normally a lot of calls to sub-functions to process the different types of elements/layers needed (streets, landuse, boundaries, labels ...)
when accepting multiple type of relations the current concept is a bit unclean from a software engineering perspective:
Accessing relations in one of those sub-functions with the while .. NextRelation() loop mentioned in the docs/RELATIONS.md results in the relationSubscript variable incremented in OsmLuaProcessing::NextRelation() until the end of the list and afterwards i can never reset it to use again in another function
tilemaker/src/osm_lua_processing.cpp
Line 522 in 439c6b1
An easy improvement for this scenario would be to expose a simple "ResetRelationSubscript" method in osm_lua_processing to set relationSubscript to -1
A more complex but maybe also useful in the future would be to expose methods for accessing the relations in a more flexible way, kind of dictionary e.g. add a method NextRelationOfType("abc") that loops overs relations with attribute type=abc
Thanks
Beta Was this translation helpful? Give feedback.
All reactions