[Tile-serving] [osm2pgsql-dev/osm2pgsql] as_linestring() and likely other geometry transform functions can only be called from the process_way() function, not custom functions. (Issue #2171)
mboeringa
notifications at github.com
Wed Apr 10 19:55:57 UTC 2024
> What do you propose `as_linestring()` generate when called on a relation? What would happen if the relation doesn't "fit" into a LineString?
@joto
I am not suggesting allowing 'as_linestring' in any other processing callback function like the 'process_relation' callback function, instead, I suggest to allow 'process_way' to call helper functions to do a geometry transform, instead of forcing the geometry transform function to be used inside the 'process_way' function itself. This is what Paul's style did, and feels like natural way of using functions in Lua.
I know you can define functions, in fact, it is exactly the fact that I want to define and use custom functions that is now limited because osm2pgsql performs this check.
If the goal of this check was to prevent users from making mistakes in the Lua code, it would be better to change the check from:
"'as_linestring' cannot be used in any other function than 'process_way'"
to:
"as_linestring" is forbidden to be used in the 'process_relation' or 'select_relation_members' callback functions
thus allowing its usage in any other function accept those two.
Similarly, as to your example of the 'as_multilinestring', this could be limited by:
"'as_multilinestring' is forbidden to be used in the 'process_way' callback function"
allowing it to be used in any other helper function defined by the user.
--
Reply to this email directly or view it on GitHub:
https://github.com/osm2pgsql-dev/osm2pgsql/issues/2171#issuecomment-2048331061
You are receiving this because you are subscribed to this thread.
Message ID: <osm2pgsql-dev/osm2pgsql/issues/2171/2048331061 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20240410/5e86612e/attachment.htm>
More information about the Tile-serving
mailing list