Andrew Ramnikov
Andrew Ramnikov

Reputation: 793

How to collect osm-meta-util from one region?

i am following OSM-Meta-util and collecting metadata for my Project. i can see all changes that being maid in json file. for example:

{"id":"19739143","created_at":"2013-12-31T22:28:28Z","closed_at":"2013-12-31T23:59:11Z","open":"false","num_changes":"81","user":"47NOE","uid":"1811738","min_lat":"18.0813259","max_lat":"18.1163397","min_lon":"-63.0392394","max_lon":"-63.0205645","created_by":"Potlatch 2","build":"2.3-605-gbec0ea7","version":"2.3"}
{"id":"19739670","created_at":"2013-12-31T23:59:13Z","closed_at":"2013-12-31T23:59:15Z","open":"false","num_changes":"17","user":"mituc","uid":"1860759","min_lat":"37.0432953","max_lat":"37.0619236","min_lon":"-76.3896156","max_lon":"-76.3625439","created_by":"iD 1.3.4","imagery_used":"Bing"}
{"id":"19739671","created_at":"2013-12-31T23:59:16Z","closed_at":"2013-12-31T23:59:18Z","open":"false","num_changes":"29","user":"lollops","uid":"1811663","min_lat":"43.9561142","max_lat":"43.9629707","min_lon":"10.3236263","max_lon":"10.3294793","created_by":"iD 1.3.4","imagery_used":"Bing"}

i am collecting all data and puting it into Database for analyses. my question is how can i concentrate on one region. Germany for example. as u see in json file this is data from all over the world. is it possible to say between lon = x and lat = y ?

With regards

Andrey ca

Upvotes: 3

Views: 54

Answers (1)

tyr
tyr

Reputation: 1835

You can check if the changeset's bounding box (defined via min_lat,…,max_lon) is inside the region-polygon (if you use javascript, you can probably use turf-intersect for that). Then, there are three possible cases:

  • The changeset's bbox is fully inside the region: we can be sure the changeset only affects data inside the region.
  • The changeset's bbox is fully outside the region, the opposite is the case.
  • When there is a partial overlap, the situation gets more complicated and it then depends on the actual changed content of the changeset (e.g. a changeset where a node in Canada and one in Australia is changed has an almost global bounding box and one can't say if the changeset affects a certain region by only looking at its metadata).

Unfortunately, there is no perfect solution out there for the last case. You can look at OWL or probably also augmented diffs for possible approaches to that problem.

Upvotes: 2

Related Questions