problem with shp2mysql: not an array reference

Lowell Filak lfilak at MEDINACO.ORG
Tue Feb 15 09:22:03 EST 2005


The following message was sent by Gregor Mosheh
<stigmata_blackangel at YAHOO.COM> on Tue, 8 Feb 2005 20:20:22 -0800.

> First off, thanks to those folks who, in regards to my
> question about MyGIS, pointed me to the Wiki. Very
> informative and helpful.
>
> So, I'm trying to convert a shapefile to MySQL using
> shp2mysql.pl and I get the error "Not an array
> reference at line 235" This is after the shapefile has
> been opened (it does properly list the dbf attributes)
> and after the geometry_columns and spatial_ref_sys
> tables are created, but as the first geometry item is
> being processed.
>
> I popped open the script and, although I'm pretty good
> with Perl, I don't have enough background to know what
> it's trying to do nor what's going wrong. I'm hoping
> someone else has seen this problem before and can save
> me a few dozen hours of troubleshooting.
>
> The Perl shapelib binding is Geo-Shapelib 0.12, and
> this is the shp2mysql.pl that came with MapServer
> 4.4.1. The MySQL is version 4.1. The shapefile is line
> data, and I can post the shapefile (4 MB) if
> requested.

Gregor,

What if you 'print "$shape";' before the setting of $appenddata or use
'perl -d shp2mysql.pl ...'. Is $shape created correctly? Is there any
possibility you have an older version of Geo::Shapelib somewhere on the
system?

Lowell



More information about the mapserver-users mailing list