http request to overpass
This commit is contained in:
parent
71fa63eaa7
commit
a2906f5150
32
pkgs/maps/tiles.fnl
Normal file
32
pkgs/maps/tiles.fnl
Normal file
@ -0,0 +1,32 @@
|
||||
(local req (require :http.request))
|
||||
(local { : dict_to_query } (require :http.util))
|
||||
(local { : view } (require :fennel))
|
||||
|
||||
(local
|
||||
query
|
||||
(->
|
||||
[
|
||||
"[bbox:30.618338,-96.323712,30.591028,-96.330826]"
|
||||
"[out:json]"
|
||||
"[timeout:90];"
|
||||
"("
|
||||
"way ("
|
||||
"30.626917110746,"
|
||||
"-96.348809105664,"
|
||||
"30.634468750236,"
|
||||
"-96.339893442898"
|
||||
");"
|
||||
");"
|
||||
"out geom;"
|
||||
]
|
||||
(table.concat "\n")))
|
||||
|
||||
(let [r
|
||||
(req.new_from_uri
|
||||
"https://overpass-api.de/api/interpreter")]
|
||||
(tset r.headers ":method" "POST")
|
||||
(r:set_body (dict_to_query { :data query }))
|
||||
(let [(headers stream) (r:go)]
|
||||
(print (view headers))
|
||||
(print (stream:get_body_as_string))))
|
||||
|
Loading…
Reference in New Issue
Block a user