shapely 1.0__tar.gz → 1.0b1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- Shapely-1.0b1/CREDITS.txt +6 -0
- {Shapely-1.0 → Shapely-1.0b1}/PKG-INFO +13 -44
- {Shapely-1.0 → Shapely-1.0b1}/README.txt +15 -46
- {Shapely-1.0 → Shapely-1.0b1}/Shapely.egg-info/PKG-INFO +13 -44
- {Shapely-1.0 → Shapely-1.0b1}/Shapely.egg-info/SOURCES.txt +0 -3
- {Shapely-1.0 → Shapely-1.0b1}/Shapely.egg-info/dependency_links.txt +0 -0
- {Shapely-1.0 → Shapely-1.0b1}/Shapely.egg-info/requires.txt +0 -0
- {Shapely-1.0 → Shapely-1.0b1}/Shapely.egg-info/top_level.txt +0 -0
- {Shapely-1.0 → Shapely-1.0b1}/setup.py +5 -11
- {Shapely-1.0 → Shapely-1.0b1}/shapely/geometry/base.py +11 -68
- {Shapely-1.0 → Shapely-1.0b1}/shapely/geometry/linestring.py +7 -13
- {Shapely-1.0 → Shapely-1.0b1}/shapely/geometry/multilinestring.py +6 -8
- {Shapely-1.0 → Shapely-1.0b1}/shapely/geometry/multipoint.py +7 -12
- {Shapely-1.0 → Shapely-1.0b1}/shapely/geometry/multipolygon.py +6 -8
- {Shapely-1.0 → Shapely-1.0b1}/shapely/geometry/point.py +9 -26
- {Shapely-1.0 → Shapely-1.0b1}/shapely/geometry/polygon.py +12 -27
- {Shapely-1.0 → Shapely-1.0b1}/shapely/geos.py +6 -22
- {Shapely-1.0 → Shapely-1.0b1}/shapely/iterops.py +7 -9
- Shapely-1.0b1/shapely/kml.py +0 -0
- Shapely-1.0b1/shapely/predicates.py +50 -0
- {Shapely-1.0 → Shapely-1.0b1}/shapely/topology.py +0 -4
- {Shapely-1.0 → Shapely-1.0b1}/shapely/wkb.py +3 -8
- {Shapely-1.0 → Shapely-1.0b1}/shapely/wkt.py +2 -9
- {Shapely-1.0 → Shapely-1.0b1}/tests/LineString.txt +1 -20
- {Shapely-1.0 → Shapely-1.0b1}/tests/MultiPoint.txt +2 -0
- {Shapely-1.0 → Shapely-1.0b1}/tests/Point.txt +0 -25
- {Shapely-1.0 → Shapely-1.0b1}/tests/Polygon.txt +1 -20
- {Shapely-1.0 → Shapely-1.0b1}/tests/Predicates.txt +1 -1
- Shapely-1.0/CREDITS.txt +0 -10
- Shapely-1.0/HISTORY.txt +0 -16
- Shapely-1.0/manual/manual.txt +0 -847
- Shapely-1.0/manual/style.css +0 -231
- Shapely-1.0/setup_windows.py +0 -39
- Shapely-1.0/shapely/predicates.py +0 -58
- {Shapely-1.0 → Shapely-1.0b1}/CHANGES.txt +0 -0
- /Shapely-1.0/shapely/kml.py → /Shapely-1.0b1/HISTORY.txt +0 -0
- {Shapely-1.0 → Shapely-1.0b1}/LICENSE.txt +0 -0
- {Shapely-1.0 → Shapely-1.0b1}/examples/geoms.py +0 -0
- {Shapely-1.0 → Shapely-1.0b1}/examples/world.py +0 -0
- {Shapely-1.0 → Shapely-1.0b1}/setup.cfg +0 -0
- {Shapely-1.0 → Shapely-1.0b1}/shapely/__init__.py +0 -0
- {Shapely-1.0 → Shapely-1.0b1}/shapely/geometry/__init__.py +0 -0
- {Shapely-1.0 → Shapely-1.0b1}/shapely/geometry/collection.py +0 -0
- {Shapely-1.0 → Shapely-1.0b1}/shapely/geometry/geo.py +0 -0
- {Shapely-1.0 → Shapely-1.0b1}/tests/Array.txt +0 -0
- {Shapely-1.0 → Shapely-1.0b1}/tests/GeoInterface.txt +0 -0
- {Shapely-1.0 → Shapely-1.0b1}/tests/IterOps.txt +0 -0
- {Shapely-1.0 → Shapely-1.0b1}/tests/MultiLineString.txt +0 -0
- {Shapely-1.0 → Shapely-1.0b1}/tests/MultiPolygon.txt +0 -0
- {Shapely-1.0 → Shapely-1.0b1}/tests/Operations.txt +0 -0
- {Shapely-1.0 → Shapely-1.0b1}/tests/Persist.txt +0 -0
- {Shapely-1.0 → Shapely-1.0b1}/tests/__init__.py +0 -0
- {Shapely-1.0 → Shapely-1.0b1}/tests/binascii_hex.txt +0 -0
- {Shapely-1.0 → Shapely-1.0b1}/tests/invalid_intersection.txt +0 -0
- {Shapely-1.0 → Shapely-1.0b1}/tests/rungrind.dist +0 -0
- {Shapely-1.0 → Shapely-1.0b1}/tests/test_doctests.py +0 -0
- {Shapely-1.0 → Shapely-1.0b1}/tests/valgrind-python.supp +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 1.0
|
|
2
2
|
Name: Shapely
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.0b1
|
|
4
4
|
Summary: Geospatial geometries, predicates, and operations
|
|
5
5
|
Home-page: http://trac.gispython.org/projects/PCL/wiki/Shapely
|
|
6
6
|
Author: Sean Gillies
|
|
@@ -9,8 +9,8 @@ License: BSD
|
|
|
9
9
|
Description: Shapely
|
|
10
10
|
=======
|
|
11
11
|
|
|
12
|
-
Shapely is a Python package for programming with
|
|
13
|
-
|
|
12
|
+
Shapely is a Python package for programming with geospatial geometries. It is
|
|
13
|
+
based on GEOS (http://geos.refractions.net). Shapely 1.0 is ignorant about
|
|
14
14
|
coordinate and reference systems. Projection responsibility is left to specific
|
|
15
15
|
applications. For more information, see:
|
|
16
16
|
|
|
@@ -20,22 +20,18 @@ Description: Shapely
|
|
|
20
20
|
Shapely requires Python 2.4+. (I've also begun to port it to Python 3.0:
|
|
21
21
|
http://zcologia.com/news/564/shapely-for-python-3-0/.)
|
|
22
22
|
|
|
23
|
-
|
|
24
23
|
Dependencies
|
|
25
24
|
------------
|
|
26
25
|
|
|
27
|
-
* libgeos_c (2.2.3
|
|
26
|
+
* libgeos_c (2.2.3, also reported to work with 3.0 after small modifications.)
|
|
28
27
|
* Python ctypes_ (standard in Python 2.5+)
|
|
29
28
|
|
|
30
29
|
.. _ctypes: http://pypi.python.org/pypi/ctypes/
|
|
31
30
|
|
|
32
|
-
|
|
33
31
|
Installation
|
|
34
32
|
------------
|
|
35
33
|
|
|
36
|
-
|
|
37
|
-
GEOS DLL. Other users should acquire libgeos_c by any means, make sure that it
|
|
38
|
-
is on the system library path, and install from the Python package index::
|
|
34
|
+
Shapely can be installed from the Python package index::
|
|
39
35
|
|
|
40
36
|
$ sudo easy_install Shapely
|
|
41
37
|
|
|
@@ -43,29 +39,26 @@ Description: Shapely
|
|
|
43
39
|
|
|
44
40
|
$ sudo python setup.py install
|
|
45
41
|
|
|
46
|
-
or by using the development buildout
|
|
42
|
+
or by using the development buildout, which also provides libgeos_c::
|
|
47
43
|
|
|
48
44
|
$ svn co http://svn.gispython.org/svn/gispy/buildout/shapely.buildout/trunk shapely.buildout
|
|
49
45
|
$ cd shapely.buildout
|
|
50
46
|
$ python bootstrap.py
|
|
51
47
|
$ ./bin/buildout
|
|
52
48
|
|
|
53
|
-
|
|
54
49
|
Usage
|
|
55
50
|
-----
|
|
56
51
|
|
|
57
|
-
|
|
52
|
+
Buffer a point::
|
|
58
53
|
|
|
59
54
|
>>> from shapely.geometry import Point
|
|
60
55
|
>>> point = Point(-106.0, 40.0) # longitude, latitude
|
|
61
56
|
>>> point.buffer(10.0)
|
|
62
57
|
<shapely.geometry.polygon.Polygon object at ...>
|
|
63
58
|
|
|
64
|
-
See
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
examples of the geometry APIs.
|
|
68
|
-
|
|
59
|
+
See Operations.txt and Predicates.txt under tests/ for more examples of the
|
|
60
|
+
spatial operations and predicates provided by Shapely. Also see Point.txt,
|
|
61
|
+
LineString.txt, etc for examples of the geometry APIs.
|
|
69
62
|
|
|
70
63
|
Numpy integration
|
|
71
64
|
-----------------
|
|
@@ -87,7 +80,6 @@ Description: Shapely
|
|
|
87
80
|
>>> line.wkt
|
|
88
81
|
'LINESTRING (1.0000000000000000 2.0000000000000000, 3.0000000000000000 4.0000000000000000)'
|
|
89
82
|
|
|
90
|
-
|
|
91
83
|
Python Geo Interface
|
|
92
84
|
--------------------
|
|
93
85
|
|
|
@@ -115,7 +107,6 @@ Description: Shapely
|
|
|
115
107
|
See http://trac.gispython.org/projects/PCL/wiki/PythonGeoInterface for more
|
|
116
108
|
details on the interface.
|
|
117
109
|
|
|
118
|
-
|
|
119
110
|
Testing
|
|
120
111
|
-------
|
|
121
112
|
|
|
@@ -125,11 +116,7 @@ Description: Shapely
|
|
|
125
116
|
$ python point.py
|
|
126
117
|
|
|
127
118
|
There are also two test runners under tests/. test_doctests.py requires
|
|
128
|
-
zope.testing. runalldoctests.py does not.
|
|
129
|
-
tests is::
|
|
130
|
-
|
|
131
|
-
$ python setup.py test
|
|
132
|
-
|
|
119
|
+
zope.testing. runalldoctests.py does not.
|
|
133
120
|
|
|
134
121
|
Support
|
|
135
122
|
-------
|
|
@@ -137,34 +124,16 @@ Description: Shapely
|
|
|
137
124
|
For current information about this project, see the wiki_.
|
|
138
125
|
|
|
139
126
|
.. _wiki: http://trac.gispython.org/projects/PCL/wiki/Shapely
|
|
140
|
-
.. _manual: http://gispython.org/
|
|
127
|
+
.. _manual: http://trac.gispython.org/projects/PCL/wiki/ShapelyManual
|
|
141
128
|
|
|
142
129
|
If you have questions, please consider joining our community list:
|
|
143
130
|
|
|
144
131
|
http://trac.gispython.org/projects/PCL/wiki/CommunityList
|
|
145
132
|
|
|
146
133
|
|
|
147
|
-
Credits
|
|
148
|
-
-------
|
|
149
|
-
|
|
150
|
-
* Sean Gillies (Pleiades)
|
|
151
|
-
* Howard Butler (Hobu, Inc.)
|
|
152
|
-
* Kai Lautaportti (Hexagon IT)
|
|
153
|
-
* Fr |eaigue| d |eaigue| ric Junod (Camptocamp SA)
|
|
154
|
-
* Eric Lemoine (Camptocamp SA)
|
|
155
|
-
* Justin Bronn (GeoDjango) for ctypes inspiration
|
|
156
|
-
* Artem Pavlenko (Mapnik) for help with GEOS DLLs
|
|
157
|
-
|
|
158
|
-
.. |eaigue| unicode:: U+00E9
|
|
159
|
-
:trim:
|
|
160
|
-
|
|
161
|
-
Major portions of this work were supported by a grant (to Pleiades) from the
|
|
162
|
-
U.S. National Endowment for the Humanities (http://www.neh.gov).
|
|
163
|
-
|
|
164
|
-
|
|
165
134
|
Keywords: geometry topology
|
|
166
135
|
Platform: UNKNOWN
|
|
167
|
-
Classifier: Development Status ::
|
|
136
|
+
Classifier: Development Status :: 4 - Beta
|
|
168
137
|
Classifier: Intended Audience :: Developers
|
|
169
138
|
Classifier: Intended Audience :: Science/Research
|
|
170
139
|
Classifier: License :: OSI Approved :: BSD License
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Shapely
|
|
2
2
|
=======
|
|
3
3
|
|
|
4
|
-
Shapely is a Python package for programming with
|
|
5
|
-
|
|
4
|
+
Shapely is a Python package for programming with geospatial geometries. It is
|
|
5
|
+
based on GEOS (http://geos.refractions.net). Shapely 1.0 is ignorant about
|
|
6
6
|
coordinate and reference systems. Projection responsibility is left to specific
|
|
7
7
|
applications. For more information, see:
|
|
8
8
|
|
|
@@ -12,22 +12,18 @@ applications. For more information, see:
|
|
|
12
12
|
Shapely requires Python 2.4+. (I've also begun to port it to Python 3.0:
|
|
13
13
|
http://zcologia.com/news/564/shapely-for-python-3-0/.)
|
|
14
14
|
|
|
15
|
-
|
|
16
15
|
Dependencies
|
|
17
16
|
------------
|
|
18
17
|
|
|
19
|
-
* libgeos_c (2.2.3
|
|
18
|
+
* libgeos_c (2.2.3, also reported to work with 3.0 after small modifications.)
|
|
20
19
|
* Python ctypes_ (standard in Python 2.5+)
|
|
21
20
|
|
|
22
21
|
.. _ctypes: http://pypi.python.org/pypi/ctypes/
|
|
23
22
|
|
|
24
|
-
|
|
25
23
|
Installation
|
|
26
24
|
------------
|
|
27
25
|
|
|
28
|
-
|
|
29
|
-
GEOS DLL. Other users should acquire libgeos_c by any means, make sure that it
|
|
30
|
-
is on the system library path, and install from the Python package index::
|
|
26
|
+
Shapely can be installed from the Python package index::
|
|
31
27
|
|
|
32
28
|
$ sudo easy_install Shapely
|
|
33
29
|
|
|
@@ -35,29 +31,26 @@ with the setup script::
|
|
|
35
31
|
|
|
36
32
|
$ sudo python setup.py install
|
|
37
33
|
|
|
38
|
-
or by using the development buildout
|
|
39
|
-
|
|
40
|
-
$ svn co http://svn.gispython.org/svn/gispy/buildout/shapely.buildout/trunk shapely.buildout
|
|
41
|
-
$ cd shapely.buildout
|
|
42
|
-
$ python bootstrap.py
|
|
43
|
-
$ ./bin/buildout
|
|
34
|
+
or by using the development buildout, which also provides libgeos_c::
|
|
44
35
|
|
|
36
|
+
$ svn co http://svn.gispython.org/svn/gispy/buildout/shapely.buildout/trunk shapely.buildout
|
|
37
|
+
$ cd shapely.buildout
|
|
38
|
+
$ python bootstrap.py
|
|
39
|
+
$ ./bin/buildout
|
|
45
40
|
|
|
46
41
|
Usage
|
|
47
42
|
-----
|
|
48
43
|
|
|
49
|
-
|
|
44
|
+
Buffer a point::
|
|
50
45
|
|
|
51
46
|
>>> from shapely.geometry import Point
|
|
52
47
|
>>> point = Point(-106.0, 40.0) # longitude, latitude
|
|
53
48
|
>>> point.buffer(10.0)
|
|
54
49
|
<shapely.geometry.polygon.Polygon object at ...>
|
|
55
50
|
|
|
56
|
-
See
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
examples of the geometry APIs.
|
|
60
|
-
|
|
51
|
+
See Operations.txt and Predicates.txt under tests/ for more examples of the
|
|
52
|
+
spatial operations and predicates provided by Shapely. Also see Point.txt,
|
|
53
|
+
LineString.txt, etc for examples of the geometry APIs.
|
|
61
54
|
|
|
62
55
|
Numpy integration
|
|
63
56
|
-----------------
|
|
@@ -79,7 +72,6 @@ Numpy arrays can also be adapted to Shapely points and linestrings::
|
|
|
79
72
|
>>> line.wkt
|
|
80
73
|
'LINESTRING (1.0000000000000000 2.0000000000000000, 3.0000000000000000 4.0000000000000000)'
|
|
81
74
|
|
|
82
|
-
|
|
83
75
|
Python Geo Interface
|
|
84
76
|
--------------------
|
|
85
77
|
|
|
@@ -107,7 +99,6 @@ geometry with the asShape factory::
|
|
|
107
99
|
See http://trac.gispython.org/projects/PCL/wiki/PythonGeoInterface for more
|
|
108
100
|
details on the interface.
|
|
109
101
|
|
|
110
|
-
|
|
111
102
|
Testing
|
|
112
103
|
-------
|
|
113
104
|
|
|
@@ -117,11 +108,7 @@ Several of the modules have docstring doctests::
|
|
|
117
108
|
$ python point.py
|
|
118
109
|
|
|
119
110
|
There are also two test runners under tests/. test_doctests.py requires
|
|
120
|
-
zope.testing. runalldoctests.py does not.
|
|
121
|
-
tests is::
|
|
122
|
-
|
|
123
|
-
$ python setup.py test
|
|
124
|
-
|
|
111
|
+
zope.testing. runalldoctests.py does not.
|
|
125
112
|
|
|
126
113
|
Support
|
|
127
114
|
-------
|
|
@@ -129,27 +116,9 @@ Support
|
|
|
129
116
|
For current information about this project, see the wiki_.
|
|
130
117
|
|
|
131
118
|
.. _wiki: http://trac.gispython.org/projects/PCL/wiki/Shapely
|
|
132
|
-
.. _manual: http://gispython.org/
|
|
119
|
+
.. _manual: http://trac.gispython.org/projects/PCL/wiki/ShapelyManual
|
|
133
120
|
|
|
134
121
|
If you have questions, please consider joining our community list:
|
|
135
122
|
|
|
136
123
|
http://trac.gispython.org/projects/PCL/wiki/CommunityList
|
|
137
124
|
|
|
138
|
-
|
|
139
|
-
Credits
|
|
140
|
-
-------
|
|
141
|
-
|
|
142
|
-
* Sean Gillies (Pleiades)
|
|
143
|
-
* Howard Butler (Hobu, Inc.)
|
|
144
|
-
* Kai Lautaportti (Hexagon IT)
|
|
145
|
-
* Fr |eaigue| d |eaigue| ric Junod (Camptocamp SA)
|
|
146
|
-
* Eric Lemoine (Camptocamp SA)
|
|
147
|
-
* Justin Bronn (GeoDjango) for ctypes inspiration
|
|
148
|
-
* Artem Pavlenko (Mapnik) for help with GEOS DLLs
|
|
149
|
-
|
|
150
|
-
.. |eaigue| unicode:: U+00E9
|
|
151
|
-
:trim:
|
|
152
|
-
|
|
153
|
-
Major portions of this work were supported by a grant (to Pleiades) from the
|
|
154
|
-
U.S. National Endowment for the Humanities (http://www.neh.gov).
|
|
155
|
-
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 1.0
|
|
2
2
|
Name: Shapely
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.0b1
|
|
4
4
|
Summary: Geospatial geometries, predicates, and operations
|
|
5
5
|
Home-page: http://trac.gispython.org/projects/PCL/wiki/Shapely
|
|
6
6
|
Author: Sean Gillies
|
|
@@ -9,8 +9,8 @@ License: BSD
|
|
|
9
9
|
Description: Shapely
|
|
10
10
|
=======
|
|
11
11
|
|
|
12
|
-
Shapely is a Python package for programming with
|
|
13
|
-
|
|
12
|
+
Shapely is a Python package for programming with geospatial geometries. It is
|
|
13
|
+
based on GEOS (http://geos.refractions.net). Shapely 1.0 is ignorant about
|
|
14
14
|
coordinate and reference systems. Projection responsibility is left to specific
|
|
15
15
|
applications. For more information, see:
|
|
16
16
|
|
|
@@ -20,22 +20,18 @@ Description: Shapely
|
|
|
20
20
|
Shapely requires Python 2.4+. (I've also begun to port it to Python 3.0:
|
|
21
21
|
http://zcologia.com/news/564/shapely-for-python-3-0/.)
|
|
22
22
|
|
|
23
|
-
|
|
24
23
|
Dependencies
|
|
25
24
|
------------
|
|
26
25
|
|
|
27
|
-
* libgeos_c (2.2.3
|
|
26
|
+
* libgeos_c (2.2.3, also reported to work with 3.0 after small modifications.)
|
|
28
27
|
* Python ctypes_ (standard in Python 2.5+)
|
|
29
28
|
|
|
30
29
|
.. _ctypes: http://pypi.python.org/pypi/ctypes/
|
|
31
30
|
|
|
32
|
-
|
|
33
31
|
Installation
|
|
34
32
|
------------
|
|
35
33
|
|
|
36
|
-
|
|
37
|
-
GEOS DLL. Other users should acquire libgeos_c by any means, make sure that it
|
|
38
|
-
is on the system library path, and install from the Python package index::
|
|
34
|
+
Shapely can be installed from the Python package index::
|
|
39
35
|
|
|
40
36
|
$ sudo easy_install Shapely
|
|
41
37
|
|
|
@@ -43,29 +39,26 @@ Description: Shapely
|
|
|
43
39
|
|
|
44
40
|
$ sudo python setup.py install
|
|
45
41
|
|
|
46
|
-
or by using the development buildout
|
|
42
|
+
or by using the development buildout, which also provides libgeos_c::
|
|
47
43
|
|
|
48
44
|
$ svn co http://svn.gispython.org/svn/gispy/buildout/shapely.buildout/trunk shapely.buildout
|
|
49
45
|
$ cd shapely.buildout
|
|
50
46
|
$ python bootstrap.py
|
|
51
47
|
$ ./bin/buildout
|
|
52
48
|
|
|
53
|
-
|
|
54
49
|
Usage
|
|
55
50
|
-----
|
|
56
51
|
|
|
57
|
-
|
|
52
|
+
Buffer a point::
|
|
58
53
|
|
|
59
54
|
>>> from shapely.geometry import Point
|
|
60
55
|
>>> point = Point(-106.0, 40.0) # longitude, latitude
|
|
61
56
|
>>> point.buffer(10.0)
|
|
62
57
|
<shapely.geometry.polygon.Polygon object at ...>
|
|
63
58
|
|
|
64
|
-
See
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
examples of the geometry APIs.
|
|
68
|
-
|
|
59
|
+
See Operations.txt and Predicates.txt under tests/ for more examples of the
|
|
60
|
+
spatial operations and predicates provided by Shapely. Also see Point.txt,
|
|
61
|
+
LineString.txt, etc for examples of the geometry APIs.
|
|
69
62
|
|
|
70
63
|
Numpy integration
|
|
71
64
|
-----------------
|
|
@@ -87,7 +80,6 @@ Description: Shapely
|
|
|
87
80
|
>>> line.wkt
|
|
88
81
|
'LINESTRING (1.0000000000000000 2.0000000000000000, 3.0000000000000000 4.0000000000000000)'
|
|
89
82
|
|
|
90
|
-
|
|
91
83
|
Python Geo Interface
|
|
92
84
|
--------------------
|
|
93
85
|
|
|
@@ -115,7 +107,6 @@ Description: Shapely
|
|
|
115
107
|
See http://trac.gispython.org/projects/PCL/wiki/PythonGeoInterface for more
|
|
116
108
|
details on the interface.
|
|
117
109
|
|
|
118
|
-
|
|
119
110
|
Testing
|
|
120
111
|
-------
|
|
121
112
|
|
|
@@ -125,11 +116,7 @@ Description: Shapely
|
|
|
125
116
|
$ python point.py
|
|
126
117
|
|
|
127
118
|
There are also two test runners under tests/. test_doctests.py requires
|
|
128
|
-
zope.testing. runalldoctests.py does not.
|
|
129
|
-
tests is::
|
|
130
|
-
|
|
131
|
-
$ python setup.py test
|
|
132
|
-
|
|
119
|
+
zope.testing. runalldoctests.py does not.
|
|
133
120
|
|
|
134
121
|
Support
|
|
135
122
|
-------
|
|
@@ -137,34 +124,16 @@ Description: Shapely
|
|
|
137
124
|
For current information about this project, see the wiki_.
|
|
138
125
|
|
|
139
126
|
.. _wiki: http://trac.gispython.org/projects/PCL/wiki/Shapely
|
|
140
|
-
.. _manual: http://gispython.org/
|
|
127
|
+
.. _manual: http://trac.gispython.org/projects/PCL/wiki/ShapelyManual
|
|
141
128
|
|
|
142
129
|
If you have questions, please consider joining our community list:
|
|
143
130
|
|
|
144
131
|
http://trac.gispython.org/projects/PCL/wiki/CommunityList
|
|
145
132
|
|
|
146
133
|
|
|
147
|
-
Credits
|
|
148
|
-
-------
|
|
149
|
-
|
|
150
|
-
* Sean Gillies (Pleiades)
|
|
151
|
-
* Howard Butler (Hobu, Inc.)
|
|
152
|
-
* Kai Lautaportti (Hexagon IT)
|
|
153
|
-
* Fr |eaigue| d |eaigue| ric Junod (Camptocamp SA)
|
|
154
|
-
* Eric Lemoine (Camptocamp SA)
|
|
155
|
-
* Justin Bronn (GeoDjango) for ctypes inspiration
|
|
156
|
-
* Artem Pavlenko (Mapnik) for help with GEOS DLLs
|
|
157
|
-
|
|
158
|
-
.. |eaigue| unicode:: U+00E9
|
|
159
|
-
:trim:
|
|
160
|
-
|
|
161
|
-
Major portions of this work were supported by a grant (to Pleiades) from the
|
|
162
|
-
U.S. National Endowment for the Humanities (http://www.neh.gov).
|
|
163
|
-
|
|
164
|
-
|
|
165
134
|
Keywords: geometry topology
|
|
166
135
|
Platform: UNKNOWN
|
|
167
|
-
Classifier: Development Status ::
|
|
136
|
+
Classifier: Development Status :: 4 - Beta
|
|
168
137
|
Classifier: Intended Audience :: Developers
|
|
169
138
|
Classifier: Intended Audience :: Science/Research
|
|
170
139
|
Classifier: License :: OSI Approved :: BSD License
|
|
@@ -4,7 +4,6 @@ HISTORY.txt
|
|
|
4
4
|
LICENSE.txt
|
|
5
5
|
README.txt
|
|
6
6
|
setup.py
|
|
7
|
-
setup_windows.py
|
|
8
7
|
Shapely.egg-info/PKG-INFO
|
|
9
8
|
Shapely.egg-info/SOURCES.txt
|
|
10
9
|
Shapely.egg-info/dependency_links.txt
|
|
@@ -12,8 +11,6 @@ Shapely.egg-info/requires.txt
|
|
|
12
11
|
Shapely.egg-info/top_level.txt
|
|
13
12
|
examples/geoms.py
|
|
14
13
|
examples/world.py
|
|
15
|
-
manual/manual.txt
|
|
16
|
-
manual/style.css
|
|
17
14
|
shapely/__init__.py
|
|
18
15
|
shapely/geos.py
|
|
19
16
|
shapely/iterops.py
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
|
|
2
2
|
from setuptools import setup, Extension
|
|
3
|
-
from sys import version_info
|
|
4
|
-
|
|
5
|
-
# Require ctypes egg only for Python < 2.5
|
|
6
|
-
install_requires = ['setuptools']
|
|
7
|
-
if version_info[:2] < (2,5):
|
|
8
|
-
install_requires.append('ctypes')
|
|
9
3
|
|
|
10
4
|
# Get text from README.txt
|
|
11
5
|
readme_text = file('README.txt', 'rb').read()
|
|
12
6
|
|
|
13
7
|
setup(name = 'Shapely',
|
|
14
|
-
version = '1.
|
|
8
|
+
version = '1.0b1',
|
|
15
9
|
description = 'Geospatial geometries, predicates, and operations',
|
|
16
10
|
license = 'BSD',
|
|
17
11
|
keywords = 'geometry topology',
|
|
@@ -21,12 +15,12 @@ setup(name = 'Shapely',
|
|
|
21
15
|
maintainer_email = 'sgillies@frii.com',
|
|
22
16
|
url = 'http://trac.gispython.org/projects/PCL/wiki/Shapely',
|
|
23
17
|
long_description = readme_text,
|
|
24
|
-
packages = ['shapely'
|
|
25
|
-
install_requires =
|
|
26
|
-
#tests_require = ['numpy'],
|
|
18
|
+
packages = ['shapely'],
|
|
19
|
+
install_requires = ['setuptools', 'ctypes'],
|
|
20
|
+
#tests_require = ['numpy'],
|
|
27
21
|
test_suite = 'tests.test_suite',
|
|
28
22
|
classifiers = [
|
|
29
|
-
'Development Status ::
|
|
23
|
+
'Development Status :: 4 - Beta',
|
|
30
24
|
'Intended Audience :: Developers',
|
|
31
25
|
'Intended Audience :: Science/Research',
|
|
32
26
|
'License :: OSI Approved :: BSD License',
|
|
@@ -5,7 +5,7 @@ Base geometry class and utilities.
|
|
|
5
5
|
from ctypes import string_at, byref, c_int, c_size_t, c_char_p, c_double
|
|
6
6
|
import sys
|
|
7
7
|
|
|
8
|
-
from shapely.geos import lgeos
|
|
8
|
+
from shapely.geos import lgeos
|
|
9
9
|
from shapely.predicates import BinaryPredicate, UnaryPredicate
|
|
10
10
|
from shapely.topology import BinaryTopologicalOp, UnaryTopologicalOp
|
|
11
11
|
|
|
@@ -22,8 +22,6 @@ GEOMETRY_TYPES = [
|
|
|
22
22
|
]
|
|
23
23
|
|
|
24
24
|
def geometry_type_name(g):
|
|
25
|
-
if g is None:
|
|
26
|
-
raise ValueError, "Null geometry has no type"
|
|
27
25
|
return GEOMETRY_TYPES[lgeos.GEOSGeomTypeId(g)]
|
|
28
26
|
|
|
29
27
|
# Abstract geometry factory for use with topological methods below
|
|
@@ -158,42 +156,23 @@ class GeometrySequence(object):
|
|
|
158
156
|
max = l
|
|
159
157
|
|
|
160
158
|
|
|
161
|
-
def exceptNull(func):
|
|
162
|
-
"""Decorator which helps avoid GEOS operations on null pointers."""
|
|
163
|
-
def wrapper(*args, **kwargs):
|
|
164
|
-
# self is the first arg
|
|
165
|
-
if args[0]._geom is None:
|
|
166
|
-
raise ValueError, "Null geometry supports no operations"
|
|
167
|
-
return func(*args, **kwargs)
|
|
168
|
-
return wrapper
|
|
169
|
-
|
|
170
|
-
def exceptEitherNull(func):
|
|
171
|
-
"""Decorator which avoids GEOS operations on one or more null pointers."""
|
|
172
|
-
def wrapper(*args, **kwargs):
|
|
173
|
-
# self is the first arg
|
|
174
|
-
if args[0]._geom is None or args[1]._geom is None:
|
|
175
|
-
raise ValueError, "Null geometry supports no operations"
|
|
176
|
-
return func(*args, **kwargs)
|
|
177
|
-
return wrapper
|
|
178
|
-
|
|
179
|
-
|
|
180
159
|
class BaseGeometry(object):
|
|
181
160
|
|
|
182
161
|
"""Provides GEOS spatial predicates and topological operations.
|
|
183
162
|
"""
|
|
184
163
|
|
|
185
|
-
|
|
164
|
+
_geom = None
|
|
186
165
|
_ctypes_data = None
|
|
187
166
|
_ndim = None
|
|
188
167
|
_crs = None
|
|
189
168
|
_owned = False
|
|
190
169
|
|
|
191
170
|
def __init__(self):
|
|
192
|
-
self.
|
|
171
|
+
self._geom = lgeos.GEOSGeomFromWKT(c_char_p('GEOMETRYCOLLECTION EMPTY'))
|
|
193
172
|
|
|
194
173
|
def __del__(self):
|
|
195
|
-
if self.
|
|
196
|
-
lgeos.GEOSGeom_destroy(self.
|
|
174
|
+
if self._geom is not None and not self._owned:
|
|
175
|
+
lgeos.GEOSGeom_destroy(self._geom)
|
|
197
176
|
|
|
198
177
|
def __str__(self):
|
|
199
178
|
return self.to_wkt()
|
|
@@ -210,20 +189,11 @@ class BaseGeometry(object):
|
|
|
210
189
|
return (self.__class__, (), self.to_wkb())
|
|
211
190
|
|
|
212
191
|
def __setstate__(self, state):
|
|
213
|
-
self.
|
|
192
|
+
self._geom = lgeos.GEOSGeomFromWKB_buf(
|
|
214
193
|
c_char_p(state),
|
|
215
194
|
c_size_t(len(state))
|
|
216
195
|
)
|
|
217
196
|
|
|
218
|
-
# _geom has been made a property with the GEOS geometry pointer stored
|
|
219
|
-
# in __geom so that geometries and geometry adapters can share __del__
|
|
220
|
-
|
|
221
|
-
def get_geom(self):
|
|
222
|
-
return self.__geom
|
|
223
|
-
def set_geom(self, val):
|
|
224
|
-
self.__geom = val
|
|
225
|
-
_geom = property(get_geom, set_geom)
|
|
226
|
-
|
|
227
197
|
# Array and ctypes interfaces
|
|
228
198
|
|
|
229
199
|
@property
|
|
@@ -252,7 +222,6 @@ class BaseGeometry(object):
|
|
|
252
222
|
"""Provide the Numpy array protocol."""
|
|
253
223
|
raise NotImplementedError
|
|
254
224
|
|
|
255
|
-
@exceptNull
|
|
256
225
|
def get_coords(self):
|
|
257
226
|
return CoordinateSequence(self)
|
|
258
227
|
|
|
@@ -274,34 +243,19 @@ class BaseGeometry(object):
|
|
|
274
243
|
|
|
275
244
|
# Type of geometry and its representations
|
|
276
245
|
|
|
277
|
-
@exceptNull
|
|
278
246
|
def geometryType(self):
|
|
279
247
|
"""Returns a string representing the geometry type, e.g. 'Polygon'."""
|
|
280
248
|
return geometry_type_name(self._geom)
|
|
281
249
|
|
|
282
|
-
@exceptNull
|
|
283
250
|
def to_wkb(self):
|
|
284
251
|
"""Returns a WKB byte string representation of the geometry."""
|
|
285
|
-
func = lgeos.GEOSGeomToWKB_buf
|
|
286
252
|
size = c_int()
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
return retval
|
|
291
|
-
func.errcheck = errcheck
|
|
292
|
-
return func(self._geom, byref(size))
|
|
293
|
-
|
|
294
|
-
@exceptNull
|
|
253
|
+
bytes = lgeos.GEOSGeomToWKB_buf(self._geom, byref(size))
|
|
254
|
+
return string_at(bytes, size.value)
|
|
255
|
+
|
|
295
256
|
def to_wkt(self):
|
|
296
257
|
"""Returns a WKT string representation of the geometry."""
|
|
297
|
-
|
|
298
|
-
def errcheck(result, func, argtuple):
|
|
299
|
-
retval = result.value
|
|
300
|
-
free(result)
|
|
301
|
-
return retval
|
|
302
|
-
func.restype = allocated_c_char_p
|
|
303
|
-
func.errcheck = errcheck
|
|
304
|
-
return lgeos.GEOSGeomToWKT(self._geom)
|
|
258
|
+
return string_at(lgeos.GEOSGeomToWKT(self._geom))
|
|
305
259
|
|
|
306
260
|
geom_type = property(geometryType)
|
|
307
261
|
wkt = property(to_wkt)
|
|
@@ -310,20 +264,17 @@ class BaseGeometry(object):
|
|
|
310
264
|
# Basic geometry properties
|
|
311
265
|
|
|
312
266
|
@property
|
|
313
|
-
@exceptNull
|
|
314
267
|
def area(self):
|
|
315
268
|
a = c_double()
|
|
316
269
|
retval = lgeos.GEOSArea(self._geom, byref(a))
|
|
317
270
|
return a.value
|
|
318
271
|
|
|
319
272
|
@property
|
|
320
|
-
@exceptNull
|
|
321
273
|
def length(self):
|
|
322
274
|
len = c_double()
|
|
323
275
|
retval = lgeos.GEOSLength(self._geom, byref(len))
|
|
324
276
|
return len.value
|
|
325
277
|
|
|
326
|
-
@exceptEitherNull
|
|
327
278
|
def distance(self, other):
|
|
328
279
|
d = c_double()
|
|
329
280
|
retval = lgeos.GEOSDistance(self._geom, other._geom, byref(d))
|
|
@@ -344,22 +295,15 @@ class BaseGeometry(object):
|
|
|
344
295
|
centroid = UnaryTopologicalOp(lgeos.GEOSGetCentroid, geom_factory)
|
|
345
296
|
|
|
346
297
|
# Buffer has a unique distance argument, so not a descriptor
|
|
347
|
-
@exceptNull
|
|
348
298
|
def buffer(self, distance, quadsegs=16):
|
|
349
299
|
return geom_factory(
|
|
350
300
|
lgeos.GEOSBuffer(self._geom, c_double(distance), c_int(quadsegs))
|
|
351
301
|
)
|
|
352
302
|
|
|
353
303
|
# Relate has a unique string return value
|
|
354
|
-
@exceptNull
|
|
355
304
|
def relate(self, other):
|
|
356
305
|
func = lgeos.GEOSRelate
|
|
357
|
-
|
|
358
|
-
retval = result.value
|
|
359
|
-
free(result)
|
|
360
|
-
return retval
|
|
361
|
-
func.restype = allocated_c_char_p
|
|
362
|
-
func.errcheck = errcheck
|
|
306
|
+
func.restype = c_char_p
|
|
363
307
|
return lgeos.GEOSRelate(self._geom, other._geom)
|
|
364
308
|
|
|
365
309
|
# Binary predicates
|
|
@@ -387,7 +331,6 @@ class BaseGeometry(object):
|
|
|
387
331
|
has_z = UnaryPredicate(lgeos.GEOSHasZ)
|
|
388
332
|
|
|
389
333
|
@property
|
|
390
|
-
@exceptNull
|
|
391
334
|
def bounds(self):
|
|
392
335
|
env = self.envelope
|
|
393
336
|
if env.geom_type != 'Polygon':
|