Talk:StreetComplete/Quests/OverpassTurboRedirect3

From OpenStreetMap Wiki
Jump to navigation Jump to search

Simplify

The URL created for this query is too long to share directly.

Then why don't you simplify it?
try it yourself in overpass-turbo
[out:json][timeout:25][bbox:{{bbox}}];

(
  nwr["shop"]["shop"!~"no|vacant"][!"wheelchair"]["name"];
nwr["amenity"~"restaurant|cafe|ice_cream|fast_food|bar|pub|biergarten|food_court|nightclub|cinema|library|arts_centre|bank|bureau_de_change|money_transfer|post_office|internet_cafe|marketplace|police|ranger_station|courthouse|embassy|townhall|community_centre|youth_centre|car_wash|car_rental|fuel|driving_school|doctors|clinic|pharmacy|veterinary|dentist|place_of_worship"][!"wheelchair"]["name"];
  nwr["amenity"="parking"]["parking"="multi-storey"][!"wheelchair"]["name"];
  nwr["amenity"="recycling"]["recycling_type"="centre"][!"wheelchair"]["name"];
  nwr["tourism"~"zoo|aquarium|theme_park|gallery|attraction|viewpoint|museum|hotel|guest_house|hostel|motel|apartment|viewpoint"][!"wheelchair"]["name"];
  nwr["tourism"="information"]["information"="office"][!"wheelchair"]["name"];
  nwr["leisure"~"golf_course|water_park|miniature_golf|dance|bowling_alley|horse_riding|sports_centre|fitness_centre|amusement_arcade|adult_gaming_centre|tanning_salon"][!"wheelchair"]["name"];
  nwr["office"~"insurance|government|lawyer|estate_agent|political_party|travel_agent|tax_advisor|therapist"][!"wheelchair"]["name"];
);
out body;
>;
out skel qt;

Mmd (talk) 10:42, 24 November 2018 (UTC)

Okay, so what exactly is "simpler" about that? --rugk (talk) 11:10, 24 November 2018 (UTC)
It's about your statement "The URL created for this query is too long to share directly". See that steering wheel in the top right corner? Click on it, and you know what I mean ;) Mmd (talk) 11:12, 24 November 2018 (UTC)
Ah, awesome. Thanks. I only need to verify now it is indeed the same query. (and also remove the location) So if I remove all comments I get this: https://gist.github.com/rugk/b3597e3a2bcfc96266fb0cbd8e787193 --rugk (talk) 11:34, 24 November 2018 (UTC)
A few hints as to what I changed:
(1) instead of repeating all query parameters for node/way/relation, I merged them into a single "nwr" statement, which covers all three of them at once.
(2) I moved (bbox) to the top.
(3) I changed ["wheelchair"!~".*"] to [!"wheelchair"], which is the more modern way of doing things.
(4) Removed all comments
If you wonder how this crazy OverpassTurboExample template got filled with all the escaping in there, it's really an overpass turbo feature, which comes in handy here: Export -> Query -> Copy as OSM Wiki Mmd (talk) 11:44, 24 November 2018 (UTC)
Ah, okay, thanks. Did not get a notification about that. This helps a lot, indeed. So I've just trusted yoz
BTW, if you wonder why that query was so ugly: It was generated with the wizard… That's why it possibly does not use the modern syntax etc. (feel free to correct that, there are enough SC Overpass queries ;) )
But really, if you want to simplify the other redirect sites, too, that would likely help: StreetComplete/Quests/OverpassTurboRedirect1 and StreetComplete/Quests/OverpassTurboRedirect2 --rugk (talk) 21:31, 4 December 2018 (UTC)
This topic, here, though, seems to be OOjs UI icon check-constructive.svg --rugk (talk) 21:31, 4 December 2018 (UTC)