
Python bindings for Shapelib
============================

These are two python modules for shapelib created with SWIG.

Shapelib is a free software library for reading and writing ESRI shape
files and can be found at http://gdal.velocet.ca/projects/shapelib. 

SWIG is tool that can generate wrappers of C and C++ libraries for a
variety of scripting languages. It's homepage is www.swig.org.

The two modules here wrap the shape file reading and writing API and the
DBF file reading and writing API. The shape file bindings are currently
limited to 2-dimensional data.


Requirements
------------

To compile the bindings, you need shapelib 1.2.8. Older versions may or
may not work, I've only tested the code with 1.2.8.

SWIG is not required. The files generated by SWIG are contained in the
archive. If modify shapelib.i or dbflib.i and need to recreate the
generated files, you need at least SWIG 1.3.

You also need Python, of course. If you installed prebuilt packages such
as RPMs of some Linux distributions, please make sure that the
development package is also installed.


License
-------

The shapelib python bindings are covered by the LGPL. See COPYING for
more information.


Compilation and Installation
----------------------------

Pyshapelib uses the python distutils which come with Python 2.0 or newer
and are also available separately from python.org for older versions.

To compile the bindings, unpack the archive under the shapelib archive
or move the directory there if you've already unpacked it. Then run

    python setup.py build

to build the bindings. The result can be found under the (new) build
subirectory.

To install run

    python setup.py install

which will install the bindings into python's site-packages directory.
You can use the intall command's --prefix option to select a different
installatin directory. 

For more information about the setup.py script, invoke it with the
--help option:

    python setup.py --help


Documentation
-------------

There's no real documentation for the python bindings themselves, but
there's a simple demo/test script called pytest.py.

The change history is recorded in NEWS and in detail in ChangeLog.
