shapely 1.4.2__tar.gz → 1.4.4__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.4.2 → Shapely-1.4.4}/CHANGES.txt +8 -5
- {Shapely-1.4.2 → Shapely-1.4.4}/CREDITS.txt +1 -3
- {Shapely-1.4.2/Shapely.egg-info → Shapely-1.4.4}/PKG-INFO +68 -84
- Shapely-1.4.4/README.rst +164 -0
- {Shapely-1.4.2 → Shapely-1.4.4/Shapely.egg-info}/PKG-INFO +68 -84
- {Shapely-1.4.2 → Shapely-1.4.4}/Shapely.egg-info/SOURCES.txt +1 -1
- Shapely-1.4.4/VERSION.txt +1 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/setup.py +5 -4
- Shapely-1.4.4/shapely/__init__.py +1 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/shapely/coords.py +6 -5
- {Shapely-1.4.2 → Shapely-1.4.4}/shapely/geos.py +8 -2
- {Shapely-1.4.2 → Shapely-1.4.4}/shapely/speedups/_speedups.c +1011 -909
- Shapely-1.4.4/tests/test_coords.py +40 -0
- Shapely-1.4.4/tests/test_persist.py +67 -0
- Shapely-1.4.2/README.rst +0 -183
- Shapely-1.4.2/VERSION.txt +0 -1
- Shapely-1.4.2/shapely/__init__.py +0 -1
- Shapely-1.4.2/shapely/vectorized/_vectorized.c +0 -20100
- Shapely-1.4.2/tests/test_persist.py +0 -34
- {Shapely-1.4.2 → Shapely-1.4.4}/LICENSE.txt +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/Shapely.egg-info/dependency_links.txt +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/Shapely.egg-info/top_level.txt +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/docs/design.rst +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/docs/index.rst +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/docs/manual.rst +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/docs/project.rst +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/setup.cfg +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/shapely/_geos.pxi +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/shapely/affinity.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/shapely/algorithms/__init__.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/shapely/algorithms/cga.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/shapely/ctypes_declarations.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/shapely/examples/__init__.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/shapely/examples/dissolve.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/shapely/examples/geoms.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/shapely/examples/intersect.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/shapely/ftools.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/shapely/geometry/__init__.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/shapely/geometry/base.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/shapely/geometry/collection.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/shapely/geometry/geo.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/shapely/geometry/linestring.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/shapely/geometry/multilinestring.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/shapely/geometry/multipoint.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/shapely/geometry/multipolygon.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/shapely/geometry/point.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/shapely/geometry/polygon.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/shapely/geometry/proxy.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/shapely/impl.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/shapely/iterops.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/shapely/linref.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/shapely/ops.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/shapely/predicates.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/shapely/prepared.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/shapely/speedups/__init__.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/shapely/strtree.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/shapely/topology.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/shapely/validation.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/shapely/vectorized/__init__.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/shapely/vectorized/_vectorized.pyx +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/shapely/wkb.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/shapely/wkt.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/__init__.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/binascii_hex.txt +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/conftest.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/test_affinity.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/test_box.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/test_cga.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/test_collection.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/test_delaunay.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/test_delegated.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/test_dlls.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/test_doctests.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/test_emptiness.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/test_equality.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/test_geointerface.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/test_geomseq.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/test_getitem.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/test_invalid_geometries.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/test_iterops.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/test_linear_referencing.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/test_linemerge.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/test_linestring.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/test_locale.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/test_mapping.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/test_multilinestring.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/test_multipoint.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/test_multipolygon.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/test_ndarrays.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/test_nearest.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/test_operations.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/test_operators.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/test_pickle.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/test_point.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/test_polygon.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/test_polygonize.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/test_predicates.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/test_prepared.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/test_products_z.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/test_singularity.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/test_strtree.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/test_styles.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/test_transform.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/test_union.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/test_validation.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/test_vectorized.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/test_xy.py +0 -0
- {Shapely-1.4.2 → Shapely-1.4.4}/tests/threading_test.py +0 -0
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
Changes
|
|
2
2
|
=======
|
|
3
3
|
|
|
4
|
+
1.4.4 (2014-11-02)
|
|
5
|
+
------------------
|
|
6
|
+
- Proper conversion of numpy float32 vals to coords (#186).
|
|
7
|
+
|
|
8
|
+
1.4.3 (2014-10-01)
|
|
9
|
+
------------------
|
|
10
|
+
- Fix for endianness bug in WKB writer (#174).
|
|
11
|
+
|
|
4
12
|
1.4.2 (2014-09-29)
|
|
5
13
|
------------------
|
|
6
14
|
- Fix bungled 1.4.1 release (#176).
|
|
@@ -25,11 +33,6 @@ Changes
|
|
|
25
33
|
- Allow single-part geometries as argument to ops.cacaded_union() (#135).
|
|
26
34
|
- Support affine transformations of LinearRings (#112).
|
|
27
35
|
|
|
28
|
-
1.3.3 (2014-07-23)
|
|
29
|
-
------------------
|
|
30
|
-
- Allow single-part geometries as argument to ops.cacaded_union() (#135).
|
|
31
|
-
- Support affine transformations of LinearRings (#112).
|
|
32
|
-
|
|
33
36
|
1.3.2 (2014-05-13)
|
|
34
37
|
------------------
|
|
35
38
|
- Let LineString() take a sequence of Points (#130).
|
|
@@ -19,7 +19,7 @@ Patches contributed by:
|
|
|
19
19
|
* Bertrand Gervais (https://github.com/BertrandGervais)
|
|
20
20
|
* Marc Jansen (https://github.com/marcjansen)
|
|
21
21
|
* Kelsey Jordahl (https://github.com/kjordahl)
|
|
22
|
-
*
|
|
22
|
+
* Frédéric Junod
|
|
23
23
|
* Thomas Kluyver (https://github.com/takluyver)
|
|
24
24
|
* William Kyngesburye (https://github.com/kyngchaos)
|
|
25
25
|
* Eric Lemoine
|
|
@@ -49,6 +49,4 @@ Additional help from:
|
|
|
49
49
|
Major portions of this work were supported by a grant (for Pleiades_) from the
|
|
50
50
|
U.S. National Endowment for the Humanities (http://www.neh.gov).
|
|
51
51
|
|
|
52
|
-
.. |eaigue| unicode:: U+00E9
|
|
53
|
-
:trim:
|
|
54
52
|
.. _Pleiades: http://pleiades.stoa.org
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 1.1
|
|
2
2
|
Name: Shapely
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.4
|
|
4
4
|
Summary: Geometric objects, predicates, and operations
|
|
5
5
|
Home-page: https://github.com/Toblerity/Shapely
|
|
6
6
|
Author: Sean Gillies
|
|
@@ -20,13 +20,15 @@ Description: =======
|
|
|
20
20
|
:height: 400
|
|
21
21
|
|
|
22
22
|
Shapely is a BSD-licensed Python package for manipulation and analysis of
|
|
23
|
-
planar geometric objects. It is based on the widely deployed
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
planar geometric objects. It is based on the widely deployed `GEOS
|
|
24
|
+
<http://trac.osgeo.org/geos/>`__ (the engine of `PostGIS
|
|
25
|
+
<http://postgis.org>`__) and `JTS
|
|
26
|
+
<http://www.vividsolutions.com/jts/jtshome.htm>`__ (from which GEOS is ported)
|
|
27
|
+
libraries. Shapely is not concerned with data formats or coordinate systems,
|
|
28
|
+
but can be readily integrated with packages that are. For more details, see:
|
|
27
29
|
|
|
28
|
-
* Shapely
|
|
29
|
-
* Shapely `
|
|
30
|
+
* Shapely on `GitHub <https://github.com/Toblerity/Shapely>`__
|
|
31
|
+
* The Shapely `manual <http://toblerity.github.com/shapely/manual.html>`__
|
|
30
32
|
|
|
31
33
|
Requirements
|
|
32
34
|
============
|
|
@@ -34,7 +36,7 @@ Description: =======
|
|
|
34
36
|
Shapely 1.4 requires
|
|
35
37
|
|
|
36
38
|
* Python >=2.6 (including Python 3.x)
|
|
37
|
-
* libgeos_c >=3.
|
|
39
|
+
* libgeos_c >=3.3 (Shapely 1.2 requires only libgeos_c 3.1 but YMMV)
|
|
38
40
|
|
|
39
41
|
Installation
|
|
40
42
|
============
|
|
@@ -45,16 +47,10 @@ Description: =======
|
|
|
45
47
|
|
|
46
48
|
.. code-block:: console
|
|
47
49
|
|
|
48
|
-
|
|
50
|
+
$ pip install shapely
|
|
49
51
|
|
|
50
|
-
Shapely is also provided by popular Python distributions like Enthought
|
|
51
|
-
and Continuum Analytics
|
|
52
|
-
|
|
53
|
-
.. warning:: Windows users:
|
|
54
|
-
do not under any circumstances use pip (or easy_install) to uninstall
|
|
55
|
-
Shapely versions < 1.2.17. Due to the way Shapely used to install its GEOS
|
|
56
|
-
DLL and a distribute or setuptools bug, your Python installation may be
|
|
57
|
-
broken by an uninstall command. Shapely 1.2.17 will uninstall safely.
|
|
52
|
+
Shapely is also provided by popular Python distributions like Canopy (Enthought)
|
|
53
|
+
and Anaconda (Continuum Analytics).
|
|
58
54
|
|
|
59
55
|
Usage
|
|
60
56
|
=====
|
|
@@ -64,15 +60,15 @@ Description: =======
|
|
|
64
60
|
|
|
65
61
|
.. code-block:: pycon
|
|
66
62
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
63
|
+
>>> from shapely.geometry import Point
|
|
64
|
+
>>> patch = Point(0.0, 0.0).buffer(10.0)
|
|
65
|
+
>>> patch
|
|
66
|
+
<shapely.geometry.polygon.Polygon object at 0x...>
|
|
67
|
+
>>> patch.area
|
|
68
|
+
313.65484905459385
|
|
73
69
|
|
|
74
|
-
See the
|
|
75
|
-
intersect.py
|
|
70
|
+
See the manual for comprehensive usage snippets and the dissolve.py and
|
|
71
|
+
intersect.py examples.
|
|
76
72
|
|
|
77
73
|
Integration
|
|
78
74
|
===========
|
|
@@ -83,60 +79,60 @@ Description: =======
|
|
|
83
79
|
|
|
84
80
|
.. code-block:: pycon
|
|
85
81
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
82
|
+
>>> from shapely.wkt import dumps, loads
|
|
83
|
+
>>> dumps(loads('POINT (0 0)'))
|
|
84
|
+
'POINT (0.0000000000000000 0.0000000000000000)'
|
|
89
85
|
|
|
90
86
|
All linear objects, such as the rings of a polygon (like ``patch`` above),
|
|
91
87
|
provide the Numpy array interface.
|
|
92
88
|
|
|
93
89
|
.. code-block:: pycon
|
|
94
90
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
91
|
+
>>> import numpy as np
|
|
92
|
+
>>> np.array(patch.exterior)
|
|
93
|
+
array([[ 1.00000000e+01, 0.00000000e+00],
|
|
94
|
+
[ 9.95184727e+00, -9.80171403e-01],
|
|
95
|
+
[ 9.80785280e+00, -1.95090322e+00],
|
|
96
|
+
...
|
|
97
|
+
[ 1.00000000e+01, 0.00000000e+00]])
|
|
102
98
|
|
|
103
|
-
That yields a Numpy array of
|
|
99
|
+
That yields a Numpy array of ``[x, y]`` arrays. This is not always exactly what one
|
|
104
100
|
wants for plotting shapes with Matplotlib (for example), so Shapely adds
|
|
105
|
-
a
|
|
101
|
+
a ``xy`` property for obtaining separate arrays of coordinate x and y values.
|
|
106
102
|
|
|
107
103
|
.. code-block:: pycon
|
|
108
104
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
105
|
+
>>> x, y = patch.exterior.xy
|
|
106
|
+
>>> np.array(x)
|
|
107
|
+
array([ 1.00000000e+01, 9.95184727e+00, 9.80785280e+00, ...])
|
|
112
108
|
|
|
113
|
-
Numpy arrays of
|
|
109
|
+
Numpy arrays of ``[x, y]`` arrays can also be adapted to Shapely linestrings.
|
|
114
110
|
|
|
115
111
|
.. code-block:: pycon
|
|
116
112
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
113
|
+
>>> from shapely.geometry import LineString
|
|
114
|
+
>>> LineString(np.array(patch.exterior)).length
|
|
115
|
+
62.806623139095073
|
|
120
116
|
|
|
121
117
|
Numpy arrays of x and y must be transposed.
|
|
122
118
|
|
|
123
|
-
.. code-block::
|
|
119
|
+
.. code-block:: pycon
|
|
124
120
|
|
|
125
|
-
|
|
126
|
-
|
|
121
|
+
>>> LineString(np.transpose(np.array(patch.exterior.xy))).length
|
|
122
|
+
62.80662313909507
|
|
127
123
|
|
|
128
124
|
Shapely can also integrate with other Python GIS packages using data modeled
|
|
129
125
|
after GeoJSON.
|
|
130
126
|
|
|
131
|
-
..
|
|
127
|
+
.. code-block:: pycon
|
|
132
128
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
129
|
+
>>> import json
|
|
130
|
+
>>> from shapely.geometry import mapping, shape
|
|
131
|
+
>>> s = shape(json.loads('{"type": "Point", "coordinates": [0.0, 0.0]}'))
|
|
132
|
+
>>> s
|
|
133
|
+
<shapely.geometry.point.Point object at 0x...>
|
|
134
|
+
>>> print(json.dumps(mapping(s)))
|
|
135
|
+
{"type": "Point", "coordinates": [0.0, 0.0]}
|
|
140
136
|
|
|
141
137
|
Development and Testing
|
|
142
138
|
=======================
|
|
@@ -147,16 +143,16 @@ Description: =======
|
|
|
147
143
|
|
|
148
144
|
.. code-block:: console
|
|
149
145
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
146
|
+
$ virtualenv .
|
|
147
|
+
$ source bin/activate
|
|
148
|
+
(env)$ pip install -r requirements-dev.txt
|
|
149
|
+
(env)$ pip install -e .
|
|
154
150
|
|
|
155
151
|
We use py.test to run Shapely's suite of unittests and doctests.
|
|
156
152
|
|
|
157
153
|
.. code-block:: console
|
|
158
154
|
|
|
159
|
-
|
|
155
|
+
(env)$ py.test tests
|
|
160
156
|
|
|
161
157
|
Roadmap and Maintenance
|
|
162
158
|
=======================
|
|
@@ -165,12 +161,7 @@ Description: =======
|
|
|
165
161
|
not Python 3+. There will be no new features in Shapely 1.2.x and only fixes
|
|
166
162
|
for major bugs.
|
|
167
163
|
|
|
168
|
-
Shapely 1.
|
|
169
|
-
|
|
170
|
-
"Shapely 3000" is the name of the next milestone. New features will include
|
|
171
|
-
vectorized operations, better integration with IPython Notebook, support for
|
|
172
|
-
fixed precision models, and more. Less ctypes and more Cython is another theme
|
|
173
|
-
in this branch. A 1.4 release should come out of this by Summer, 2014.
|
|
164
|
+
Shapely 1.4.x is a maintenance-only branch supporting Pythons 2.7 and 3.3+.
|
|
174
165
|
|
|
175
166
|
Support
|
|
176
167
|
=======
|
|
@@ -178,16 +169,7 @@ Description: =======
|
|
|
178
169
|
Please discuss Shapely with us at
|
|
179
170
|
http://lists.gispython.org/mailman/listinfo/community.
|
|
180
171
|
|
|
181
|
-
Bugs may be reported at https://github.com/Toblerity/Shapely.
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
.. _JTS: http://www.vividsolutions.com/jts/jtshome.htm
|
|
186
|
-
.. _PostGIS: http://postgis.org
|
|
187
|
-
.. _GEOS: http://trac.osgeo.org/geos/
|
|
188
|
-
.. _example apps: https://github.com/Toblerity/shapely/tree/master/shapely/examples
|
|
189
|
-
.. _manual: http://toblerity.github.com/shapely/manual.html
|
|
190
|
-
.. _Pleiades: http://pleiades.stoa.org
|
|
172
|
+
Bugs may be reported at https://github.com/Toblerity/Shapely/issues.
|
|
191
173
|
|
|
192
174
|
|
|
193
175
|
Credits
|
|
@@ -211,7 +193,7 @@ Description: =======
|
|
|
211
193
|
* Bertrand Gervais (https://github.com/BertrandGervais)
|
|
212
194
|
* Marc Jansen (https://github.com/marcjansen)
|
|
213
195
|
* Kelsey Jordahl (https://github.com/kjordahl)
|
|
214
|
-
*
|
|
196
|
+
* Frédéric Junod
|
|
215
197
|
* Thomas Kluyver (https://github.com/takluyver)
|
|
216
198
|
* William Kyngesburye (https://github.com/kyngchaos)
|
|
217
199
|
* Eric Lemoine
|
|
@@ -241,13 +223,20 @@ Description: =======
|
|
|
241
223
|
Major portions of this work were supported by a grant (for Pleiades_) from the
|
|
242
224
|
U.S. National Endowment for the Humanities (http://www.neh.gov).
|
|
243
225
|
|
|
244
|
-
.. |eaigue| unicode:: U+00E9
|
|
245
|
-
:trim:
|
|
246
226
|
.. _Pleiades: http://pleiades.stoa.org
|
|
247
227
|
|
|
228
|
+
|
|
248
229
|
Changes
|
|
249
230
|
=======
|
|
250
231
|
|
|
232
|
+
1.4.4 (2014-11-02)
|
|
233
|
+
------------------
|
|
234
|
+
- Proper conversion of numpy float32 vals to coords (#186).
|
|
235
|
+
|
|
236
|
+
1.4.3 (2014-10-01)
|
|
237
|
+
------------------
|
|
238
|
+
- Fix for endianness bug in WKB writer (#174).
|
|
239
|
+
|
|
251
240
|
1.4.2 (2014-09-29)
|
|
252
241
|
------------------
|
|
253
242
|
- Fix bungled 1.4.1 release (#176).
|
|
@@ -272,11 +261,6 @@ Description: =======
|
|
|
272
261
|
- Allow single-part geometries as argument to ops.cacaded_union() (#135).
|
|
273
262
|
- Support affine transformations of LinearRings (#112).
|
|
274
263
|
|
|
275
|
-
1.3.3 (2014-07-23)
|
|
276
|
-
------------------
|
|
277
|
-
- Allow single-part geometries as argument to ops.cacaded_union() (#135).
|
|
278
|
-
- Support affine transformations of LinearRings (#112).
|
|
279
|
-
|
|
280
264
|
1.3.2 (2014-05-13)
|
|
281
265
|
------------------
|
|
282
266
|
- Let LineString() take a sequence of Points (#130).
|
Shapely-1.4.4/README.rst
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
=======
|
|
2
|
+
Shapely
|
|
3
|
+
=======
|
|
4
|
+
|
|
5
|
+
Manipulation and analysis of geometric objects in the Cartesian plane.
|
|
6
|
+
|
|
7
|
+
.. image:: https://travis-ci.org/Toblerity/Shapely.png?branch=master
|
|
8
|
+
:target: https://travis-ci.org/Toblerity/Shapely
|
|
9
|
+
|
|
10
|
+
.. image:: http://farm3.staticflickr.com/2738/4511827859_b5822043b7_o_d.png
|
|
11
|
+
:width: 800
|
|
12
|
+
:height: 400
|
|
13
|
+
|
|
14
|
+
Shapely is a BSD-licensed Python package for manipulation and analysis of
|
|
15
|
+
planar geometric objects. It is based on the widely deployed `GEOS
|
|
16
|
+
<http://trac.osgeo.org/geos/>`__ (the engine of `PostGIS
|
|
17
|
+
<http://postgis.org>`__) and `JTS
|
|
18
|
+
<http://www.vividsolutions.com/jts/jtshome.htm>`__ (from which GEOS is ported)
|
|
19
|
+
libraries. Shapely is not concerned with data formats or coordinate systems,
|
|
20
|
+
but can be readily integrated with packages that are. For more details, see:
|
|
21
|
+
|
|
22
|
+
* Shapely on `GitHub <https://github.com/Toblerity/Shapely>`__
|
|
23
|
+
* The Shapely `manual <http://toblerity.github.com/shapely/manual.html>`__
|
|
24
|
+
|
|
25
|
+
Requirements
|
|
26
|
+
============
|
|
27
|
+
|
|
28
|
+
Shapely 1.4 requires
|
|
29
|
+
|
|
30
|
+
* Python >=2.6 (including Python 3.x)
|
|
31
|
+
* libgeos_c >=3.3 (Shapely 1.2 requires only libgeos_c 3.1 but YMMV)
|
|
32
|
+
|
|
33
|
+
Installation
|
|
34
|
+
============
|
|
35
|
+
|
|
36
|
+
Windows users should use the executable installer, which contains the required
|
|
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.
|
|
39
|
+
|
|
40
|
+
.. code-block:: console
|
|
41
|
+
|
|
42
|
+
$ pip install shapely
|
|
43
|
+
|
|
44
|
+
Shapely is also provided by popular Python distributions like Canopy (Enthought)
|
|
45
|
+
and Anaconda (Continuum Analytics).
|
|
46
|
+
|
|
47
|
+
Usage
|
|
48
|
+
=====
|
|
49
|
+
|
|
50
|
+
Here is the canonical example of building an approximately circular patch by
|
|
51
|
+
buffering a point.
|
|
52
|
+
|
|
53
|
+
.. code-block:: pycon
|
|
54
|
+
|
|
55
|
+
>>> from shapely.geometry import Point
|
|
56
|
+
>>> patch = Point(0.0, 0.0).buffer(10.0)
|
|
57
|
+
>>> patch
|
|
58
|
+
<shapely.geometry.polygon.Polygon object at 0x...>
|
|
59
|
+
>>> patch.area
|
|
60
|
+
313.65484905459385
|
|
61
|
+
|
|
62
|
+
See the manual for comprehensive usage snippets and the dissolve.py and
|
|
63
|
+
intersect.py examples.
|
|
64
|
+
|
|
65
|
+
Integration
|
|
66
|
+
===========
|
|
67
|
+
|
|
68
|
+
Shapely does not read or write data files, but it can serialize and deserialize
|
|
69
|
+
using several well known formats and protocols. The shapely.wkb and shapely.wkt
|
|
70
|
+
modules provide dumpers and loaders inspired by Python's pickle module.
|
|
71
|
+
|
|
72
|
+
.. code-block:: pycon
|
|
73
|
+
|
|
74
|
+
>>> from shapely.wkt import dumps, loads
|
|
75
|
+
>>> dumps(loads('POINT (0 0)'))
|
|
76
|
+
'POINT (0.0000000000000000 0.0000000000000000)'
|
|
77
|
+
|
|
78
|
+
All linear objects, such as the rings of a polygon (like ``patch`` above),
|
|
79
|
+
provide the Numpy array interface.
|
|
80
|
+
|
|
81
|
+
.. code-block:: pycon
|
|
82
|
+
|
|
83
|
+
>>> import numpy as np
|
|
84
|
+
>>> np.array(patch.exterior)
|
|
85
|
+
array([[ 1.00000000e+01, 0.00000000e+00],
|
|
86
|
+
[ 9.95184727e+00, -9.80171403e-01],
|
|
87
|
+
[ 9.80785280e+00, -1.95090322e+00],
|
|
88
|
+
...
|
|
89
|
+
[ 1.00000000e+01, 0.00000000e+00]])
|
|
90
|
+
|
|
91
|
+
That yields a Numpy array of ``[x, y]`` arrays. This is not always exactly what one
|
|
92
|
+
wants for plotting shapes with Matplotlib (for example), so Shapely adds
|
|
93
|
+
a ``xy`` property for obtaining separate arrays of coordinate x and y values.
|
|
94
|
+
|
|
95
|
+
.. code-block:: pycon
|
|
96
|
+
|
|
97
|
+
>>> x, y = patch.exterior.xy
|
|
98
|
+
>>> np.array(x)
|
|
99
|
+
array([ 1.00000000e+01, 9.95184727e+00, 9.80785280e+00, ...])
|
|
100
|
+
|
|
101
|
+
Numpy arrays of ``[x, y]`` arrays can also be adapted to Shapely linestrings.
|
|
102
|
+
|
|
103
|
+
.. code-block:: pycon
|
|
104
|
+
|
|
105
|
+
>>> from shapely.geometry import LineString
|
|
106
|
+
>>> LineString(np.array(patch.exterior)).length
|
|
107
|
+
62.806623139095073
|
|
108
|
+
|
|
109
|
+
Numpy arrays of x and y must be transposed.
|
|
110
|
+
|
|
111
|
+
.. code-block:: pycon
|
|
112
|
+
|
|
113
|
+
>>> LineString(np.transpose(np.array(patch.exterior.xy))).length
|
|
114
|
+
62.80662313909507
|
|
115
|
+
|
|
116
|
+
Shapely can also integrate with other Python GIS packages using data modeled
|
|
117
|
+
after GeoJSON.
|
|
118
|
+
|
|
119
|
+
.. code-block:: pycon
|
|
120
|
+
|
|
121
|
+
>>> import json
|
|
122
|
+
>>> from shapely.geometry import mapping, shape
|
|
123
|
+
>>> s = shape(json.loads('{"type": "Point", "coordinates": [0.0, 0.0]}'))
|
|
124
|
+
>>> s
|
|
125
|
+
<shapely.geometry.point.Point object at 0x...>
|
|
126
|
+
>>> print(json.dumps(mapping(s)))
|
|
127
|
+
{"type": "Point", "coordinates": [0.0, 0.0]}
|
|
128
|
+
|
|
129
|
+
Development and Testing
|
|
130
|
+
=======================
|
|
131
|
+
|
|
132
|
+
Dependencies for developing Shapely are listed in requirements-dev.txt. Cython
|
|
133
|
+
and Numpy are not required for production installations, only for development.
|
|
134
|
+
Use of a virtual environment is strongly recommended.
|
|
135
|
+
|
|
136
|
+
.. code-block:: console
|
|
137
|
+
|
|
138
|
+
$ virtualenv .
|
|
139
|
+
$ source bin/activate
|
|
140
|
+
(env)$ pip install -r requirements-dev.txt
|
|
141
|
+
(env)$ pip install -e .
|
|
142
|
+
|
|
143
|
+
We use py.test to run Shapely's suite of unittests and doctests.
|
|
144
|
+
|
|
145
|
+
.. code-block:: console
|
|
146
|
+
|
|
147
|
+
(env)$ py.test tests
|
|
148
|
+
|
|
149
|
+
Roadmap and Maintenance
|
|
150
|
+
=======================
|
|
151
|
+
|
|
152
|
+
Shapely 1.2.x is a maintenance-only branch which supports Python 2.4-2.6, but
|
|
153
|
+
not Python 3+. There will be no new features in Shapely 1.2.x and only fixes
|
|
154
|
+
for major bugs.
|
|
155
|
+
|
|
156
|
+
Shapely 1.4.x is a maintenance-only branch supporting Pythons 2.7 and 3.3+.
|
|
157
|
+
|
|
158
|
+
Support
|
|
159
|
+
=======
|
|
160
|
+
|
|
161
|
+
Please discuss Shapely with us at
|
|
162
|
+
http://lists.gispython.org/mailman/listinfo/community.
|
|
163
|
+
|
|
164
|
+
Bugs may be reported at https://github.com/Toblerity/Shapely/issues.
|