azavea / onramp

Generate OSM augmented diffs from OSM change files without Overpass
Apache License 2.0
9 stars 1 forks source link

Generate list of geometries in osm change file from osmexpress database #3

Closed CloudNiner closed 4 years ago

CloudNiner commented 4 years ago

The code we need to write here is very similar to what's already available in osmexpress to update an osmx db with osm change files: https://github.com/protomaps/OSMExpress/blob/master/src/update.cpp

The difference is that here we want to do the following during each update cycle:

  1. Get lists of all nodes, ways, relations from osm change file
  2. Get matching old geometry from osmx db for each node, way, relation in osm change file
  3. Generate a datastructure that contains the new osm object alongside the old osm object geometry -- we'll extend this later to pull in the old osm object tags/metadata from postgres
  4. Write new osm geometry to osmx (the update call linked above has a "commit" flag which if not provided aborts the transaction, acting as a dry run)
CloudNiner commented 4 years ago

Going to consider this closed by #7 for now in favor of getting the postgres db setup.

The only thing we didn't address is (3) above, which can be done more thoroughly once we've got postgres setup.