PasteRack.org
Paste # 98921
2019-05-10 18:06:33

Fork as a new paste.

Paste viewed 573 times.


Embed:

#lang racket

(require net/http-client)

(define-values (status headers ip)
  (http-sendrecv "nominatim.openstreetmap.org"
                 "/search/Unter%20den%20Linden%201%20Berlin?format=json&addressdetails=1&limit=1&polygon_svg=1"
                 #:ssl? #t))
status
headers
(port->bytes ip)
(close-input-port ip)

;; results

#"HTTP/1.1 200 OK"
'(#"Date: Fri, 10 May 2019 22:02:29 GMT"
  #"Server: Apache/2.4.29 (Ubuntu)"
  #"Access-Control-Allow-Origin: *"
  #"Access-Control-Allow-Methods: OPTIONS,GET"
  #"Strict-Transport-Security: max-age=31536000; includeSubDomains; preload"
  #"Expect-CT: max-age=0, report-uri=\"https://openstreetmap.report-uri.com/r/d/ct/reportOnly\""
  #"Upgrade: h2"
  #"Connection: Upgrade, close"
  #"Transfer-Encoding: chunked"
  #"Content-Type: application/json; charset=UTF-8")
#"[{\"place_id\":75464525,\"licence\":\"Data \302\251 OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright\",\"osm_type\":\"way\",\"osm_id\":15976890,\"boundingbox\":[\"52.5170798\",\"52.5173311\",\"13.3975116\",\"13.3981577\"],\"lat\":\"52.51720765\",\"lon\":\"13.3978343993255\",\"display_name\":\"Kommandantenhaus, 1, Unter den Linden, Spandauer Vorstadt, Mitte, Berlin, 10117, Deutschland\",\"class\":\"building\",\"type\":\"yes\",\"importance\":0.7360677533294329,\"address\":{\"building\":\"Kommandantenhaus\",\"house_number\":\"1\",\"road\":\"Unter den Linden\",\"neighbourhood\":\"Spandauer Vorstadt\",\"suburb\":\"Mitte\",\"city_district\":\"Mitte\",\"city\":\"Berlin\",\"postcode\":\"10117\",\"country\":\"Deutschland\",\"country_code\":\"de\"},\"svg\":\"M 13.3975116 -52.517290500000001 L 13.397549 -52.517079799999998 13.397715 -52.517090600000003 13.397712200000001 -52.517106400000003 13.3977392 -52.5171086 13.397741699999999 -52.517092400000003 13.3979655 -52.517106900000002 13.3979623 -52.517123300000002 13.397989300000001 -52.517124799999998 13.397992199999999 -52.517109300000001 13.398157700000001 -52.517120300000002 13.398121 -52.5173311 13.3978115 -52.517310299999998 Z\"}]"