1 |
|
2 |
Python bindings for Shapelib |
3 |
============================ |
4 |
|
5 |
These are three python modules for shapelib: |
6 |
|
7 |
shapelib read/write shapefiles |
8 |
|
9 |
dbflib read/write dbf files |
10 |
|
11 |
shptree quadtree for shapes |
12 |
|
13 |
Shapelib is a free software library for reading and writing ESRI shape |
14 |
files and can be found at http://gdal.velocet.ca/projects/shapelib. |
15 |
|
16 |
The bindings were partly created with SWIG, a tool that can generate |
17 |
wrappers of C and C++ libraries for a variety of scripting languages. |
18 |
It's homepage is http://www.swig.org. |
19 |
|
20 |
|
21 |
|
22 |
Requirements |
23 |
------------ |
24 |
|
25 |
To compile the bindings, you need shapelib 1.2.8 or newer. Older |
26 |
versions may or may not work; nobody has tested that. |
27 |
|
28 |
SWIG is not required. The files generated by SWIG are contained in the |
29 |
archive. If you modify shapelib.i or dbflib.i and need to recreate the |
30 |
generated files, you need SWIG 1.3 Alpha 5. It's unlikely that other |
31 |
versions will work. |
32 |
|
33 |
You also need Python, of course. If you installed prebuilt packages |
34 |
such as RPMs of some Linux distributions, please make sure that the |
35 |
development package is also installed. |
36 |
|
37 |
|
38 |
License |
39 |
------- |
40 |
|
41 |
The shapelib python bindings are covered by the LGPL. See COPYING for |
42 |
more information. |
43 |
|
44 |
|
45 |
Compilation and Installation |
46 |
---------------------------- |
47 |
|
48 |
Pyshapelib uses the python distutils which come with Python 2.0 or newer |
49 |
and are also available separately from python.org for older versions. |
50 |
|
51 |
To compile the bindings, unpack the archive under the shapelib archive |
52 |
or move the directory there if you've already unpacked it. The setup |
53 |
script expects to find the shapelib files in the parent directory. Then |
54 |
run |
55 |
|
56 |
python setup.py build |
57 |
|
58 |
to build the bindings. The result can be found under the (new) build |
59 |
subirectory. |
60 |
|
61 |
To install run |
62 |
|
63 |
python setup.py install |
64 |
|
65 |
which will install the bindings into python's site-packages directory. |
66 |
You can use the intall command's --prefix option to select a different |
67 |
installatin directory. |
68 |
|
69 |
For more information about the setup.py script, invoke it with the |
70 |
--help option: |
71 |
|
72 |
python setup.py --help |
73 |
|
74 |
|
75 |
Documentation |
76 |
------------- |
77 |
|
78 |
There's no real documentation for the python bindings themselves, but |
79 |
there's a simple demo/test script called pytest.py. |
80 |
|
81 |
The change history is recorded in NEWS and in detail in ChangeLog. |