shp2mysql.pl problems

Lowell Filak lfilak at MEDINACO.ORG
Mon Aug 23 10:21:14 EDT 2004


I think the documentation points to installing Geo-Shapelib vs.
Geo-ShapeFile .

HTH

Lowell

The following message was sent by dylan <dylan at IICI.NO-IP.ORG> on Tue,
24 Aug 2004 01:19:17 -0700.

> greetings!
>
> i am new to mapserver, and am excited about its integration with mysql...
>
> i just spent the evening trying to figure out how to make shp2mysql.pl
work.
>
> perhaps i am not understanding perl modules, but try as i might i am not
> able to make this script function correctly!
>
> after installing the ShapeFile.pm (and ShapeFile/Shape.pm ) in the
> appropriate directories i get this when running shp2mysql.pl:
>
> /src/mapserver-4.2.2$ ./shp2mysql.pl
> Can't locate Shape.pm in @INC (@INC contains: /usr/local/lib/perl/5.6.1
> /usr/local/share/perl/5.6.1 /usr/lib/perl5 /usr/share/perl5
> /usr/lib/perl/5.6.1 /usr/share/perl/5.6.1 /usr/local/lib/site_perl .) at
> ./shp2mysql.pl line 9.
> BEGIN failed--compilation aborted at ./shp2mysql.pl line 9.
>
> Shape.pm lives in : /usr/local/share/perl/5.6.1/Geo/ShapeFile/Shape.pm
>
> i have tried manually moving Shape.pm to the /usr/local/share/perl/5.6.1
> dir, but that doesn't work either...
>
> i have tried modifying the shp2mysql.pm file:
>
> #use Shape qw/:all/;
> use Geo::ShapeFile::Shape qw/:all/;
> ...and...
> #$shape = new Shape $ARGV[0];
> $shape = new Geo::ShapeFile::Shape $ARGV[0];
>
> ...after doing so results in sph2mysql.pl to run with no arguments... but
> when i specify a shapefile:
>
> ./shp2mysql.pl ../../public_html/mapserver/ca_county/ca_cnty
> Odd number of elements in hash assignment at
> /usr/local/share/perl/5.6.1/Geo/ShapeFile/Shape.pm line 30.
>
> this corresponds to  the line marked with a *:
> ---------------
> sub new {
>     my $proto = shift;
>     my $class = ref($proto) || $proto;
> *        my %args = @_;
>
>     my $self = {
> ------------------
>
> ... any ideas on this mess?
>
>
> thanks in advance!
>
> Dylan



More information about the mapserver-users mailing list