4 ms·
Yeah, I've had that experience too. Or at least it gets close enough that I can make it work. The Overpass QL language is the most...bizarrely constructed lang
by stevage 3y ago
Yeah, I've had that experience too. Or at least it gets close enough that I can make it work.
The Overpass QL language is the most...bizarrely constructed language I've ever had to use. It's a bit hard to believe that the person who designed the language thought this was a perfectly reasonable statement:
(._; >;);
- Alifatisk 3y agoGotta agree with you, the QL is strange. I tried using the wizard but it kept spinning. I tried asking Bard and ChatGPT but they provided invalid syntax. This is sad because overpass is extremely powerful tool. I’ll give the tutorials other commenters linked a try.
- Aachen 3y agoI read up on the syntax a few years ago and, by learning only a few of the symbols, it actually starts to make a lot of sense and seemed like a nice shorthand. I then promptly forgot everything and find the syntax very annoying again nowadays... seriously, it's weird remembering having knowledge but not having the knowledge itself anymore
- flexagoon 3y agoOverpass syntax is one of those things that I just read the documentation for every single time I have to do it. Last time I used it things like ChatGPT didn't exist yet though, so I'll probably use it from now on if I ever have to write an overpass query
- stevage 3y agoYeah me too. No way is my brain going to remember any of that between times that I use it.
- vloewe 3y agoI scraped the these websites https://wiki.openstreetmap.org/wiki/Map_features https://wiki.openstreetmap.org/wiki/Map_features and gave it to OpenAI's Assistant maker -> This made great results in making valid queries Could even make prompts like "Can you find the buildings closer than 500m to a café?"
- dylan604 3y agoI really don't understand the point of shortcuts where this is the result. I'm a really big fan of clear and legible code. I'm not at In-n-Out with a secret menu. I'm trying to make changes/updates to code someone else wrote. I don't care how clever they felt they were by using esoteric shortcuts that might make things short and fit on one line. I want to be able to read the code and follow what it does in the least amount of time. Now, if the compiler makes different/better decisions when reading something like that vs much more legible code, we can maybe have a discussion.
- maxerickson 3y agoThose aren't shortcuts though, it's composition of 3 basic statements. The `(...);` says to gather the results of the statements contained within it into one result. The `._;` is a reference to the previous result. And then the `>;` is an operator that says to go fetch the children of the previous statement. So you are taking the last result and gathering it up together with any children, which is necessary in the OpenStreetMap data model where lines and areas are built up out of other objects. Depending on the use case, the shortcut is often to add `geom` to the print statement, so instead a line with the above and a line with `out;` you just write `out geom;`.
- e-v 3y agoI could just upvote your comment (which I did), but I'd like to tell you explicitly that your comment was particularly informative. Thanks!