存储地理编码数据常见吗?
在我的网站上,公司可以输入其每个分支机构的位置(地址等)。每次我想在(谷歌)地图上显示它时,与其每次都通过谷歌进行地理编码,不如简单地在输入时对每个地址进行地理编码,并存储坐标以供以后使用。
然而,对于所有的法律术语,我很困惑这是否是一种常规做法,或者开发人员是否通常每次都会进行动态地理编码?
On my site, companies are able to enter in locations (addresses, etc) for each of their branches. Rather than geocoding through Google each an every time that I would like to display it on a (Google) map, it seems better to simply geocode each address upon entry, and store the coordinates for later.
With all the legal jargon, however, I am confused if this is a regular practice, or whether developers usually geocode on the fly each time?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
是的,这是一种常见的做法,尤其是当您在带宽有限的环境中运行时。但是,您不能无限期地存储所有数据。您从 API 下载的内容适用一些限制。
以下是 Google 对此问题的看法(Google Maps API 系列服务条款,http://code .google.com/apis/maps/terms.html 10.1.3.b):
最重要的部分是:
Yes, it is a common practice especially when you are running in a bandwidth-limited environment. However, you are not allowed to store all the data indefinitely. Some restrictions apply on the content you are downloading from the API.
Here is Google take on this problem (Google Maps API Family Terms Of Service, http://code.google.com/apis/maps/terms.html ; 10.1.3.b):
The most important parts are:
需要考虑的一件事是,地理编码坐标和您的地址并不总是描述同一点。由于街道号码的插值和其他不准确性,在这方面没有完美的地理编码服务。根据您使用坐标的目的,您通常能够重新定位该点,因此必须将其保存在数据中。
例如,如果您有一组地址为“Kings street 11-15”的公司,那么该公司的主入口在哪里?交货地点在哪里?诸如此类的事情可能导致无法动态进行地理编码。
即使您想“按原样”使用地理编码坐标,我记得 Bing 地图对“不保存任何数据”规则做了一个例外,以允许存储地理编码位置。不确定谷歌是否也这样做......
One thing to consider is that the geocoded coordinate and your address isn't always describing the same point. No geocoding service is perfect in this matter, due to interpolation of street numbers and other inaccuracies. Depending on what you are using the coordinates for, it is quite often so that you will be able to relocate the point and therefore have to save it in your data.
For instance if you have a set of companys with addresses like "Kings street 11-15", where is the main entrance to the company? Where will deliveries be made? Things like this can make it impossible to geocode on the fly.
Even if you want to use the geocoded coordinat "as is", I can recall that Bing Maps did an exception to the rule of "not saving any data" as to allow storing of geocoded locations. Not sure if Google does the same though...
当然 - 它不像地理编码(本质上只是纬度和经度)是谷歌唯一使用的东西。这几乎是每个人都这样做的方式(并且在过去十年中一直在这样做)
Ofcourse - its not like geocode (which essentially just is latitude and longitude) is something google are the only ones to use. Its a pretty much how everyone does it (and has been done for the last decade)
在 SugarCRM 的 Google 地图项目中,我在数据库(地址缓存模块)中存储来自 Google 地图地理编码 API 的有限数据。我不存储整个对象,只存储其中的一部分。只需存储提高效率所需的内容即可。
主要是:
数据存储在地址缓存中以识别状态为“OK”的地址。因此,我只存储从 Google 地图返回的有限数据。我认为这样做绝对没问题。
另外,我只将其存储为地址缓存,可以随时销毁并重新填充。如果没有“预先填充”的经度/纬度信息,则需要几分钟的时间才能在地图上填充 5,000 条记录。通过缓存,可以在 10 秒内显示包含 5,000 条记录的地图。
http://www.jjwdesign.com/sugarcrm/google-maps-for-sugarcrm
思考问题:
With my Google Maps project for SugarCRM, I am storing limited amounts of data from the Google Maps Geocoding API in the database (Address Cache Module). I don't store the entire object, just parts of it. Just store what you need for efficiency.
Mainly:
The data is stored in an Address Cache to identify addresses with status "OK". So, I'm only storing limited amounts of the data returned from Google Maps. Which I think it absolutely fine to do so.
ALso, I'm only storing this as Address Cache, which can be destroyed and repopulated at any time. Without the "pre-populated" Longitude/Latitude information it would take several minutes to populate a map with 5,000 records. With the cache, a Map with 5,000 records can be displayed in under 10 seconds.
http://www.jjwdesign.com/sugarcrm/google-maps-for-sugarcrm
Questions to Ponder: