shapely 1.2b7__tar.gz → 1.2rc2__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.2b7 → Shapely-1.2rc2}/CHANGES.txt +9 -0
- Shapely-1.2rc2/CREDITS.txt +24 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/MANIFEST.in +2 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/PKG-INFO +26 -21
- {Shapely-1.2b7 → Shapely-1.2rc2}/README.txt +24 -19
- {Shapely-1.2b7 → Shapely-1.2rc2}/Shapely.egg-info/PKG-INFO +26 -21
- {Shapely-1.2b7 → Shapely-1.2rc2}/Shapely.egg-info/SOURCES.txt +3 -0
- Shapely-1.2rc2/setup.cfg +5 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/setup.py +2 -2
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/geometry/base.py +13 -3
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/geos.py +2 -2
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/prepared.py +3 -3
- Shapely-1.2rc2/shapely/tests/cascaded_union.txt +24 -0
- Shapely-1.2rc2/shapely/tests/test_collection.py +10 -0
- Shapely-1.2rc2/shapely/tests/test_emptiness.py +19 -0
- Shapely-1.2b7/CREDITS.txt +0 -9
- Shapely-1.2b7/setup.cfg +0 -15
- {Shapely-1.2b7 → Shapely-1.2rc2}/LICENSE.txt +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/Shapely.egg-info/dependency_links.txt +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/Shapely.egg-info/top_level.txt +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/examples/dissolve.py +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/examples/intersect.py +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/__init__.py +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/coords.py +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/ctypes_declarations.py +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/geometry/__init__.py +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/geometry/collection.py +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/geometry/geo.py +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/geometry/linestring.py +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/geometry/multilinestring.py +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/geometry/multipoint.py +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/geometry/multipolygon.py +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/geometry/point.py +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/geometry/polygon.py +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/geometry/proxy.py +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/geoms.py +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/impl.py +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/iterops.py +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/linref.py +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/ops.py +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/predicates.py +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/tests/Array.txt +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/tests/GeoInterface.txt +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/tests/IterOps.txt +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/tests/LineString.txt +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/tests/MultiLineString.txt +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/tests/MultiPoint.txt +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/tests/MultiPolygon.txt +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/tests/Operations.txt +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/tests/Persist.txt +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/tests/Point.txt +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/tests/Polygon.txt +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/tests/Predicates.txt +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/tests/__init__.py +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/tests/attribute-chains.txt +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/tests/binascii_hex.txt +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/tests/dimensions.txt +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/tests/invalid_intersection.txt +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/tests/linear-referencing.txt +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/tests/linemerge.txt +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/tests/polygonize.txt +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/tests/test_doctests.py +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/tests/test_equality.py +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/tests/test_geomseq.py +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/tests/test_prepared.py +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/tests/test_xy.py +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/tests/threading_test.py +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/tests/wkt_locale.txt +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/topology.py +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/wkb.py +0 -0
- {Shapely-1.2b7 → Shapely-1.2rc2}/shapely/wkt.py +0 -0
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
All tickets are children of http://trac.gispython.org/lab/ticket.
|
|
2
2
|
|
|
3
|
+
1.2rc2 (2010-05-26)
|
|
4
|
+
-------------------
|
|
5
|
+
- Add examples and tests to MANIFEST.in.
|
|
6
|
+
- Release candidate 2.
|
|
7
|
+
|
|
8
|
+
1.2rc1 (2010-05-25)
|
|
9
|
+
-------------------
|
|
10
|
+
- Release candidate.
|
|
11
|
+
|
|
3
12
|
1.2b7 (2010-04-22)
|
|
4
13
|
------------------
|
|
5
14
|
- Memory leak associated with new empty geometry state fixed.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
Shapely is written by:
|
|
2
|
+
|
|
3
|
+
* Sean Gillies
|
|
4
|
+
* Aron Bierbaum
|
|
5
|
+
* Kai Lautaportti
|
|
6
|
+
|
|
7
|
+
Patches contributed by:
|
|
8
|
+
|
|
9
|
+
* Howard Butler
|
|
10
|
+
* Fr |eaigue| d |eaigue| ric Junod
|
|
11
|
+
* Eric Lemoine
|
|
12
|
+
* Jonathan Tartley
|
|
13
|
+
* Kristian Thy
|
|
14
|
+
* Oliver Tonnhofer
|
|
15
|
+
|
|
16
|
+
Additional help from:
|
|
17
|
+
|
|
18
|
+
* Justin Bronn (GeoDjango) for ctypes inspiration
|
|
19
|
+
* Martin Davis (JTS)
|
|
20
|
+
* Jaakko Salli for the Windows distributions
|
|
21
|
+
* Sandro Santilli, Mateusz Loskot, Paul Ramsey, et al (GEOS Project)
|
|
22
|
+
|
|
23
|
+
Major portions of this work were supported by a grant (for Pleiades_) from the
|
|
24
|
+
U.S. National Endowment for the Humanities (http://www.neh.gov).
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 1.0
|
|
2
2
|
Name: Shapely
|
|
3
|
-
Version: 1.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 1.2rc2
|
|
4
|
+
Summary: Geometric objects, predicates, and operations
|
|
5
5
|
Home-page: http://trac.gispython.org/lab/wiki/Shapely
|
|
6
6
|
Author: Sean Gillies
|
|
7
7
|
Author-email: sean.gillies@gmail.com
|
|
8
8
|
License: BSD
|
|
9
|
-
Description:
|
|
9
|
+
Description: =======
|
|
10
10
|
Shapely
|
|
11
11
|
=======
|
|
12
12
|
|
|
@@ -15,10 +15,10 @@ Description:
|
|
|
15
15
|
:height: 400
|
|
16
16
|
|
|
17
17
|
Shapely is a BSD-licensed Python package for manipulation and analysis of
|
|
18
|
-
planar
|
|
19
|
-
systems.
|
|
18
|
+
planar geometric objects. It is not concerned with data formats or coordinate
|
|
19
|
+
systems. It is based on the widely deployed GEOS_ (the engine of PostGIS_) and
|
|
20
20
|
JTS_ (from which GEOS is ported) libraries. This C dependency is traded for the
|
|
21
|
-
ability to
|
|
21
|
+
ability to execute with blazing speed.
|
|
22
22
|
|
|
23
23
|
In a nutshell: Shapely lets you do PostGIS-ish stuff outside the context of a
|
|
24
24
|
database using idiomatic Python. For more details, see:
|
|
@@ -27,7 +27,6 @@ Description:
|
|
|
27
27
|
* Shapely manual_
|
|
28
28
|
* Shapely `example apps`_
|
|
29
29
|
|
|
30
|
-
|
|
31
30
|
Dependencies
|
|
32
31
|
------------
|
|
33
32
|
|
|
@@ -36,7 +35,6 @@ Description:
|
|
|
36
35
|
* Python >=2.5,<3
|
|
37
36
|
* libgeos_c >=3.1 (3.0 and below have not been tested, YMMV)
|
|
38
37
|
|
|
39
|
-
|
|
40
38
|
Installation
|
|
41
39
|
------------
|
|
42
40
|
|
|
@@ -50,7 +48,6 @@ Description:
|
|
|
50
48
|
|
|
51
49
|
$ python setup.py install
|
|
52
50
|
|
|
53
|
-
|
|
54
51
|
Usage
|
|
55
52
|
-----
|
|
56
53
|
|
|
@@ -67,12 +64,19 @@ Description:
|
|
|
67
64
|
See the manual_ for comprehensive usage snippets and the dissolve.py and
|
|
68
65
|
intersect.py `example apps`_.
|
|
69
66
|
|
|
67
|
+
Integration
|
|
68
|
+
-----------
|
|
69
|
+
|
|
70
|
+
Shapely does not read or write data files, but it can serialize and deserialize
|
|
71
|
+
using several well known formats and protocols. The shapely.wkb and shapely.wkt
|
|
72
|
+
modules provide dumpers and loaders inspired by Python's pickle module.::
|
|
70
73
|
|
|
71
|
-
|
|
72
|
-
|
|
74
|
+
>>> from shapely.wkt import dumps, loads
|
|
75
|
+
>>> dumps(loads('POINT (0 0)'))
|
|
76
|
+
'POINT (0.0000000000000000 0.0000000000000000)'
|
|
73
77
|
|
|
74
|
-
All linear
|
|
75
|
-
interface
|
|
78
|
+
All linear objects, such as the rings of a polygon (like ``patch`` above),
|
|
79
|
+
provide the Numpy array interface.::
|
|
76
80
|
|
|
77
81
|
>>> from numpy import asarray
|
|
78
82
|
>>> ag = asarray(patch.exterior)
|
|
@@ -83,9 +87,9 @@ Description:
|
|
|
83
87
|
...
|
|
84
88
|
[ 1.00000000e+01, 0.00000000e+00]])
|
|
85
89
|
|
|
86
|
-
That yields a numpy array of [x, y] arrays. This is not exactly what one
|
|
87
|
-
for plotting shapes with Matplotlib, so Shapely 1.2 adds a `xy`
|
|
88
|
-
|
|
90
|
+
That yields a numpy array of [x, y] arrays. This is not always exactly what one
|
|
91
|
+
wants for plotting shapes with Matplotlib, so Shapely 1.2 adds a `xy` property
|
|
92
|
+
for getting separate arrays of coordinate x and y values.::
|
|
89
93
|
|
|
90
94
|
>>> x, y = patch.exterior.xy
|
|
91
95
|
>>> ax = asarray(x)
|
|
@@ -100,14 +104,16 @@ Description:
|
|
|
100
104
|
>>> asLineString(ag).wkt
|
|
101
105
|
'LINESTRING (10.0000000000000000 0.0000000000000000, ...)'
|
|
102
106
|
|
|
103
|
-
|
|
104
107
|
Testing
|
|
105
108
|
-------
|
|
106
109
|
|
|
107
|
-
Shapely uses a Zope-stye suite of unittests and doctests, excercised
|
|
110
|
+
Shapely uses a Zope-stye suite of unittests and doctests, excercised via
|
|
111
|
+
setup.py.::
|
|
108
112
|
|
|
109
113
|
$ python setup.py test
|
|
110
114
|
|
|
115
|
+
Nosetests won't run the tests properly; Zope doctest suites are not currently
|
|
116
|
+
supported well by nose.
|
|
111
117
|
|
|
112
118
|
Support
|
|
113
119
|
-------
|
|
@@ -118,7 +124,6 @@ Description:
|
|
|
118
124
|
|
|
119
125
|
http://trac.gispython.org/projects/PCL/wiki/CommunityList
|
|
120
126
|
|
|
121
|
-
|
|
122
127
|
Credits
|
|
123
128
|
-------
|
|
124
129
|
|
|
@@ -141,18 +146,18 @@ Description:
|
|
|
141
146
|
|
|
142
147
|
* Justin Bronn (GeoDjango) for ctypes inspiration
|
|
143
148
|
* Martin Davis (JTS)
|
|
149
|
+
* Jaakko Salli for the Windows distributions
|
|
144
150
|
* Sandro Santilli, Mateusz Loskot, Paul Ramsey, et al (GEOS Project)
|
|
145
151
|
|
|
146
152
|
Major portions of this work were supported by a grant (for Pleiades_) from the
|
|
147
153
|
U.S. National Endowment for the Humanities (http://www.neh.gov).
|
|
148
154
|
|
|
149
|
-
|
|
150
155
|
.. _JTS: http://www.vividsolutions.com/jts/jtshome.htm
|
|
151
156
|
.. _PostGIS: http://postgis.org
|
|
152
157
|
.. _GEOS: http://trac.osgeo.org/geos/
|
|
153
158
|
.. _example apps: http://trac.gispython.org/lab/wiki/Examples
|
|
154
159
|
.. _wiki: http://trac.gispython.org/lab/wiki/Shapely
|
|
155
|
-
.. _manual: http://gispython.org/shapely/
|
|
160
|
+
.. _manual: http://gispython.org/shapely/docs/1.2
|
|
156
161
|
.. |eaigue| unicode:: U+00E9
|
|
157
162
|
:trim:
|
|
158
163
|
.. _Pleiades: http://pleiades.stoa.org
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
=======
|
|
2
2
|
Shapely
|
|
3
3
|
=======
|
|
4
4
|
|
|
@@ -7,10 +7,10 @@ Shapely
|
|
|
7
7
|
:height: 400
|
|
8
8
|
|
|
9
9
|
Shapely is a BSD-licensed Python package for manipulation and analysis of
|
|
10
|
-
planar
|
|
11
|
-
systems.
|
|
10
|
+
planar geometric objects. It is not concerned with data formats or coordinate
|
|
11
|
+
systems. It is based on the widely deployed GEOS_ (the engine of PostGIS_) and
|
|
12
12
|
JTS_ (from which GEOS is ported) libraries. This C dependency is traded for the
|
|
13
|
-
ability to
|
|
13
|
+
ability to execute with blazing speed.
|
|
14
14
|
|
|
15
15
|
In a nutshell: Shapely lets you do PostGIS-ish stuff outside the context of a
|
|
16
16
|
database using idiomatic Python. For more details, see:
|
|
@@ -19,7 +19,6 @@ database using idiomatic Python. For more details, see:
|
|
|
19
19
|
* Shapely manual_
|
|
20
20
|
* Shapely `example apps`_
|
|
21
21
|
|
|
22
|
-
|
|
23
22
|
Dependencies
|
|
24
23
|
------------
|
|
25
24
|
|
|
@@ -28,7 +27,6 @@ Shapely 1.2 depends on:
|
|
|
28
27
|
* Python >=2.5,<3
|
|
29
28
|
* libgeos_c >=3.1 (3.0 and below have not been tested, YMMV)
|
|
30
29
|
|
|
31
|
-
|
|
32
30
|
Installation
|
|
33
31
|
------------
|
|
34
32
|
|
|
@@ -42,7 +40,6 @@ or from a source distribution with the setup script::
|
|
|
42
40
|
|
|
43
41
|
$ python setup.py install
|
|
44
42
|
|
|
45
|
-
|
|
46
43
|
Usage
|
|
47
44
|
-----
|
|
48
45
|
|
|
@@ -59,12 +56,19 @@ buffering a point::
|
|
|
59
56
|
See the manual_ for comprehensive usage snippets and the dissolve.py and
|
|
60
57
|
intersect.py `example apps`_.
|
|
61
58
|
|
|
59
|
+
Integration
|
|
60
|
+
-----------
|
|
62
61
|
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
Shapely does not read or write data files, but it can serialize and deserialize
|
|
63
|
+
using several well known formats and protocols. The shapely.wkb and shapely.wkt
|
|
64
|
+
modules provide dumpers and loaders inspired by Python's pickle module.::
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
>>> from shapely.wkt import dumps, loads
|
|
67
|
+
>>> dumps(loads('POINT (0 0)'))
|
|
68
|
+
'POINT (0.0000000000000000 0.0000000000000000)'
|
|
69
|
+
|
|
70
|
+
All linear objects, such as the rings of a polygon (like ``patch`` above),
|
|
71
|
+
provide the Numpy array interface.::
|
|
68
72
|
|
|
69
73
|
>>> from numpy import asarray
|
|
70
74
|
>>> ag = asarray(patch.exterior)
|
|
@@ -75,9 +79,9 @@ interface::
|
|
|
75
79
|
...
|
|
76
80
|
[ 1.00000000e+01, 0.00000000e+00]])
|
|
77
81
|
|
|
78
|
-
That yields a numpy array of [x, y] arrays. This is not exactly what one
|
|
79
|
-
for plotting shapes with Matplotlib, so Shapely 1.2 adds a `xy`
|
|
80
|
-
|
|
82
|
+
That yields a numpy array of [x, y] arrays. This is not always exactly what one
|
|
83
|
+
wants for plotting shapes with Matplotlib, so Shapely 1.2 adds a `xy` property
|
|
84
|
+
for getting separate arrays of coordinate x and y values.::
|
|
81
85
|
|
|
82
86
|
>>> x, y = patch.exterior.xy
|
|
83
87
|
>>> ax = asarray(x)
|
|
@@ -92,14 +96,16 @@ Numpy arrays can also be adapted to Shapely linestrings::
|
|
|
92
96
|
>>> asLineString(ag).wkt
|
|
93
97
|
'LINESTRING (10.0000000000000000 0.0000000000000000, ...)'
|
|
94
98
|
|
|
95
|
-
|
|
96
99
|
Testing
|
|
97
100
|
-------
|
|
98
101
|
|
|
99
|
-
Shapely uses a Zope-stye suite of unittests and doctests, excercised
|
|
102
|
+
Shapely uses a Zope-stye suite of unittests and doctests, excercised via
|
|
103
|
+
setup.py.::
|
|
100
104
|
|
|
101
105
|
$ python setup.py test
|
|
102
106
|
|
|
107
|
+
Nosetests won't run the tests properly; Zope doctest suites are not currently
|
|
108
|
+
supported well by nose.
|
|
103
109
|
|
|
104
110
|
Support
|
|
105
111
|
-------
|
|
@@ -110,7 +116,6 @@ If you have questions, please consider joining our community list:
|
|
|
110
116
|
|
|
111
117
|
http://trac.gispython.org/projects/PCL/wiki/CommunityList
|
|
112
118
|
|
|
113
|
-
|
|
114
119
|
Credits
|
|
115
120
|
-------
|
|
116
121
|
|
|
@@ -133,18 +138,18 @@ Additional help from:
|
|
|
133
138
|
|
|
134
139
|
* Justin Bronn (GeoDjango) for ctypes inspiration
|
|
135
140
|
* Martin Davis (JTS)
|
|
141
|
+
* Jaakko Salli for the Windows distributions
|
|
136
142
|
* Sandro Santilli, Mateusz Loskot, Paul Ramsey, et al (GEOS Project)
|
|
137
143
|
|
|
138
144
|
Major portions of this work were supported by a grant (for Pleiades_) from the
|
|
139
145
|
U.S. National Endowment for the Humanities (http://www.neh.gov).
|
|
140
146
|
|
|
141
|
-
|
|
142
147
|
.. _JTS: http://www.vividsolutions.com/jts/jtshome.htm
|
|
143
148
|
.. _PostGIS: http://postgis.org
|
|
144
149
|
.. _GEOS: http://trac.osgeo.org/geos/
|
|
145
150
|
.. _example apps: http://trac.gispython.org/lab/wiki/Examples
|
|
146
151
|
.. _wiki: http://trac.gispython.org/lab/wiki/Shapely
|
|
147
|
-
.. _manual: http://gispython.org/shapely/
|
|
152
|
+
.. _manual: http://gispython.org/shapely/docs/1.2
|
|
148
153
|
.. |eaigue| unicode:: U+00E9
|
|
149
154
|
:trim:
|
|
150
155
|
.. _Pleiades: http://pleiades.stoa.org
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 1.0
|
|
2
2
|
Name: Shapely
|
|
3
|
-
Version: 1.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 1.2rc2
|
|
4
|
+
Summary: Geometric objects, predicates, and operations
|
|
5
5
|
Home-page: http://trac.gispython.org/lab/wiki/Shapely
|
|
6
6
|
Author: Sean Gillies
|
|
7
7
|
Author-email: sean.gillies@gmail.com
|
|
8
8
|
License: BSD
|
|
9
|
-
Description:
|
|
9
|
+
Description: =======
|
|
10
10
|
Shapely
|
|
11
11
|
=======
|
|
12
12
|
|
|
@@ -15,10 +15,10 @@ Description:
|
|
|
15
15
|
:height: 400
|
|
16
16
|
|
|
17
17
|
Shapely is a BSD-licensed Python package for manipulation and analysis of
|
|
18
|
-
planar
|
|
19
|
-
systems.
|
|
18
|
+
planar geometric objects. It is not concerned with data formats or coordinate
|
|
19
|
+
systems. It is based on the widely deployed GEOS_ (the engine of PostGIS_) and
|
|
20
20
|
JTS_ (from which GEOS is ported) libraries. This C dependency is traded for the
|
|
21
|
-
ability to
|
|
21
|
+
ability to execute with blazing speed.
|
|
22
22
|
|
|
23
23
|
In a nutshell: Shapely lets you do PostGIS-ish stuff outside the context of a
|
|
24
24
|
database using idiomatic Python. For more details, see:
|
|
@@ -27,7 +27,6 @@ Description:
|
|
|
27
27
|
* Shapely manual_
|
|
28
28
|
* Shapely `example apps`_
|
|
29
29
|
|
|
30
|
-
|
|
31
30
|
Dependencies
|
|
32
31
|
------------
|
|
33
32
|
|
|
@@ -36,7 +35,6 @@ Description:
|
|
|
36
35
|
* Python >=2.5,<3
|
|
37
36
|
* libgeos_c >=3.1 (3.0 and below have not been tested, YMMV)
|
|
38
37
|
|
|
39
|
-
|
|
40
38
|
Installation
|
|
41
39
|
------------
|
|
42
40
|
|
|
@@ -50,7 +48,6 @@ Description:
|
|
|
50
48
|
|
|
51
49
|
$ python setup.py install
|
|
52
50
|
|
|
53
|
-
|
|
54
51
|
Usage
|
|
55
52
|
-----
|
|
56
53
|
|
|
@@ -67,12 +64,19 @@ Description:
|
|
|
67
64
|
See the manual_ for comprehensive usage snippets and the dissolve.py and
|
|
68
65
|
intersect.py `example apps`_.
|
|
69
66
|
|
|
67
|
+
Integration
|
|
68
|
+
-----------
|
|
69
|
+
|
|
70
|
+
Shapely does not read or write data files, but it can serialize and deserialize
|
|
71
|
+
using several well known formats and protocols. The shapely.wkb and shapely.wkt
|
|
72
|
+
modules provide dumpers and loaders inspired by Python's pickle module.::
|
|
70
73
|
|
|
71
|
-
|
|
72
|
-
|
|
74
|
+
>>> from shapely.wkt import dumps, loads
|
|
75
|
+
>>> dumps(loads('POINT (0 0)'))
|
|
76
|
+
'POINT (0.0000000000000000 0.0000000000000000)'
|
|
73
77
|
|
|
74
|
-
All linear
|
|
75
|
-
interface
|
|
78
|
+
All linear objects, such as the rings of a polygon (like ``patch`` above),
|
|
79
|
+
provide the Numpy array interface.::
|
|
76
80
|
|
|
77
81
|
>>> from numpy import asarray
|
|
78
82
|
>>> ag = asarray(patch.exterior)
|
|
@@ -83,9 +87,9 @@ Description:
|
|
|
83
87
|
...
|
|
84
88
|
[ 1.00000000e+01, 0.00000000e+00]])
|
|
85
89
|
|
|
86
|
-
That yields a numpy array of [x, y] arrays. This is not exactly what one
|
|
87
|
-
for plotting shapes with Matplotlib, so Shapely 1.2 adds a `xy`
|
|
88
|
-
|
|
90
|
+
That yields a numpy array of [x, y] arrays. This is not always exactly what one
|
|
91
|
+
wants for plotting shapes with Matplotlib, so Shapely 1.2 adds a `xy` property
|
|
92
|
+
for getting separate arrays of coordinate x and y values.::
|
|
89
93
|
|
|
90
94
|
>>> x, y = patch.exterior.xy
|
|
91
95
|
>>> ax = asarray(x)
|
|
@@ -100,14 +104,16 @@ Description:
|
|
|
100
104
|
>>> asLineString(ag).wkt
|
|
101
105
|
'LINESTRING (10.0000000000000000 0.0000000000000000, ...)'
|
|
102
106
|
|
|
103
|
-
|
|
104
107
|
Testing
|
|
105
108
|
-------
|
|
106
109
|
|
|
107
|
-
Shapely uses a Zope-stye suite of unittests and doctests, excercised
|
|
110
|
+
Shapely uses a Zope-stye suite of unittests and doctests, excercised via
|
|
111
|
+
setup.py.::
|
|
108
112
|
|
|
109
113
|
$ python setup.py test
|
|
110
114
|
|
|
115
|
+
Nosetests won't run the tests properly; Zope doctest suites are not currently
|
|
116
|
+
supported well by nose.
|
|
111
117
|
|
|
112
118
|
Support
|
|
113
119
|
-------
|
|
@@ -118,7 +124,6 @@ Description:
|
|
|
118
124
|
|
|
119
125
|
http://trac.gispython.org/projects/PCL/wiki/CommunityList
|
|
120
126
|
|
|
121
|
-
|
|
122
127
|
Credits
|
|
123
128
|
-------
|
|
124
129
|
|
|
@@ -141,18 +146,18 @@ Description:
|
|
|
141
146
|
|
|
142
147
|
* Justin Bronn (GeoDjango) for ctypes inspiration
|
|
143
148
|
* Martin Davis (JTS)
|
|
149
|
+
* Jaakko Salli for the Windows distributions
|
|
144
150
|
* Sandro Santilli, Mateusz Loskot, Paul Ramsey, et al (GEOS Project)
|
|
145
151
|
|
|
146
152
|
Major portions of this work were supported by a grant (for Pleiades_) from the
|
|
147
153
|
U.S. National Endowment for the Humanities (http://www.neh.gov).
|
|
148
154
|
|
|
149
|
-
|
|
150
155
|
.. _JTS: http://www.vividsolutions.com/jts/jtshome.htm
|
|
151
156
|
.. _PostGIS: http://postgis.org
|
|
152
157
|
.. _GEOS: http://trac.osgeo.org/geos/
|
|
153
158
|
.. _example apps: http://trac.gispython.org/lab/wiki/Examples
|
|
154
159
|
.. _wiki: http://trac.gispython.org/lab/wiki/Shapely
|
|
155
|
-
.. _manual: http://gispython.org/shapely/
|
|
160
|
+
.. _manual: http://gispython.org/shapely/docs/1.2
|
|
156
161
|
.. |eaigue| unicode:: U+00E9
|
|
157
162
|
:trim:
|
|
158
163
|
.. _Pleiades: http://pleiades.stoa.org
|
|
@@ -51,12 +51,15 @@ shapely/tests/Predicates.txt
|
|
|
51
51
|
shapely/tests/__init__.py
|
|
52
52
|
shapely/tests/attribute-chains.txt
|
|
53
53
|
shapely/tests/binascii_hex.txt
|
|
54
|
+
shapely/tests/cascaded_union.txt
|
|
54
55
|
shapely/tests/dimensions.txt
|
|
55
56
|
shapely/tests/invalid_intersection.txt
|
|
56
57
|
shapely/tests/linear-referencing.txt
|
|
57
58
|
shapely/tests/linemerge.txt
|
|
58
59
|
shapely/tests/polygonize.txt
|
|
60
|
+
shapely/tests/test_collection.py
|
|
59
61
|
shapely/tests/test_doctests.py
|
|
62
|
+
shapely/tests/test_emptiness.py
|
|
60
63
|
shapely/tests/test_equality.py
|
|
61
64
|
shapely/tests/test_geomseq.py
|
|
62
65
|
shapely/tests/test_prepared.py
|
Shapely-1.2rc2/setup.cfg
ADDED
|
@@ -16,10 +16,10 @@ readme_text = file('README.txt', 'rb').read()
|
|
|
16
16
|
setup_args = dict(
|
|
17
17
|
metadata_version = '1.2',
|
|
18
18
|
name = 'Shapely',
|
|
19
|
-
version = '1.
|
|
19
|
+
version = '1.2rc2',
|
|
20
20
|
requires_python = '>=2.5,<3',
|
|
21
21
|
requires_external = 'libgeos_c (>=3.1)',
|
|
22
|
-
description = '
|
|
22
|
+
description = 'Geometric objects, predicates, and operations',
|
|
23
23
|
license = 'BSD',
|
|
24
24
|
keywords = 'geometry topology gis',
|
|
25
25
|
author = 'Sean Gillies',
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
from functools import wraps
|
|
5
5
|
import sys
|
|
6
|
+
import warnings
|
|
6
7
|
|
|
7
8
|
from shapely.coords import CoordinateSequence
|
|
8
9
|
from shapely.geos import lgeos
|
|
@@ -260,13 +261,15 @@ class BaseGeometry(object):
|
|
|
260
261
|
"""A figure that envelopes the geometry"""
|
|
261
262
|
return geom_factory(self.impl['envelope'](self))
|
|
262
263
|
|
|
263
|
-
def buffer(self, distance, quadsegs=
|
|
264
|
+
def buffer(self, distance, resolution=16, quadsegs=None):
|
|
264
265
|
"""Returns a geometry with an envelope at a distance from the object's
|
|
265
266
|
envelope
|
|
266
267
|
|
|
267
268
|
A negative distance has a "shrink" effect. A zero distance may be used
|
|
268
269
|
to "tidy" a polygon. The resolution of the buffer around each vertex of
|
|
269
|
-
the object increases by increasing the
|
|
270
|
+
the object increases by increasing the resolution keyword parameter
|
|
271
|
+
or second positional parameter. Note: the use of a `quadsegs` parameter
|
|
272
|
+
is deprecated and will be gone from the next major release.
|
|
270
273
|
|
|
271
274
|
Example:
|
|
272
275
|
|
|
@@ -279,7 +282,14 @@ class BaseGeometry(object):
|
|
|
279
282
|
>>> g.buffer(1.0, 3).area # triangle approximation
|
|
280
283
|
3.0
|
|
281
284
|
"""
|
|
282
|
-
|
|
285
|
+
if quadsegs is not None:
|
|
286
|
+
warnings.warn(
|
|
287
|
+
"The `quadsegs` argument is deprecated. Use `resolution`.",
|
|
288
|
+
DeprecationWarning)
|
|
289
|
+
res = quadsegs
|
|
290
|
+
else:
|
|
291
|
+
res = resolution
|
|
292
|
+
return geom_factory(self.impl['buffer'](self, distance, res))
|
|
283
293
|
|
|
284
294
|
def simplify(self, tolerance, preserve_topology=True):
|
|
285
295
|
"""Returns a simplified geometry produced by the Douglas-Puecker
|
|
@@ -99,7 +99,7 @@ def _geos_c_version():
|
|
|
99
99
|
v = func().split('-')[2]
|
|
100
100
|
return tuple(int(n) for n in v.split('.'))
|
|
101
101
|
|
|
102
|
-
geos_c_version = _geos_c_version()
|
|
102
|
+
geos_capi_version = geos_c_version = _geos_c_version()
|
|
103
103
|
|
|
104
104
|
class allocated_c_char_p(c_char_p):
|
|
105
105
|
pass
|
|
@@ -348,7 +348,7 @@ class LGEOS16LR(LGEOS16):
|
|
|
348
348
|
"""Proxy for the reentrant GEOS_C DLL/SO API version 1.6 with linear
|
|
349
349
|
referencing
|
|
350
350
|
"""
|
|
351
|
-
geos_capi_version =
|
|
351
|
+
geos_capi_version = geos_c_version
|
|
352
352
|
def __init__(self, dll):
|
|
353
353
|
super(LGEOS16LR, self).__init__(dll)
|
|
354
354
|
|
|
@@ -48,7 +48,7 @@ class PreparedGeometry(object):
|
|
|
48
48
|
return bool(self.impl['prepared_covers'](self, other))
|
|
49
49
|
|
|
50
50
|
|
|
51
|
-
def prep(
|
|
52
|
-
"""Creates and returns a prepared
|
|
53
|
-
return PreparedGeometry(
|
|
51
|
+
def prep(ob):
|
|
52
|
+
"""Creates and returns a prepared geometric object."""
|
|
53
|
+
return PreparedGeometry(ob)
|
|
54
54
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
Cascaded Union
|
|
2
|
+
==============
|
|
3
|
+
|
|
4
|
+
>>> from functools import partial
|
|
5
|
+
>>> import random
|
|
6
|
+
>>> from shapely.geometry import Point
|
|
7
|
+
>>> from shapely.ops import cascaded_union
|
|
8
|
+
|
|
9
|
+
Use a partial function to make 100 points uniformly distributed in a 40x40
|
|
10
|
+
box centered on 0,0.
|
|
11
|
+
|
|
12
|
+
>>> r = partial(random.uniform, -20.0, 20.0)
|
|
13
|
+
>>> points = [Point(r(), r()) for i in range(100)]
|
|
14
|
+
|
|
15
|
+
Buffer the points, producing 100 polygon spots
|
|
16
|
+
|
|
17
|
+
>>> spots = [p.buffer(2.5) for p in points]
|
|
18
|
+
|
|
19
|
+
Perform a cascaded union of the polygon spots, dissolving them into a
|
|
20
|
+
collection of polygon patches
|
|
21
|
+
|
|
22
|
+
>>> cascaded_union(spots) # doctest: +ELLIPSIS
|
|
23
|
+
<shapely.geometry.multipolygon.MultiPolygon object at 0x...>
|
|
24
|
+
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import unittest
|
|
2
|
+
from shapely.geometry.collection import GeometryCollection
|
|
3
|
+
|
|
4
|
+
class CollectionTestCase(unittest.TestCase):
|
|
5
|
+
def test_array_interface(self):
|
|
6
|
+
m = GeometryCollection()
|
|
7
|
+
self.failUnlessEqual(len(m), 0)
|
|
8
|
+
|
|
9
|
+
def test_suite():
|
|
10
|
+
return unittest.TestLoader().loadTestsFromTestCase(CollectionTestCase)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import unittest
|
|
2
|
+
from shapely.geometry.base import BaseGeometry
|
|
3
|
+
from shapely.geometry import Point
|
|
4
|
+
|
|
5
|
+
class EmptinessTestCase(unittest.TestCase):
|
|
6
|
+
def test_empty_base(self):
|
|
7
|
+
g = BaseGeometry()
|
|
8
|
+
self.failUnless(g._is_empty, True)
|
|
9
|
+
def test_empty_point(self):
|
|
10
|
+
p = Point()
|
|
11
|
+
self.failUnless(p._is_empty, True)
|
|
12
|
+
def test_emptying_point(self):
|
|
13
|
+
p = Point(0, 0)
|
|
14
|
+
self.failIf(p._is_empty, False)
|
|
15
|
+
p.empty()
|
|
16
|
+
self.failUnless(p._is_empty, True)
|
|
17
|
+
|
|
18
|
+
def test_suite():
|
|
19
|
+
return unittest.TestLoader().loadTestsFromTestCase(EmptinessTestCase)
|
Shapely-1.2b7/CREDITS.txt
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
Sean Gillies (Pleiades)
|
|
2
|
-
Howard Butler (Hobu, Inc.)
|
|
3
|
-
Kai Lautaportti (Hexagon IT)
|
|
4
|
-
Frédéric Junod (Camptocamp SA)
|
|
5
|
-
Eric Lemoine (Camptocamp SA)
|
|
6
|
-
Justin Bronn (GeoDjango) for ctypes inspiration
|
|
7
|
-
|
|
8
|
-
Some of this work was supported by a grant from the U.S. National Endowment for
|
|
9
|
-
the Humanities (http://www.neh.gov).
|
Shapely-1.2b7/setup.cfg
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|