[Tile-serving] [openstreetmap/osm2pgsql] [Flex] Add callbacks to indicate start/end of stage processing (#1211)

mmd notifications at github.com
Wed Jun 17 10:19:27 UTC 2020


The main use cases I had in mind were the inclusion of external scripts into the Lua file to faciliate the overall processing, and have the creation/update process in one place. As an example, osm-fr has a set of additional scripts to create indices where needed. I think those could be easily integrated into an "End of osm2pgsql processing reached" function in the Lua script.

https://github.com/osm-fr/osm2pgsql-import-tools/blob/master/requetes-sql-indexes-et-autre/indexes-admin_level.sql
https://github.com/osm-fr/osm2pgsql-import-tools/blob/master/requetes-sql-indexes-et-autre/indexes-ref.sql
https://github.com/osm-fr/osm2pgsql-import-tools/blob/master/requetes-sql-indexes-et-autre/index-ref-sandre.sql

Another use case could be the calculation of simplified geometries at the end of processing according to custom rules. The following example uses triger for this purpose. This could be done as SQL statement towards the end of osm2pgsql processing as well.

https://github.com/osm-fr/osm2pgsql-import-tools/blob/master/requetes-sql-indexes-et-autre/colonne-geometries-simplifi%C3%A9es-polygon-administratifs.sql

Another use case according to "https://blog.jochentopf.com/2020-05-10-new-flex-output-in-osm2pgsql.html" -> Use cases is maybe in line with "_much more interesting for non-rendering use cases. Whether you want to create statistics of certain OSM tags_": Assuming we keep the stats in memory for some time, thereby avoiding frequent database updates, we some way to find out, that the last node/way/relation has been processed, and we still need to store our Lua buffer on the database. This is only possible if the script knows about the overall end of processing event.

I know this concept is very generic, and I tried to cover different use cases that should be of general interest. All of them worked with an additional "end of processing" function, which would be the minimum scope for this issue.


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/issues/1211#issuecomment-645287526
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20200617/5142da2d/attachment.htm>


More information about the Tile-serving mailing list