gpt4 book ai didi

javascript - 获取附近的景点,给定纬度、经度和半径

转载 作者:行者123 更新时间:2023-11-29 10:51:46 43 4
gpt4 key购买 nike

我想知道是否会有一些 API 或 Web 服务提供经度和纬度,返回给我附近名胜古迹的列表(可能是餐馆、酒店等)。我一直在搜索谷歌,但没有发现任何有趣的东西。返回 JSON 对象的东西会很棒 ;)

最佳答案

Koordinates有一个用于任意空间数据集的 lat/lng 查询的 API。响应可以是 XML、JSON 或 JSONP。有关信息,请参阅此页面:

例如,可以使用纬度、经度和搜索半径查询此处列出的任何兴趣点 (POI) 图层:

您可以免费上传和使用自己的数据,因此如果您找到更适合您所在位置的数据集,您也可以添加。

-- 编辑:示例,第一条评论后的更多信息 --

对于古巴,您需要查找/创建自己的兴趣点数据集 - 例如,也许可以获取 OpenStreetMap 的一个子集您所在地区的数据。基本上,您需要查找/创建要上传的 Shapefile 点数据集。

完成后,您可以使用上面链接的矢量 API。例如,在新西兰,我们有一个很好的 POI 层,由 Zenbu 提供。 :

使用矢量API抓取一定半径内的特征。例如。要在我的(粗略)位置一公里内找到 10 个最近的点,我可以到达此端点(使用我为此答案生成的 key 。您可以免费创建自己的 API key ):

响应看起来像这样:

{
"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"}}
]
}
}
}
}

关于javascript - 获取附近的景点,给定纬度、经度和半径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8969228/

43 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com