NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

I have been trying to find the difference in the number of features of an area over a specific time period.

My workflow:

  1. Download the full history file of the area of interest.
  2. Extracted two separate data files as of the starting and ending time period using osmium time-filter.
  3. Using osmium tags-count, counted the same feature (say amenity=hospital) from both files and subtracted them.

The result is equivalent to the number of hospitals mapped in that region within that particular period. I cross-checked the number by applying the overpass query in the same area over the same period and clipped the data with my area of interest using QGIS.


nwr["amenity"="hospital"] (if:timestamp()>="2020-01-01T00:00:00Z" && timestamp() <="2020-02-01T00:00:00Z")({{bbox}});


To my surprise, the numbers (difference) obtained from osmium and overpass-turbo were very different. My understanding is that these numbers should match.

Am I doing something wrong?

asked 08 Jan '21, 18:46

rabenojha's gravatar image

rabenojha
11235
accept rate: 0%

1

I'd cross check first by doing two date queries on overpass [date:"2020-01-01T00:00:00Z"] & [date:"2020-01-01T00:00:00Z"] with your regular nwr"amenity"="hospital" query & comparing those to your two osmium extracts. Not sure why you're clipping in QGIS rather than with Osmium.

(08 Jan '21, 19:48) SK53 ♦

I am talking about clipping the resulted file (exported as GeoJSON) obtained by the overpass query in the bounding box by my area of interest. But, if you are mentioning osmium-extract about clipping with Osmium, I am yet to explore that.

(09 Jan '21, 18:37) rabenojha

The two queries ask for different numbers. The Osmium query gives the number you want to know - how much did the number of hospitals change in the given time range.

The Overpass query asks how many hospitals have been last edited in the time range. I.e. if the object was edited later again, it is not counted. Likewise, if an old hospital object got updated in the period it is counted.

If you want to use Overpass (on a server that has the full history), you can use the 'date' modifier to access historic data, see Overpass Language Documentation

permanent link

answered 09 Jan '21, 13:46

mueschel's gravatar image

mueschel
412
accept rate: 0%

edited 09 Jan '21, 13:49

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×483
×38

question asked: 08 Jan '21, 18:46

question was seen: 1,446 times

last updated: 09 Jan '21, 18:40

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum