mysql - shp2mysql : Shapefile import to mysql

标签 mysql shapefile

我要导入shapefile使用shp2mysql工具到mysql数据库:

shp2mysql roads1 roads_table my_db > roads.sql

但是我得到这个错误:

Can't locate Geo/Shapelib.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at /usr/bin/shp2mysql line 9.

我不知道为什么,请帮忙。谢谢。

PS:我正在使用 ubuntu 12.04 Linux。

最佳答案

你必须安装这个 Perl 模块:

http://search.cpan.org/~ajolma/Geo-Shapelib-0.20/Shapelib.pm

我不是 Perl 专家,但您可以尝试使用命令 cpan。我按照默认步骤配置它(除了 What approach do you want?,当我选择 sudo 时,但我不确定)。然后运行命令:

安装 Geo::Shapelib

祝你好运

PS:您可以尝试的另一个工具是 ogr2ogr。它对我有用。看到这个线程:

How to Import shape file into MySQL

关于mysql - shp2mysql : Shapefile import to mysql,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18352185/

相关文章:

projection - Geopandas to_file 给出空白的 prj 文件

r - 使用 R 将纬度/经度点的数据框空间连接到多边形 shapefil

gis - 将 CAD 文件转换为形状文件

mysql - 如何获取 AWS EC2 MySQL 的数据库 url?

php - 我应该使用什么 : inner join or 3 different queries?

mysql - mySQL NetBeans 通信链路故障

r - 使用 R 中的 shapefile 显示区域的子集

R 如何在具有多个多边形的 shapefile 中合并多边形要素? (可重现的代码示例)

Mysql 全文搜索与左连接另一个表

php - 富媒体文件的全文搜索