This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Find new roads and highways from last year

1

Is there a good way to find new highways from one year (or month) to the next? I tried looking at the version of ways (highways) but that doesn't seem like the way to go as version 1 of ways isn't giving me NEW roads.

asked 17 Jan '22, 18:21

gcapilot's gravatar image

gcapilot
41334
accept rate: 0%


One Answer:

2

There's no "zero effort" way I'm afraid, as you have already seen you cannot rely on version numbers. A relatively stable approach could be something along these lines:

  • import area of interest (as of today) into PostGIS database with osm2pgsql
  • import same area (as of one year ago) with a different prefix (so that you e.g. get a table planet_osm_line with today's data and old_osm_line with that of a year ago)
  • delete everything from the "new" table that is in the vicinity of something from the "old" table - one approach could be creating a buffer of, say, 20 meters around every "old" road geometry and then subtracting the resulting polygons from the "new" line geometries
  • what remains in the "new" table are those bits where one year ago there was no road within 20 meters of it.

The 20 meter rule is to account for small geometry changes. Of course you could fine-tune this to e.g. count a street as "new" also if the name has changed from earlier or so.

answered 17 Jan '22, 19:04

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

Source code available on GitHub .