in reply to Geo::ShapeFile

First of all, it's gratifying to find people on my favorite Perl site actually using one of my modules, it gives me more motivation to work on some of the enhancements I've wanted to add for a while.

Secondly, are you sure that your test datafile actually contains Z-values? I've found that this is the most common cause of people having this type of problem. Try printing out the values for $shapefile->z_min and $shapefile->z_max to see what the range of values indicated in the shapefile header is, and if the range looks valid based on what you believe the shapefile contains. I tried your code using a test shapefile that I know contains Z-values, and it worked just fine (if you want to try it out, the datafile I used is called masspntz, and is included in the Geo::ShapeFile distribution in the t/test_data directory.)

Finally, could you let me know what version of Geo::ShapeFile you are using, and what platform you are using it on? I'm also curious where your shapefile comes from, as there are some shapefile tools that generate very strange output. If you are still having troubles feel free to email me a copy of your shapefile and I'll be happy to see if I can reproduce your problem.


We're not surrounded, we're in a target-rich environment!

Replies are listed 'Best First'.
Re^2: Geo::ShapeFile
by penny (Novice) on May 12, 2005 at 03:11 UTC
    I stumbled across the Geo::Shape module on a web page for creating svg
    from shapefiles using perl.

    http://www.webmapper.net/svg/create/

    It is really exciting to have the means in perl to access the geometry of shapefiles.
    Thanks very much.

    I am certain the layer has Z values. When the above code was
    adjusted to read the zmax and zmin values. as suggested, it worked.
    Curiously when I tried masspntz with the code the z values were read
    successfully.

    The environment I am running the script is cygwin. ( I can’t have a Unix
    account at work ) and the module version is 0.01

    My shapfile is from Arcgis and is a drainage layer polylineZM layer.

    I will e-mail you the shapefile thanks very much for looking at this.

    Penny