我需要未知数量的坐标字段(或几个字段)如何去做?
使用 MySQL 我需要一个 x,y 坐标列表(可能很长)。我该怎么办?
对于这个问题中令人惊讶的含糊之处,我们深表歉意!我不想解释我的整个项目,但我想更多的解释是为了让这个问题变得有意义。
好吧,我正在为客户做一个地图/方向网络应用程序(不,我研究过 Google 地图 API,但我需要绘制他们的建筑物/校园的地图,所以我认为这不太适用)。所以我目前的计划是创建一些 PHP 脚本,这些脚本将通过 dijkstra 的算法运行(我故意将其简化很多,因为我不想解释整个项目),但由于该算法是基于使用图表我将有一个包含各种坐标的边缘表,以便我知道在图像中如何绘制线条。现在这对你们来说更有意义了吗?我再次道歉,我最初应该更深入地讨论我的问题。
Using MySQL I need to have a list (possibly long list) of x,y coordinates. How should I go about this?
Apologies for the amazing amount of vague in this question! I didn't want to explain my entire project but I suppose some more explanation is in order for this to make any sense as a question.
Ok I'm doing a a map/direction web application for a client (no, I've looked into Google Maps API, but I need to map their buildings/campus so I don't think that applies well). So my current plan is to create some PHP scripts that will run through dijkstra's algorithm (I'm purposely dumbing this down quite a bit because, again, I don't want to explain the whole project) but since that algorithm is based on the use of a graph I was going to have an Edge table that will contain various Coords so that I know, in the image, how to draw my lines. Does this make any more sense to you guys now? Again I apologize, I should've gone a little more into my issue originally.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
由于您的问题很模糊,所以做出了很多假设...
使用两个带有外键的表,这是建模一对多关系的标准方法
making a lot of assumptions since your question is vague...
Use two tables with a foreign key, this is the standard approach to model a one to many relationship
MySQL是一个存储数据的数据库。您可以创建一个包含 XCoord 和 YXoord 字段的表,该表可以轻松处理数百万行。
MySQL is a database which, stores data. You can create a table with XCoord and YXoord fields which can handle millions of rows with ease.