2012-01-23 213 views

回答

2

Koordinates有一個用於緯度/空間查詢任意空間數據集的API。響應可以是XML,JSON或JSONP。對於信息看到這個頁面:

您可以上傳和使用自己的數據,免費的,所以如果你發現您可以添加更適合您的位置的一組數據。

- 編輯:例如,首先評論後的詳細信息 -

對古巴來說,你需要找到/創建自己的興趣數據集的點 - 例如,也許搶OpenStreetMap的一個子集您所在地區的數據。基本上你需要找到/創建一個Shapefile點數據集來上傳。

一旦你完成了,你可以使用上面鏈接的矢量API。例如,在新西蘭,我們必須通過Zenbu提供了良好的POI層:

使用矢量API在一定半徑範圍內搶特點。例如。我(粗糙)的位置,我可以打這個端點的公里範圍內找到10個最近點(使用我爲這個答案生成的密鑰,您可以免費創建自己的API密鑰。):

的迴應是這樣的:

{ 
    "vectorQuery": { 
     "layers": { 
      "1225": { 
       "crs": {"type": "name", "properties": {"name": "EPSG:4326"}}, 
       "field_names": ["ID", "NAME", "TAGS", "WEBSITE", "ADDRESS", "PHONE", "HOURS", "CATEGORIES", "CREATED_AT", "UPDATED_AT"], 
       "type": "FeatureCollection", 
       "features": [ 
        {"distance": 49, "type": "Feature", "properties": {"WEBSITE": null, "NAME": "Harrier Exports Ltd", "TAGS": null, "CREATED_AT": "2007-07-06 14:12:35", "UPDATED_AT": "2007-07-06 14:12:35", "HOURS": null, "PHONE": "09 369 5475", "ADDRESS": "28 Heather Street, Parnell, Auckland", "ID": 1106637.0, "CATEGORIES": null}}, 
        {"distance": 53, "type": "Feature", "properties": {"WEBSITE": "http://www.asics.co.nz", "NAME": "Brittain Wynyard & Co Ltd", "TAGS": null, "CREATED_AT": "2007-07-06 14:05:02", "UPDATED_AT": "2007-07-06 14:05:02", "HOURS": "Mon-Fri 0630-1730", "PHONE": "09 309 0519", "ADDRESS": "Britwyn Building, 22 Heather Street, Parnell, Auckland", "ID": 1102514.0, "CATEGORIES": null}}, 
        {"distance": 74, "type": "Feature", "properties": {"WEBSITE": "http://www.stagecoach.co.nz/thelink/", "NAME": "Link Bus - Parnell bus stop: Cracroft Street (to city)", "TAGS": "Link Bus Stagecoach Parnell", "CREATED_AT": "2007-03-12 20:27:36", "UPDATED_AT": "2007-03-12 20:44:58", "HOURS": null, "PHONE": null, "ADDRESS": "81 Parnell Rise", "ID": 1094917.0, "CATEGORIES": "BusStation"}}, 
        {"distance": 76, "type": "Feature", "properties": {"WEBSITE": "http://www.thorburn.co.nz", "NAME": "Thorburn Consultants Limited", "TAGS": "Engineering consultants", "CREATED_AT": "2007-03-13 12:49:21", "UPDATED_AT": "2007-03-13 12:49:21", "HOURS": null, "PHONE": "(09) 309 5339", "ADDRESS": "81 Parnell Rise, Parnell, Auckland", "ID": 1095258.0, "CATEGORIES": "Store"}}, 
        {"distance": 81, "type": "Feature", "properties": {"WEBSITE": "http://www.wspa.org.nz", "NAME": "WSPA New Zealand", "TAGS": null, "CREATED_AT": "2007-07-06 14:35:53", "UPDATED_AT": "2007-07-06 14:35:53", "HOURS": null, "PHONE": "09 309 3901", "ADDRESS": "Level 1, 18 Heather Street, Parnell, Auckland", "ID": 1116272.0, "CATEGORIES": null}}, 
        {"distance": 82, "type": "Feature", "properties": {"WEBSITE": "http://www.orangerealty.co.nz", "NAME": "Orange Realty", "TAGS": "Commercial & Industrial Property Management", "CREATED_AT": "2008-08-28 10:49:15", "UPDATED_AT": "2008-08-28 10:49:15", "HOURS": null, "PHONE": "09 377 4747", "ADDRESS": "18 Heather Street", "ID": 1132373.0, "CATEGORIES": null}}, 
        {"distance": 87, "type": "Feature", "properties": {"WEBSITE": "http://www.absolutesound.co.nz", "NAME": "Absolute Sound", "TAGS": "Custom home theatre and audio installers", "CREATED_AT": "2007-03-13 12:46:02", "UPDATED_AT": "2007-03-13 12:46:02", "HOURS": null, "PHONE": "(09) 307 0898", "ADDRESS": "75 Parnell Rise, Parnell, Auckland", "ID": 1094926.0, "CATEGORIES": "Store"}}, 
        {"distance": 87, "type": "Feature", "properties": {"WEBSITE": "http://www.audiovisualsolutions.co.nz", "NAME": "Audio Visual Solutions Ltd", "TAGS": null, "CREATED_AT": "2007-03-13 12:46:18", "UPDATED_AT": "2007-03-13 12:46:18", "HOURS": null, "PHONE": "(09) 302 2271", "ADDRESS": "75 Parnell Rise, Parnell, Auckland", "ID": 1094953.0, "CATEGORIES": null}}, 
        {"distance": 87, "type": "Feature", "properties": {"WEBSITE": "http://www.petergilbert.com", "NAME": "Peter Gilbert Ltd", "TAGS": null, "CREATED_AT": "2007-07-06 14:23:33", "UPDATED_AT": "2007-07-06 14:23:33", "HOURS": null, "PHONE": "09 302 2271", "ADDRESS": "75 Parnell Rise, Parnell, Auckland", "ID": 1111467.0, "CATEGORIES": null}}, 
        {"distance": 105, "type": "Feature", "properties": {"WEBSITE": "http://www.stagecoach.co.nz/thelink/", "NAME": "Link Bus - Parnell bus stop: Fraser Park (to Newmarket)", "TAGS": "Link Bus Stagecoach Parnell", "CREATED_AT": "2007-03-12 20:28:07", "UPDATED_AT": "2007-03-12 20:45:14", "HOURS": null, "PHONE": null, "ADDRESS": "89 Parnell Rise", "ID": 1094918.0, "CATEGORIES": "BusStation"}} 
       ] 
      } 
     } 
    } 
} 
+0

這似乎是一個很大的幫助,但我有點迷失在文檔中,例如,我會給出這個經度和緯度: http://koordinates.com/ search/?q=#@nc=&z=19&c=23.14189%2C-82.35087&e=&f=&mt=MAP 獲取距離2公里遠的地方列表。在這種情況下,我們想給我盧斯卡瓦列羅公園,克里斯托瓦爾科隆紀念碑,哈瓦那大教堂...... –

+0

查看上面的內容。 – Hamish

+0

謝謝,我在上面!:D –

1

谷歌提供了一個Places API你可以用它來做出這樣的請求。看看here看看如何獲​​得附近的地方名單。

+0

我試圖使用谷歌地圖,但我住在古巴,我無法訪問這項服務,因爲我的國家是由美國批准的;) –

0

Simplegeo是一個衆所周知的服務。閱讀更多關於它的地方:https://simplegeo.com/docs/api-endpoints/simplegeo-places

+0

SimpleGeo被Urban Airship收購,他們正在結束地方服務。見http://urbanairship.com/blog/2012/01/12/update-on-our-plan-to-integrate-location-and-context-services-into-our-push-messaging-platform/ – Hamish

相關問題