[OSM-dev] Get geometries out of OSM changes file

François Lacombe fl.infosreseaux at gmail.com
Sun Mar 21 16:55:00 UTC 2021


Hi all

For the needs of ProjetDuMois statistics computing chain, I'm looking for
an appropriate logic to get geometries associated with osm changes in an
osc file, particularly for past versions.

According to this discussion, it sounds to not be easy.
https://help.openstreetmap.org/questions/58931/osc-to-osm-change-file-to-osm-osmium/58948

Currently, we convert an OSC file to CSV without any geometry information
https://github.com/vdct/ProjetDuMois/blob/master/db/10_project_update.js#L275
with following xslt sheet
https://github.com/vdct/ProjetDuMois/blob/master/db/osc2csv.xslt

We now aim to group and count changes against some administrative
boundaries. As a given feature can change of admin area between two
versions, we must filter the changes we're interested in, intersect each of
them with selected admin boundaries and finally count how may they are in
each admin boundary.

Despite I'll be able to get lat/lon for nodes, rebuild linestrings for ways
will be tricky as we'll have to not only check against nodes ids but
timestamps as well.

It's not a problem to do that each day with daily updates but issues occurs
when we drop the database and try to get back 2 or 3 month with no geometry
history at all.
See this chart (in French) :
https://github.com/vdct/ProjetDuMois/issues/188#issuecomment-802221915

I'll be happy to discuss about such process here as I think someone may
already had to solve it.
Thanks in advance, all the best

François
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20210321/a6768a9f/attachment.htm>


More information about the dev mailing list