You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by geoneutrino September 22, 2023
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
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
The text was updated successfully, but these errors were encountered:
Discussed in #540
Originally posted by geoneutrino September 22, 2023
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
The text was updated successfully, but these errors were encountered: