problem with shp2mysql: not an array reference

Chris Moser cpmoser at NETWORK54.COM
Fri Feb 18 18:28:44 EST 2005


Ok, I ran into the same problem, and I'm not very proficient at perl either, but (I couldn't believe it
was this simple) look for this part in line 235:

$shape->{ShapeRecords}

Change "ShapeRecords" to "Shaperecords" (note lower case R)

I noticed this when looking at the file and seeing "Shapetype" referenced without the caps.

Anyway, this did the trick for me.


On Tue, 8 Feb 2005 20:20:22 -0800, Gregor Mosheh <stigmata_blackangel at YAHOO.COM>
wrote:

>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.
>
>
>__________________________________________________
>Do You Yahoo!?
>Tired of spam?  Yahoo! Mail has the best spam protection around
>http://mail.yahoo.com



More information about the mapserver-users mailing list