Reputation: 793
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
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:
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