简体   繁体   English

对数据库提供程序(sql,nosql)和模式进行地理编码

[英]geocoding database provider(sql, nosql) and schema

Companies like Yahoo, Google, MS provide geocoding services. 像Yahoo,Google,MS这样的公司都提供地理编码服务。 I'd like to know what is the best way to organize the backend for such services - what is the optimal solution in terms of database provider(SQL vs NOSQL) and database schema. 我想知道为此类服务组织后端的最佳方法是什么-就数据库提供程序(SQL vs NOSQL)和数据库架构而言,什么是最佳解决方案。

Some providers use Extensible Address Language (xAL) to describe an entity in the geocoding response. 一些提供程序使用Extensible Address Language (xAL)来描述地理编码响应中的实体。 xAL has more than 30 data elements. xAL具有30多个数据元素。 Google geocoding API has about 20 data elements. Google地理编码API大约有20个数据元素。

So in case of SQL database there will be 20-30 tables with mostly one-to-many relationships via foreign keys? 因此,在SQL数据库的情况下,将有20-30个表通过外键具有大多数一对多的关系?

What about NOSQL databases, like MongoDB. 像MongoDB这样的NOSQL数据库呢? How would one organize such a database? 一个人如何组织这样的数据库? lots of collections for each data element, similar to SQL? 每个数据元素有很多集合,类似于SQL? One collection where each document completely describes given entity in the address space? 每个文档在地址空间中完全描述给定实体的一个集合?

It's hard to say... It depends on what you need to do with the data in term of analysis and caching. 很难说...这取决于您需要在分析和缓存方面处理数据。

I had to deal with geo coordinates. 我不得不处理地理坐标。 But our app is very simple and we don't need to manipulate the geolocations in DB, simply store and retrieve. 但是我们的应用程序非常简单,我们不需要操纵数据库中的地理位置,只需存储和检索即可。 So I simply store start and end points in 2 columns of each route and a polyline in a binary column, with a few milestones being saved in a dedicated SQL table. 因此,我仅将起点和终点存储在每条路线的2列中,并将折线存储在二进制列中,并将一些里程碑保存在专用的SQL表中。

But for an advanced use of our APP we considered using this: https://simplegeo.com/ 但是,为了更好地使用我们的APP,我们考虑使用以下方法: https : //simplegeo.com/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM