json 开放街道地图的OpenAPI
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了json 开放街道地图的OpenAPI相关的知识,希望对你有一定的参考价值。
{
"swagger": "2.0",
"info": {
"version": "1.0",
"title": "Open Street Map (OSM)",
"description": "TODO: Add Description"
},
"host": " http:",
"basePath": "//nominatim.openstreetmap.org",
"schemes": [
"http"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {
"/lookup": {
"get": {
"description": "[Full description of the service:](http://wiki.openstreetmap.org/wiki/Nominatim#Address_lookup)",
"summary": "OSM - Address lookup",
"operationId": "LookupGet",
"produces": [
"application/json"
],
"parameters": [
{
"name": "osm_ids",
"in": "query",
"required": true,
"type": "string",
"description": ""
},
{
"name": "format",
"in": "query",
"required": true,
"type": "string",
"description": ""
}
],
"responses": {
"200": {
"description": ""
}
},
"security": [],
"x-unitTests": [
{
"request": {
"method": "GET",
"uri": "/lookup?osm_ids=R146656,W104393803,N240109189&format=json"
},
"expectedResponse": {
"x-allowExtraHeaders": true,
"x-bodyMatchMode": "NONE",
"x-arrayOrderedMatching": false,
"x-arrayCheckCount": false,
"x-matchResponseSchema": true,
"headers": {}
},
"x-testShouldPass": true,
"x-testEnabled": true,
"x-testName": "OSM - Address lookup",
"x-testDescription": "[Full description of the service:](http://wiki.openstreetmap.org/wiki/Nominatim#Address_lookup)"
}
],
"x-operation-settings": {
"CollectParameters": false,
"AllowDynamicQueryParameters": false,
"AllowDynamicFormParameters": false,
"IsMultiContentStreaming": false
}
}
},
"/reverse": {
"get": {
"description": "[Full description of the service:](http://wiki.openstreetmap.org/wiki/Nominatim#Reverse_Geocoding)",
"summary": "OSM - Reverse",
"operationId": "ReverseGet",
"produces": [
"application/json"
],
"parameters": [
{
"name": "format",
"in": "query",
"required": true,
"type": "string",
"description": ""
},
{
"name": "lat",
"in": "query",
"required": true,
"type": "number",
"format": "double",
"description": ""
},
{
"name": "lon",
"in": "query",
"required": true,
"type": "number",
"format": "double",
"description": ""
}
],
"responses": {
"200": {
"description": ""
}
},
"security": [],
"x-unitTests": [
{
"request": {
"method": "GET",
"uri": "/reverse?format=json&lat=40.432546&lon=-3.626966"
},
"expectedResponse": {
"x-allowExtraHeaders": true,
"x-bodyMatchMode": "NONE",
"x-arrayOrderedMatching": false,
"x-arrayCheckCount": false,
"x-matchResponseSchema": true,
"headers": {}
},
"x-testShouldPass": true,
"x-testEnabled": true,
"x-testName": "OSM - Reverse",
"x-testDescription": "[Full description of the service:](http://wiki.openstreetmap.org/wiki/Nominatim#Reverse_Geocoding)"
}
],
"x-operation-settings": {
"CollectParameters": false,
"AllowDynamicQueryParameters": false,
"AllowDynamicFormParameters": false,
"IsMultiContentStreaming": false
}
}
},
"/search": {
"get": {
"description": "[Full documentation](http://wiki.openstreetmap.org/wiki/Nominatim#Search)",
"summary": "OSM - Search",
"operationId": "SearchGet",
"produces": [
"application/json"
],
"parameters": [
{
"name": "format",
"in": "query",
"required": true,
"type": "string",
"description": ""
},
{
"name": "q",
"in": "query",
"required": true,
"type": "string",
"description": ""
}
],
"responses": {
"200": {
"description": ""
}
},
"security": [],
"x-unitTests": [
{
"request": {
"method": "GET",
"uri": "/search?format=json&q=emilio muñoz 35 Madrid"
},
"expectedResponse": {
"x-allowExtraHeaders": true,
"x-bodyMatchMode": "NONE",
"x-arrayOrderedMatching": false,
"x-arrayCheckCount": false,
"x-matchResponseSchema": true,
"headers": {}
},
"x-testShouldPass": true,
"x-testEnabled": true,
"x-testName": "OSM - Search",
"x-testDescription": "[Full documentation](http://wiki.openstreetmap.org/wiki/Nominatim#Search)"
}
],
"x-operation-settings": {
"CollectParameters": false,
"AllowDynamicQueryParameters": false,
"AllowDynamicFormParameters": false,
"IsMultiContentStreaming": false
}
}
}
}
}
以上是关于json 开放街道地图的OpenAPI的主要内容,如果未能解决你的问题,请参考以下文章
ArcGIS API for JavaScript3.x 学习笔记[4] 加载底图Open Street Map开放街道地图