1

I want to import shapefile to mysql database with shp2mysql tool:

shp2mysql roads1 roads_table my_db > roads.sql

But I get this error:

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.

I can't figure out why, please help. Thanks.

PS: I'm working on ubuntu 12.04 Linux.

lulyon
  • 6,707
  • 7
  • 32
  • 49

1 Answers1

1

You have to install this Perl module:

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

I'm not expert in Perl, but you can try use the command cpan. I followed the default steps to configure it (except What approach do you want?, when I chose sudo, but I'm not sure). Then run the command:

install Geo::Shapelib

Good luck

PS: Another tool that you may try is ogr2ogr. It worked for me. See this thread:

How to Import shape file into MySQL

Community
  • 1
  • 1
waltersantosf
  • 346
  • 3
  • 5