Leaflet Overpass Query??

42 views
Skip to first unread message

chris foster

unread,
Dec 4, 2016, 12:56:07 PM12/4/16
to Leaflet

I’ve bee working with the example provided here-

http://kartenkarsten.github.io/leaflet-layer-overpass/demo/

This works good.

I’ve changed the query, line 34, to

query: "node(BBOX)['place'='village'];out;",

This identifies villages and also works good.

 

What I would like to do is identify villages and towns by adding the following query

query: "node(BBOX)['place'='town'];out;",

I cannot find a way to run both queries together. Please can anyone tell me how to write a query which will find villages and towns.

 

I’ve looked at Overpass Turbo which give me the following

/*

This has been generated by the overpass-turbo wizard.

The original search was:

“town and village”

*/

[out:json][timeout:25];

// gather results

(

  // query part for: “town and village”

  node["place"="town"]["place"="village"]({{bbox}});

  way["place"="town"]["place"="village"]({{bbox}});

  relation["place"="town"]["place"="village"]({{bbox}});

);

// print results

out body;

>;

out skel qt;


I cannot seem to make this work either.

 

Any help would be greatly appreciated.

 

Chris

chris foster

unread,
Dec 7, 2016, 7:44:54 AM12/7/16
to Leaflet


Having given this more thought I’ve come up with a solution, the result can be seen here;-

http://chrisfoster.uk/overpass10.php

The above page works as required but it does seem to take some time for the OverPass layers to load, I’m unsure if this is because of inefficiencies in my code or some other reason; any advice on this would be greatly appreciated.

 

Next step is to load features nearby, eg 1km, to a map click, I’ve not really started on this yet but I’m sure I’ll get stuck again at some point.

 

chris

Reply all
Reply to author
Forward
0 new messages