问题标签 [simplegeo]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
1366 浏览

geolocation - SimpleGeo 是否提供邮政编码到纬度/经度映射?

我正在使用SimpleGeo API,我需要通过邮政编码或城市名称获取地点的纬度/经度。我知道SO中有很多关于通过邮政编码获取坐标的问题,并且有很多很好的数据库。但它们是否与 SimpleGeo 的数据密切相关?我不想仅仅因为我的数据库与 SG 的数据库不同,而在 SimpleGeo 的数据库中存在精确的城市名称/邮政编码。

或者,如果它提供此类数据,我可以完全转向Foursquare API,但这不太可取。

所以,我的问题是:

  1. 我可以通过 SimpleGeo(或至少 Foursquare)通过邮政编码或城市名称获取纬度/经度吗?
  2. 如果没有,我可以使用其他数据库(例如MaxMindGeonames)来获得相同的结果吗?我应该关心数据库之间的差异吗?
0 投票
1 回答
289 浏览

.net - SimpleGeo - 从响应中获取经度和纬度

我有以下 JSON 格式的响应,但是,似乎无法弄清楚如何从中获取对数和纬度

我试过

但是当我尝试获取带有关键“地址”的项目时......我什么也没得到

这是 JSON 响应

{"query":{"latitude":37.779278,"longitude":-122.416582,"address":"San Francisco, CA"},"timestamp":1311197030.697,"features":[{"handle":"SG_4oR6CqYUXZVEotM8ncLk80_37. 780722_-122.417364","name":"06075012400","license":"http://creativecommons.org/publicdomain/mark/1.0/","bounds":[-122.421050,37.775147,-122.413365,37.784657], "href":"http://api.simplegeo.com/1.0/features/SG_4oR6CqYUXZVEotM8ncLk80_37.780722_-122.417364.json","abbr":null,"classifiers":[{"category":"US Census"," type":"Region","subcategory":"Tract"}]},{"handle":"SG_6qya2EVo227KTsivPoqx28_37.782005_-122.420177","name":"市民中心","license":"Not For Redistribution","bounds":[-122.425482,37.773229,-122.409979,37.790629],"href":"http://api.simplegeo.com/1.0/features/ SG_6qya2EVo227KTsivPoqx28_37.782005_-122.420177.json","abbr":null,"classifiers":[{"category":"Neighborhood","type":"Region","subcategory":null}]},{"handle" :"SG_2TnIHbITsDUjuLyhbVeYgx_37.779398_-122.419353","name":"94102","license":"http://creativecommons.org/publicdomain/mark/1.0/","bounds":[-122.429920,37.769441,-122.404583 ,37.789226],"href":"http://api.simplegeo.com/1.0/features/SG_2TnIHbITsDUjuLyhbVeYgx_37.779398_-122.419353.json","abbr":null,"classifiers":[{"category":"邮政编码","type":"Region","subcategory":null}]},{"handle":"SG_4gzxFRgOF9YjFAtAiQFpDC_37.793367_-122.397153","name":"13 区议会" "许可证":"http://creativecommons.org/publicdomain/mark/1.0/","边界":[-122.546386,37.708230,-122.281780,37.929824],"href":"http://api.simplegeo .com/1.0/features/SG_4gzxFRgOF9YjFAtAiQFpDC_37.793367_-122.397153.json","abbr":null,"classifiers":[{"category":"立法院","type":"Region","subcategory":"省级(下)"}]},{"handle":"SG_2WBEyBsRAqLAHw1QuqXTv1_37.787198_-122.429550","name":"国会第 8 区","许可证":"http://creativecommons.org/publicdomain/mark/1.0/","bounds":[-122.612285,37.708131,-122.281780,37.929824],"href":"http://api.simplegeo. com/1.0/features/SG_2WBEyBsRAqLAHw1QuqXTv1_37.787198_-122.429550.json","abbr":null,"classifiers":[{"category":"立法区","type":"Region","subcategory":"National "}]},{"handle":"SG_7TAYWdlPlAIzUDT7MVwxmZ_37.759717_-122.693971","name":"San Francisco","license":"http://creativecommons.org/publicdomain/mark/1.0/","bounds ":[-123.173825,37.639830,-122.281780,37.929824],"href":"http://api.simplegeo.com/1.0/features/SG_7TAYWdlPlAIzUDT7MVwxmZ_37.759717_-122.693971.json","abbr":null,"classifiers":[{"category":"Administrative","type":"Region","subcategory":"County"}]},{"handle":"SG_1mNfKHr5aXH7LWgmZL8Uq7_37.759717_-122.693971" ,"名称":"旧金山","许可证":"http://creativecommons.org/publicdomain/mark/1.0/","边界":[-123.173825,37.639830,-122.281780,37.929824],"href" :"http://api.simplegeo.com/1.0/features/SG_1mNfKHr5aXH7LWgmZL8Uq7_37.759717_-122.693971.json","abbr":null,"classifiers":[{"category":"Municipal","type":"区域","子类别":"城市"}]},{"句柄":"SG_4wyrIh6TQId1MiL2cfYa5d_37.759717_-122.693971","名称":"旧金山联合学区","license":"http://creativecommons.org/publicdomain/mark/1.0/","bounds":[-123.173825,37.639830,-122.281780,37.929824],"href":"http ://api.simplegeo.com/1.0/features/SG_4wyrIh6TQId1MiL2cfYa5d_37.759717_-122.693971.json","abbr":null,"classifiers":[{"category":"学区","type":"Region" ,"子类别":"统一"}]},{"句柄":"SG_4n4ze6xOdAFr0gp1WboZrN_37.551206_-122.127401","名称":"旧金山","许可证":"http://creativecommons.org/publicdomain/mark /1.0/","bounds":[-122.516667,37.191667,-121.733333,38.041667],"href":"http://api.simplegeo.com/1.0/features/SG_4n4ze6xOdAFr0gp1WboZrN_37。551206_-122.127401.json","abbr":null,"classifiers":[{"category":"Urban Area","type":"Region","subcategory":null}]},{"handle": "SG_1wm1YKOa9HLv5VI8IbHVW7_38.107525_-122.693633","name":"州参议院第 3 区","license":"http://creativecommons.org/publicdomain/mark/1.0/","bounds":[-123.134523,37.708230, -122.281780,38.532067],"href":"http://api.simplegeo.com/1.0/features/SG_1wm1YKOa9HLv5VI8IbHVW7_38.107525_-122.693633.json","abbr":null,"classifiers":[{"category": "立法区","type":"Region","subcategory":"Provincial (Upper)"}]},{"handle":"SG_2MySaPILVQG3MoXrsVehyR_37.215297_-119.663837","name":"California","license":"http://creativecommons.org/publicdomain/mark/1.0/","bounds":[-124.482003,32.528832,-114.131211,42.009517], "href":"http://api.simplegeo.com/1.0/features/SG_2MySaPILVQG3MoXrsVehyR_37.215297_-119.663837.json","abbr":"CA","classifiers":[{"category":"Subnational", "type":"Region","subcategory":"State"}]},{"handle":"SG_3tLT0I5cOUWIpoVOBeScOx_41.316130_-119.116571","name":"America/Los_Angeles","license":"creativecommons.org /publicdomain/zero/1.0/","bounds":[-124.733253,32.534622,-114.039345,49.002892],"href":"http://api.simplegeo.com/1.0/features/SG_3tLT0I5cOUWIpoVOBeScOx_41.316130_-119.116571.json","abbr":null,"classifiers":[{"category":"Time Zone","type":"Region","subcategory":null}]} ,{"handle":"SG_3uwSAEdXVBzK1ZER9Nqkdp_45.687160_-112.493107","name":"United States of America","license":"http://creativecommons.org/publicdomain/mark/1.0/","bounds": [-179.142471,18.930138,179.781150,71.412180],"href":"http://api.simplegeo.com/1.0/features/SG_3uwSAEdXVBzK1ZER9Nqkdp_45.687160_-112.493107.json","abbr":null,"classifiers":[ {"category":"National","type":"Region","subcategory":null}]}],"weather":{"wind_speed":"6.每秒 9 米","温度":"78F","露点":"59F","cloud_cover":"0%","wind_direction":"325 度","预报":{"今晚":{ "条件":"多云","降水":"0%","温度":{"max":"58F","min":"55F"}},"明天":{"条件": "晴","降水":"0%","温度":{"max":"70F","min":"56F"}},"今天":{"条件":"晴","降水":"0%","温度":{"max":"73F","min":"59F"}}},"条件":"清除"},“人口统计”:{“人口密度”:7489},“交叉点”:[{“距离”:38.43225250350512,“几何”:{“类型”:“点”,“坐标”:[-122.4167858,37.779583799999997]}, properties":{"highways":[{"osm_way_id":"33789567","type":"residential","name":"Fulton Street"},{"osm_way_id":"26988030","type":" tertiary","name":"Larkin Street"}],"attribution":"(c) OpenStreetMap (http://openstreetmap.org/) 和贡献者","license":"http://creativecommons.org/ licenses/by-sa/2.0/"},"type":"Feature","id":"65287204"},{"distance":69.25254468826954,"几何":{"type":"Point","coordinates":[-122.4165794,37.778655200000003]},"properties":{"highways":[{"osm_way_id":"26988030","type":"tertiary" ,"name":"Larkin Street"},{"osm_way_id":"8920461","type":"unclassified","name":"Grove Street"}],"attribution":"(c) OpenStreetMap (http ://openstreetmap.org/) 和贡献者","license":"http://creativecommons.org/licenses/by-sa/2.0/"},"type":"Feature","id":"65354417 "},{"distance":139.2095933887024,"geometry":{"type":"Point","coordinates":[-122.41696140000001,37.780493499999999]},"properties":{"highways":[{"osm_way_id":"27167270","type":"residential","name":"McAllister Street"},{"osm_way_id":"26988030","type":"tertiary", "name":"Larkin Street"}],"attribution":"(c) OpenStreetMap (http://openstreetmap.org/) 和贡献者","license":"http://creativecommons.org/licenses/by -sa/2.0/"},"type":"Feature","id":"65352337"},{"distance":139.9292506517826,"geometry":{"type":"Point","coordinates":[ -122.415127,37.779789000000001]},"properties":{"highways":[{"osm_way_id":"8915763","type":"residential","name":"Fulton Street"},{"osm_way_id":"26988009","type":"tertiary","name":"Hyde Street"}],"attribution":"(c) OpenStreetMap (http://openstreetmap.org /) 和贡献者","license":"http://creativecommons.org/licenses/by-sa/2.0/"},"type":"Feature","id":"65287201"},{"距离":152.92687955288244,"geometry":{"type":"Point","coordinates":[-122.4149213,37.778867400000003]},"properties":{"highways":[{"osm_way_id":"26988009","type ":"tertiary","name":"海德街"},{"osm_way_id":"8920461","type":"unclassified","name":"Grove Street"}],"attribution":"(c) OpenStreetMap (http://openstreetmap.org/) 和贡献者","license":"http://creativecommons.org/licenses/by-sa/2.0/ "},"type":"Feature","id":"65360267"}],"address":{"geometry":{"coordinates":[-122.41670097091016,37.77925384607872],"type":"Point"} ,"properties":{"address":"164 Larkin St","distance":"0.01","postcode":"94109","city":"San Francisco","county":"San Francisco", "province":"CA","country":"US"},"type":"Feature"}}org/) 和贡献者","license":"http://creativecommons.org/licenses/by-sa/2.0/"},"type":"Feature","id":"65360267"}],"地址":{"几何":{"坐标":[-122.41670097091016,37.77925384607872],"type":"Point"},"properties":{"address":"164 Larkin St","distance":"0.01 ","postcode":"94109","city":"San Francisco","county":"San Francisco","province":"CA","country":"US"},"type":"特征”}}org/) 和贡献者","license":"http://creativecommons.org/licenses/by-sa/2.0/"},"type":"Feature","id":"65360267"}],"地址":{"几何":{"坐标":[-122.41670097091016,37.77925384607872],"type":"Point"},"properties":{"address":"164 Larkin St","distance":"0.01 ","postcode":"94109","city":"San Francisco","county":"San Francisco","province":"CA","country":"US"},"type":"特征”}}65360267"}],"address":{"geometry":{"coordinates":[-122.41670097091016,37.77925384607872],"type":"Point"},"properties":{"address":"164 Larkin St", “距离”:“0.01”,“邮政编码”:“94109”,“城市”:“旧金山”,“县”:“旧金山”,“省”:“CA”,“国家”:“美国”} “类型”:“特征”}}65360267"}],"address":{"geometry":{"coordinates":[-122.41670097091016,37.77925384607872],"type":"Point"},"properties":{"address":"164 Larkin St", “距离”:“0.01”,“邮政编码”:“94109”,“城市”:“旧金山”,“县”:“旧金山”,“省”:“CA”,“国家”:“美国”} “类型”:“特征”}}县":"旧金山","省":"CA","国家":"US"},"type":"Feature"}}县":"旧金山","省":"CA","国家":"US"},"type":"Feature"}}

0 投票
1 回答
965 浏览

javascript - SimpleGeo Polymaps 总菜鸟 LineString 显示为多边形问题?

所以我作为初学者尝试了 polymaps,改编了午夜指挥官的例子:

我以 geoJson 格式在本地加载一些道路:

GeoJson 示例:

现在 mylines.geojson 显示,但它不是显示为一条线,而是显示为多边形。

我的问题是,我需要做什么才能让 Polymaps 将 LineString 显示为一条线(它是道路数据)而不是多边形?

0 投票
1 回答
342 浏览

api - 使用电话号码查找本地企业/地点的 API

寻找一个 API,它将根据电话号码作为输入为我提供场所/地点/本地业务。我查看了 google place/foursquare/simple geo API,但它们似乎没有这个功能。有任何想法吗?

0 投票
1 回答
105 浏览

json - 我可以将 .csv 加载到 Simplegeo Storage 中吗?

有没有一种直接的方法将 .csv 文件加载到 Simplegeo Storage 中?我没有很好的编码技能,我正在尝试进行设置,以便我可以请自由职业者为我的应用程序创建一些地图。如果有人有现有的代码来执行此操作,我可能会弄清楚如何使它适合我的情况。

0 投票
3 回答
2195 浏览

jquery - 简单的 JQuery getJSON 在 IE9 中不起作用

我正在尝试从 SimpleGeo 中读取类别列表...我的代码在 Chrome 和 FireFox 中运行良好,但在 IE 中失败。

查看其他一些帖子似乎提供了一些想法,但 API 似乎没有提供回调,我无法控制它们的格式......

https://stackoverflow.com/questions/6514457/getjson-or-ajax-requests-not-working-with-ie9 https://stackoverflow.com/questions/3517608/why-isnt-this-simple-bit-of -jquery-getjson-working-in-ie8

还有其他想法吗?

0 投票
1 回答
104 浏览

javascript - 使用 SimpleGeo Javascript SDK 的帮助

我是 Javascript 的新手,我正在尝试最终制作一些东西,让用户在使用带有 HTML5 的 getLocation API 时获得位置,并使用 simpleGeo 来构建坐标。

到目前为止,我正试图让 SimpleGeo 工作,我有这个:

然而,这在 Chrome 的 JS 控制台中显示了意外的标识符。任何帮助,将不胜感激。:)

0 投票
1 回答
682 浏览

php - 如何从 Google Place API 或 SimpleGeo 获取中文的地点详细信息响应?

我将 SimpleGeo 用于我的 iPhone 的商业场所,只是

流程是 iPhone --> PHP 页面 --> --> SimpleGeo 服务器。SimpleGeo 服务器响应 --> PHP 页面 --> iPhone。

当我的 iPhone 的语言是中文时,我想用中文从 SimpleGeo 返回数据,我该怎么做?

SimpleGeo 的响应是英文的,所以我想要中文的响应,有没有办法这样做,如果不是使用 Google Places API 来自服务器的中文响应的任何其他可能性?

0 投票
1 回答
461 浏览

geolocation - Geo API 中的部分关键字搜索

我一直在使用 SimpleGeo 为我正在构建的基于位置的应用程序执行一些位置数据查询。他们目前使用 Factual 的数据集。据我所知,没有办法对地点数据进行部分文本查询,可能是因为 Factual 的限制。

我的意思是那种查询"Starb"会以自动完成的方式返回星巴克的结果。

测试 Google Places API 会产生相同的结果。查询"Bullf"宾夕法尼亚州威廉斯波特附近的牛蛙啤酒厂一无所获。查询"Bullfrog"产生正确的结果。

是否有任何地理位置/地点 API 支持这种部分关键字查询?