我应该使用什么类型的数据库模式来存储和处理地理位置数据?

发布于 2024-08-27 18:35:58 字数 83 浏览 4 评论 0原文

我正在创建一个应用程序来存储特定交易的地理位置数据。我应该存储一个简单的纬度/经度还是有更优选的标准?我应该使用哪些数据类型以便将来切换到 NoSQL?

I'm creating an application that will store geolocation data for specific transactions. Should I store a simple lat/long or is there a more preferred standard? What datatypes should I use to allow for switching to NoSQL in the future?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

別甾虛僞 2024-09-03 18:35:58
  • 忘记 NoSQL - 学习使用数据库或雇用可以使用数据库的人。大多数 NoSql“主张”都是由那些在精神上无法正确使用数据库的人提出的。

  • 使用特殊数据类型。不确定 MySQL - 但 MS SQL Server 在 2008 服务器中添加了几何/地理位置数据。这并不像拥有数据类型那么容易,因为查询背后的逻辑以及如何构建索引必须位于数据库引擎中才能真正高效。特别是点的二维索引和处理“形式”并不是在后续步骤中轻松有效地添加的内容。

  • Forget about NoSQL - learn to use database or hire someone who can. Most NoSql "propositions" are by people mentally not getting around proper use of databases.

  • Use special data types. Not sure about MySQL - but MS SQL Server added geometry / geolocation data with 2008 server. It is not as easy as having a data type, as the logic behind queries and how to build indices MUST be IN the database engine to be really efficient. Espeically the two-dimensional indices of a point and handling "forms" is not something easil and effectivel added in a post-step.

眼眸印温柔 2024-09-03 18:35:58

世界大地测量标准被广泛使用。最新版本是WGS84。这是全球定位系统等使用的坐标系。

许多数据库都有自定义数据类型来处理空间数据。如果您的数据库就是这种情况,您可能会考虑使用它们来存储坐标。否则,坐标可以存储为纬度/经度。有几个开源库可用于在各种坐标系之间进行转换,因此如果您稍后需要切换,您应该能够轻松地转换数据。

The World Geodetic Standard is widely used. The latest revision is WGS84. This is the coordinate system used by the Global Positioning System, among others.

Many databases have custom data types for dealing with spatial data. If this is the case with your database, you might consider using these for storing coordinates. Otherwise, coordinates may be stored as latitude/longitude. There are several open source libraries available for converting between various coordinate systems, so you should be able to convert your data without too much hassle if you need to switch later on.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文