2

I would like to query all of the existing meta-data on a specific user using Overpass QL. I am new to the format, but I know that this will return all the nodes in a box by a specific user:

node
    (uid:123456)
    (lat,long,lat,long);
out meta;

And I could run the same command for rel's and way's in order to get a complete data-set. But this will not, as far as I can tell, show me the history of the user's activity, in that I won't be able to see the history of edits and changes, deleted items, etc.: only the stuff in the most recent changesets/versions.

I feel like there must be some command along these lines to accomplish what I want:

[diff:"YYYY-MM-DDTHH:MM:SSZ","YYYY-MM-DDTHH:MM:SSZ"];
(
  (uid:123456);
);
out body;
>;
out meta;

But as you can tell by running that here, it doesn't work. Also, if it did work, it wouldn't really do what I want, since it would only tell me the difference between one date and the other, as opposed to a list of all the edits of any sort a person has done/made. So the question is: how can I query all of the meta-data on the activities of a specific user in Open Street Maps? (Doing so within a specific date-range and/or bounding box is a plus but not necessary, if your answer takes neither into account I can implement both features on my own after the fact).

EDIT ----- I was able to get results similar to what I'd like with this:

[out:csv(::type,::id,"name",::lat,::lon,::version,::timestamp,::changeset)]
[diff:"2012-08-14T15:00:00Z","2014-08-21T15:00:00Z"];
node
    (uid:1378531)
    (46.32701220,11.63249080,46.58063280,12.44677780)
out meta qt; 
rel
    (uid:1378531)
    (46.32701220,11.63249080,46.58063280,12.44677780)
out meta qt; 
way
    (uid:1378531)
    (46.32701220,11.63249080,46.58063280,12.44677780)
out meta qt;
 >; 
out meta qt;

But as of yet I am not totally sure if these results have all of the changes, or just the initial version and the latter version of any edited node. Moreover, when I try running it with larger date ranges, the server gives me an empty package. I am not sure how I'm supposed to query when I want something that necessitates more memory. Should I break it into multiple date ranges if the range is more than, say, a month, and then combine the results on my local machine after the fact? (It's not hard to combine CSV files with bash so this is definitely an option...)

Per a comment, I should mention that I do not have the flexibility to download gigabytes of data and parse through them. I need to be able to download only the relevant data.

2

Overpass API doesn't support this requirement (yet), see https://github.com/drolbr/Overpass-API/issues/282 for the respective issue.

One option at this time is to process the Full History Planet using libosmium as an example, see http://planet.openstreetmap.org/pbf/full-history/ for the data and https://github.com/osmcode/libosmium for the library.

Edit: Depending on the kind of information you're looking for, http://hdyc.neis-one.org/ would also be worth looking at.

  • Thanks for responding! The full history data is not a good option as it is a massive library and thus not useful for any sort of live applications where the end user expects to have results close to instantaneously. – Max von Hippel Oct 4 '16 at 11:25
  • You didn't mention this requirement in your question. Can you please edit your question to include all of your requirements? – mmd Oct 4 '16 at 11:29
  • Please see my edit - I'd like to know if I solved it or not. – Max von Hippel Oct 4 '16 at 11:29
  • OK I will add the requirement to my question, but I think it's a fair one implicitly - the reality is that in almost all coding contexts you don't have 42 gb of space to just use, let alone the bandwidth to download all that. – Max von Hippel Oct 4 '16 at 11:30
  • 1
    Your query will only return differences between the first and the last timestamp, and nothing inbetween => you won't get all of the changes that happen during that timeframe. Please refer to the Github ticket I mentioned. Also, you won't see any changes that happened before September 2012 (license change). Empty result means, that there was probbaly a timeout issue. Unfortunately, you won't see error messages in CSV mode (that's another issue on Github). I would add something like out count; towards the end of the query to validate the response (see OSM wiki for details). – mmd Oct 4 '16 at 11:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.