Closed Robinlovelace closed 7 years ago
But this works in overpass
osmcsv <- '[out:csv(::id,::type,"name")];
area[name="Bonn"]->.a;
( node(area.a)[railway=station];
way(area.a)[railway=station];
rel(area.a)[railway=station]; );
out;'
opq <- overpass_query(osmcsv)
Thanks for the heads-up: This commit makes negation dead easy. This was implemented in osmplotr
, but I neglected to re-insert it in Bob's overpass
code. With that ability, three of the first four classes you give can be handled directly (just not !key
, because that doesn't make much sense for an OSM query, and would overly burden overpass
). See example at the end of ?add_feature
.
What osmdata
was missing was any ability to do regex matches, but all that needed was changing the former exact=FALSE
parameter for add_feature()
to the form implemented in this commit of
add_feature <- function (opq, key, value, key_exact, value_exact, match_case, bbox)
Setting either .._exact
parameter to FALSE
switches to regex mode, enabling the full range of possible matching according to the overpass
QL, including case-insensitivity.
That covers all your cases bar !key
.
Would it be worth thinking about allowing osmdata to access data stored in a PostGIS db?
I'm tempted to say no only because overpass
is going to implement .pbf
as well as (or instead of?) .osm
at some time in the future. pbf
is a compressed binary form that is used for planet dumps. The minute that's done, osmdata
can be made entirely compatible with any servers dishing up the OSM world. (But even then, there might not be any point plugging it into PostgreSQL
, because a .pbf
is a database with its own database structure that is highly efficient, so likely no gain from PostgreSQL
-ing it.) Either way, wait and see would be my preference.
Thinking: it would be great to put some of these example in vignettes / examples. Good idea?
Hell yeah. I've put a token example of negation in one line of an example, but none of the rest of this functionality is described at all, and it really ought to be. You wanna first give it a go and start assembling nice examples - and possible problems - in this issue for subsequent incorporation in the code once the reviews are in.
Thanks - I've a few more questions, please head to slack...
All done and included in vignette with this commit
Awesome work Mark, loving the use of pipes and alternative osm APIs in that commit. osmdata is looking very good now - need to x-reference it in my stplanr-paper, but what's the citation?
Thanks Robin! osmdata citation pending. Submitted to JOSS and should i guess be cleared promptly. I'll let you know.
One thing I picked-up on my travels: Edzer is not convinced we've adequately responded to all his comments - one to think about...
Yeah, I'm not surprised because we haven't really actually done much except for open the issues. I was going through them the other day and realised we still actually need to address those by making the actual changes. I will get on to it asap after Brussels
Great stuff. Ping me as/when needed - you'll see I've got a substantial amount of proverbial junk to sort out in my own metaphorical castles made of sand in the form of stplanr and geocompr repos in urgent need of attention!
@Robinlovelace @maelle http://joss.theoj.org/papers/0f59fb7eaeb2004ea510d38c00051dd3 - true to their word, the whole process took around 30 minutes. Now that's publishing!
Awesome, but it also depended on having the reviews already in via rOpenSci, sometimes you see submissions blocked quite a while in JOSS. :wink:
Yeah, it obviously all depended on Karthik having done his homework, but even given that it was so impressively smooth. And their bot is brilliantly programmed - made it so much easier!
@mpadge any update on the promised overpass
support of .pbf format?
Context: the CyIPT project I'm working on with @mem48 (who you may meet in November).
To my knowledge (very happy to be proven wrong).
QL could be an ideal language for representing complex queries in text I think: see QL Basics. Illustrative examples (I don't think we can currently do this - any thoughts):
Questions:
osmdata
to access data stored in a PostGIS db?