如何将 shapefile 插入 MySQL 数据库?

发布于 2024-08-15 03:41:04 字数 68 浏览 1 评论 0 原文

我正在尝试找到这个 shp2mysql 工具。但我发现的只是 PHP 实现。网上还有其他版本吗?

I am trying to find this shp2mysql tool. But all I found was a PHP implementation. There is any other version available in the internet?

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

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

发布评论

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

评论(2

玉环 2024-08-22 03:41:04

我找到了解决方案 下载。 (Windows版本)

自述文件说它需要Cygwin,但我刚刚执行它并且它起作用了。

I found a solution for download. (Windows version)

The readme says it needs Cygwin, but I just executed it and it worked.

故笙诉离歌 2024-08-22 03:41:04

我不确定您是否想要将文件插入数据库,但如果您必须这样做,我不明白为什么您不能使用 MySQL 的 BINARY 或 BLOB 数据类型(我不记得 .shp 文件是否是二进制或文本)。只需使用 [插入您最喜欢的语言] 读取文件并构造适当的 MySQL 查询语句以将其添加到数据库中 - 这非常简单,几乎微不足道。

更好的解决方案是将文件存储在文件系统中,并在数据库中记录该文件的路径,以便您在需要时打开该文件并读取它。

I'm not sure you would want to insert files into a database, but if you had to, I don't see why you can't use MySQL's BINARY or BLOB data type (I can't recall if a .shp file is binary or text). Just read in the file using [insert your favorite language] and construct the appropriate MySQL query statement to add it to the database - it's pretty easy, almost trivial.

A better solution would be to store the file in your file system and record a path to it in your database, allowing you to open the file and read it when needed.

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