Difference between revisions of "Overpass templates"
m (→More tests) |
m (→x1) |
||
| Line 245: | Line 245: | ||
==x1== | ==x1== | ||
| + | {{#get_web_data:url=https://overpass.ogf.rent-a-planet.com/api/interpreter?data=(area%5B%22admin_level%22=2%5D%5B%22name%22=%22Mergania%22%5D;)-%3E.bndarea;%0A(way(area.bndarea)%5B%22aeroway%22%3D%22runway%22%5D%3B)%3B%0Aout%20count%3B | ||
| + | |format=xml | ||
| + | |data= | ||
| + | count=/osm/count/@total | ||
| + | |use xpath | ||
| + | }}{{#for_external_table:{{{count}}} }} | ||
| + | |||
| + | |||
| + | {{#get_web_data:url=https://overpass.ogf.rent-a-planet.com/api/interpreter?data=(area%5B%22admin_level%22=2%5D%5B%22name%22=%22Mergania%22%5D;)-%3E.bndarea;%0A(way(area.bndarea)%5B%22aeroway%22%3D%22runway%22%5D%3B)%3B%0Amake%20stats%20length=sum(length())%3Bout%3B | ||
| + | |format=xml | ||
| + | |data= | ||
| + | lngth=/osm/stats/@length | ||
| + | |use xpath | ||
| + | }}{{#for_external_table:{{{lngth}}} }}<!-- | ||
==x2== | ==x2== | ||
Revision as of 22:05, 14 February 2023
Elements
URL-encoding
' ' |
[ |
] |
= |
{{
|
}} |
; |
! |
| |
line break |
space |
" |
> |
$ |
x |
x |
x |
| %20 | %5B | %5D | %3D | %7B%7B | %7D%7D | %3B | %21 | %7C | line break %0A | space %20 | %22 | %3E | %24 | x | x | x |
d
Bounding box
x
2314028892
http://overpass.osm.rambler.ru/cgi/interpreter?data=%28way[tourism~hotel]%28around:5000,50.10707,8.76040%29%29;out; 103498433 [1]
</includeonly>-->
Examples
- Template:MER-opq-length
- Template:MER-opq-countsp
- Template:MER-autoTable rfrsh
- Template:MER-opq-count
- Template:MER-opq-eval
- Template:MER-opq-territorystatistics
- x
- x
- x
- x
- x
Create overpass code for copy&paste
More tests
Test count
Error while fetching data from URL https://overpass.ogf.rent-a-planet.com/api/interpreter?data=(area%5Bname%3D%22Guai%22%5D%5B%22admin_level%22%3D%222%22%5D%3B%20)-%3E.a%3B%20relation%5B%22type%22%3D%22waterway%22%5D%5B%22water%22%3D%22river%22%5D%5Bname%5D(area.a)%3Bout%3B: $2.
Error fetching URL: Could not resolve host: overpass.ogf.rent-a-planet.com
There was a problem during the HTTP request: 0 Error
Could not get URL https://overpass.ogf.rent-a-planet.com/api/interpreter?data=(area%5Bname%3D%22Guai%22%5D%5B%22admin_level%22%3D%222%22%5D%3B%20)-%3E.a%3B%20relation%5B%22type%22%3D%22waterway%22%5D%5B%22water%22%3D%22river%22%5D%5Bname%5D(area.a)%3Bout%3B after 3 tries.
| Name | Length (km) |
Drains into |
|---|
| Name | Length (km) |
Drains into |
|---|
}}ii6
uu
count=/osm/count/@total
count=/osm/count/tag[@k='total']/@v
x1
Could not get URL https://overpass.ogf.rent-a-planet.com/api/interpreter?data=(area%5B%22admin_level%22=2%5D%5B%22name%22=%22Mergania%22%5D;)-%3E.bndarea;%0A(way(area.bndarea)%5B%22aeroway%22%3D%22runway%22%5D%3B)%3B%0Aout%20count%3B after 3 tries.
Could not get URL https://overpass.ogf.rent-a-planet.com/api/interpreter?data=(area%5B%22admin_level%22=2%5D%5B%22name%22=%22Mergania%22%5D;)-%3E.bndarea;%0A(way(area.bndarea)%5B%22aeroway%22%3D%22runway%22%5D%3B)%3B%0Amake%20stats%20length=sum(length())%3Bout%3B after 3 tries.