Perl Module Geo::Shapelib - 0.11 Copyright (c) 2000- Ari Jolma. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. That is, using either a) the GNU General Public License as published by the Free Software Foundation; or b) the "Artistic License". This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either the GNU General Public License or the Artistic License for more details. You should have received a copy of the Artistic License with this Kit, in the file named "Artistic". If not, get it from http://www.perl.com/language/misc/Artistic.html. You should also have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. ACKNOWLEDGEMENTS The example shapefile set is taken from the Shapelib examples. I acknowledge also all those who have sent bug reports etc (See below and Changes). INSTALLATION To install, unzip and untar the archive. In the directory created type perl Makefile.pl make make test make install Geo::Shapelib.pm requires Frank Warmerdam's Shapefile C Library. It (version 1.2.10) is included into this distribution and it is used by default. Edit the Makefile.PL if you already have the library. Shapelib is available from http://shapelib.maptools.org. You can compile the utility programs from Shapefile library with commands cd shapelib; make -f Makefile.Shapelib Documentation is in the module file and will be added onto perllocal.pod as usual. For installation in Windows environment see the end of this file. DESCRIPTION Geo::Shapelib.pm is a Perl extension for reading and writing shapefiles as defined by ESRI(r) using Frank Warmerdam's Shapefile C Library 8<----------------------------------------------------------------- Massimiliano Galanti (massiblue@libero.it) suggested and submitted a patch for ForceStrings option (the case for ForceStrings=>1). 8<----------------------------------------------------------------- From Leif Pedersen: Wed, 12 Feb 2003 16:05:38 -0600 (CST) Hi. I work for Meridian Environmental Technology Inc. We have found your Perl module for Shapelib very useful at our company, and recently we have improved on it. I would like to offer our changes to be included in your next release, if you are interested. I believe we have enough to justify another release. My primary objective was to addethe ability to read one shape at a time out of the shape file. Many of our shape files are large enough to make the machine swap. Some would require several GB of memory to load as a single Perl structure. We also added a couple of options to make the structures easier to deal with. The most useful is the XS wrapper will optionally store the verticies as arrays in the appropriate parts. This is much easier if the script needs to deal with parts separately. While I was at it, I fixed a few bugs. Most of them are minor: - There was a memory leak in Shape.xs. newRV_inc was used to create references in the data structure that was returned. This left the reference count off by one, preventing the memory from being freed. This was fixed by substituting newRV_noinc. - Some data returned by shapelib as doubles were being stored with newSViv(), truncating them to ints. Vertices were done correctly, so this was minor. - svREFCNT_dec() should be used in place of free() for Perl structures. This ensures both that data is not freed until its ref count is zero, and it ensures that all data pointed to by these structures is freed. I've not finished this fix, but it is minor since it only happens when memory allocations fail, which Perl does not always handle gracefully anyway. I'm not quite done, but I would be happy to send you what I have so far. I think I've maintained back compatibility. I have not done any work on creating a shape file one shape at a time. 8<--- Thu, 13 Feb 2003 12:56:16 -0600 (CST) Cool. There's still a couple minor things left, marked with XXX. A user who is upgrading "shouldn't" have anything break, but I've not thoroughly checked that the output data structure in the default format is the same as it was before. I've only changed Shape.pm and Shape.xs and I did not touch changelog. 8<--- Thu, 13 Feb 2003 17:05:06 -0600 (CST) I've fixed one of the XXXs. 8<----------------------------------------------------------------- From daniel.babault@mbda.fr: I use your library on Windows XP within VisualBasic without any problems, but when I want to use it with perl it doesn'work. Searching on internet I found some messages about my problem who seem to be link whith thread implementation. I have contacted Bartolomeo TELARO who have same problem before, he doesnt test anymore but explain me what he does. With aid of Bartolomeo, it works for me I have to compile Perl whithout Multi Threading. Perhaps you can add something about it within your distribution. What I do : I download AP809_source.zip from ActiveState site and Geo-Shapelib-0.07.tar.gz I edit Makefile in the win32 Perl subdirectory and comment out the option regarding multi-threading : I comment USE_MULTI, USE_ITHREADS and USE_IMP_SYS in order to compile. I modify Geo-Shapelib-0.07\shapelib\Makefile.PL [AJ: The changes are in Makefile.PL, please uncomment them] Compiling ant testing is OK on W2k with Visual Studio 6, I've made shapes with my perl program.