shapely 1.2.15__tar.gz → 1.2.16__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.
Files changed (93) hide show
  1. {Shapely-1.2.15 → Shapely-1.2.16}/CHANGES.txt +15 -3
  2. {Shapely-1.2.15 → Shapely-1.2.16}/CREDITS.txt +5 -0
  3. {Shapely-1.2.15/Shapely.egg-info → Shapely-1.2.16}/PKG-INFO +34 -15
  4. {Shapely-1.2.15 → Shapely-1.2.16}/README.rst +2 -29
  5. {Shapely-1.2.15 → Shapely-1.2.16/Shapely.egg-info}/PKG-INFO +34 -15
  6. {Shapely-1.2.15 → Shapely-1.2.16}/Shapely.egg-info/SOURCES.txt +1 -0
  7. Shapely-1.2.16/VERSION.txt +1 -0
  8. {Shapely-1.2.15 → Shapely-1.2.16}/docs/manual.txt +70 -4
  9. {Shapely-1.2.15 → Shapely-1.2.16}/setup.py +44 -33
  10. Shapely-1.2.16/shapely/__init__.py +1 -0
  11. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/ctypes_declarations.py +4 -0
  12. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/geometry/base.py +29 -29
  13. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/geometry/polygon.py +7 -1
  14. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/geos.py +32 -14
  15. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/ops.py +17 -2
  16. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/speedups/_speedups.c +1 -1
  17. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/tests/__init__.py +2 -1
  18. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/tests/cascaded_union.txt +1 -0
  19. Shapely-1.2.16/shapely/tests/test_collection.py +26 -0
  20. Shapely-1.2.16/shapely/tests/test_unary_union.py +40 -0
  21. Shapely-1.2.15/VERSION.txt +0 -1
  22. Shapely-1.2.15/shapely/__init__.py +0 -1
  23. Shapely-1.2.15/shapely/tests/test_collection.py +0 -11
  24. {Shapely-1.2.15 → Shapely-1.2.16}/LICENSE.txt +0 -0
  25. {Shapely-1.2.15 → Shapely-1.2.16}/Shapely.egg-info/dependency_links.txt +0 -0
  26. {Shapely-1.2.15 → Shapely-1.2.16}/Shapely.egg-info/top_level.txt +0 -0
  27. {Shapely-1.2.15 → Shapely-1.2.16}/setup.cfg +0 -0
  28. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/algorithms/__init__.py +0 -0
  29. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/algorithms/cga.py +0 -0
  30. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/coords.py +0 -0
  31. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/examples/__init__.py +0 -0
  32. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/examples/dissolve.py +0 -0
  33. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/examples/geoms.py +0 -0
  34. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/examples/intersect.py +0 -0
  35. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/examples/world.py +0 -0
  36. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/ftools.py +0 -0
  37. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/geometry/__init__.py +0 -0
  38. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/geometry/collection.py +0 -0
  39. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/geometry/geo.py +0 -0
  40. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/geometry/linestring.py +0 -0
  41. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/geometry/multilinestring.py +0 -0
  42. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/geometry/multipoint.py +0 -0
  43. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/geometry/multipolygon.py +0 -0
  44. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/geometry/point.py +0 -0
  45. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/geometry/proxy.py +0 -0
  46. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/impl.py +0 -0
  47. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/iterops.py +0 -0
  48. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/linref.py +0 -0
  49. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/predicates.py +0 -0
  50. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/prepared.py +0 -0
  51. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/speedups/__init__.py +0 -0
  52. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/tests/Array.txt +0 -0
  53. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/tests/GeoInterface.txt +0 -0
  54. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/tests/IterOps.txt +0 -0
  55. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/tests/LineString.txt +0 -0
  56. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/tests/MultiLineString.txt +0 -0
  57. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/tests/MultiPoint.txt +0 -0
  58. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/tests/MultiPolygon.txt +0 -0
  59. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/tests/Operations.txt +0 -0
  60. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/tests/Persist.txt +0 -0
  61. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/tests/Point.txt +0 -0
  62. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/tests/Polygon.txt +0 -0
  63. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/tests/Predicates.txt +0 -0
  64. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/tests/attribute-chains.txt +0 -0
  65. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/tests/binascii_hex.txt +0 -0
  66. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/tests/dimensions.txt +0 -0
  67. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/tests/invalid_intersection.txt +0 -0
  68. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/tests/linemerge.txt +0 -0
  69. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/tests/polygonize.txt +0 -0
  70. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/tests/test_box.py +0 -0
  71. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/tests/test_cga.py +0 -0
  72. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/tests/test_delegated.py +0 -0
  73. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/tests/test_dlls.py +0 -0
  74. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/tests/test_doctests.py +0 -0
  75. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/tests/test_emptiness.py +0 -0
  76. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/tests/test_equality.py +0 -0
  77. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/tests/test_geomseq.py +0 -0
  78. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/tests/test_getitem.py +0 -0
  79. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/tests/test_linear_referencing.py +0 -0
  80. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/tests/test_mapping.py +0 -0
  81. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/tests/test_ndarrays.py +0 -0
  82. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/tests/test_prepared.py +0 -0
  83. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/tests/test_products_z.py +0 -0
  84. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/tests/test_singularity.py +0 -0
  85. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/tests/test_speedups.py +0 -0
  86. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/tests/test_validation.py +0 -0
  87. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/tests/test_xy.py +0 -0
  88. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/tests/threading_test.py +0 -0
  89. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/tests/wkt_locale.txt +0 -0
  90. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/topology.py +0 -0
  91. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/validation.py +0 -0
  92. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/wkb.py +0 -0
  93. {Shapely-1.2.15 → Shapely-1.2.16}/shapely/wkt.py +0 -0
@@ -1,9 +1,21 @@
1
- =======
2
1
  Changes
3
2
  =======
4
3
 
5
- 1.2.15 (2012-)
6
- --------------
4
+ 1.2.16 (2012-09-18)
5
+ -------------------
6
+ - Add ops.unary_union function.
7
+ - Alias ops.cascaded_union to ops.unary_union when GEOS CAPI >= (1,7,0).
8
+ - Add geos_version_string attribute to shapely.geos.
9
+ - Ensure parent is set when child geometry is accessed.
10
+ - Generate _speedups.c using Cython when building from repo when missing,
11
+ stale, or the build target is "sdist".
12
+ - The is_simple predicate of invalid, self-intersecting linear rings now
13
+ returns ``False``.
14
+ - Remove VERSION.txt from repo, it's now written by the distutils setup script
15
+ with value of shapely.__version__.
16
+
17
+ 1.2.15 (2012-06-27)
18
+ -------------------
7
19
  - Eliminate numerical sensitivity in a method chaining test (Debian bug
8
20
  #663210).
9
21
  - Account for cascaded union of random buffered test points being a polygon
@@ -1,3 +1,6 @@
1
+ Credits
2
+ =======
3
+
1
4
  Shapely is written by:
2
5
 
3
6
  * Sean Gillies
@@ -24,4 +27,6 @@ Additional help from:
24
27
  Major portions of this work were supported by a grant (for Pleiades_) from the
25
28
  U.S. National Endowment for the Humanities (http://www.neh.gov).
26
29
 
30
+ .. |eaigue| unicode:: U+00E9
31
+ :trim:
27
32
  .. _Pleiades: http://pleiades.stoa.org
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 1.0
2
2
  Name: Shapely
3
- Version: 1.2.15
3
+ Version: 1.2.16
4
4
  Summary: Geometric objects, predicates, and operations
5
- Home-page: https://github.com/sgillies/shapely
5
+ Home-page: https://github.com/Toblerity/Shapely
6
6
  Author: Sean Gillies
7
7
  Author-email: sean.gillies@gmail.com
8
8
  License: BSD
@@ -13,7 +13,7 @@ Description: ======
13
13
  PostGIS-ish operations outside a database context for Pythoneers and
14
14
  Pythonistas.
15
15
 
16
- .. image:: http://farm3.static.flickr.com/2738/4511827859_b5822043b7_o_d.png
16
+ .. image:: images/4511827859_b5822043b7_o.png
17
17
  :width: 800
18
18
  :height: 400
19
19
 
@@ -121,6 +121,17 @@ Description: ======
121
121
 
122
122
  Bugs may be reported and questions asked via https://github.com/Toblerity/Shapely.
123
123
 
124
+
125
+
126
+ .. _JTS: http://www.vividsolutions.com/jts/jtshome.htm
127
+ .. _PostGIS: http://postgis.org
128
+ .. _GEOS: http://trac.osgeo.org/geos/
129
+ .. _example apps: http://trac.gispython.org/lab/wiki/Examples
130
+ .. _wiki: http://trac.gispython.org/lab/wiki/Shapely
131
+ .. _manual: http://toblerity.github.com/shapely/manual.html
132
+ .. _Pleiades: http://pleiades.stoa.org
133
+
134
+
124
135
  Credits
125
136
  =======
126
137
 
@@ -134,8 +145,8 @@ Description: ======
134
145
  Patches contributed by:
135
146
 
136
147
  * Howard Butler
137
- * Frédéric Junod
138
- * Éric Lemoine
148
+ * Fr |eaigue| d |eaigue| ric Junod
149
+ * Eric Lemoine
139
150
  * Jonathan Tartley
140
151
  * Kristian Thy
141
152
  * Mike Toews (https://github.com/mwtoews)
@@ -145,25 +156,33 @@ Description: ======
145
156
  * Justin Bronn (GeoDjango) for ctypes inspiration
146
157
  * Martin Davis (JTS)
147
158
  * Jaakko Salli for the Windows distributions
148
- * Sandro Santilli, Mateusz Loskot, Paul Ramsey, et al (GEOS_ Project)
159
+ * Sandro Santilli, Mateusz Loskot, Paul Ramsey, et al (GEOS Project)
149
160
 
150
161
  Major portions of this work were supported by a grant (for Pleiades_) from the
151
162
  U.S. National Endowment for the Humanities (http://www.neh.gov).
152
163
 
153
- .. _JTS: http://www.vividsolutions.com/jts/jtshome.htm
154
- .. _PostGIS: http://postgis.org
155
- .. _GEOS: http://trac.osgeo.org/geos/
156
- .. _example apps: http://trac.gispython.org/lab/wiki/Examples
157
- .. _wiki: http://trac.gispython.org/lab/wiki/Shapely
158
- .. _manual: http://toblerity.github.com/shapely/manual.html
164
+ .. |eaigue| unicode:: U+00E9
165
+ :trim:
159
166
  .. _Pleiades: http://pleiades.stoa.org
160
167
 
161
-
162
168
  Changes
163
169
  =======
164
170
 
165
- 1.2.15 (2012-)
166
- --------------
171
+ 1.2.16 (2012-09-18)
172
+ -------------------
173
+ - Add ops.unary_union function.
174
+ - Alias ops.cascaded_union to ops.unary_union when GEOS CAPI >= (1,7,0).
175
+ - Add geos_version_string attribute to shapely.geos.
176
+ - Ensure parent is set when child geometry is accessed.
177
+ - Generate _speedups.c using Cython when building from repo when missing,
178
+ stale, or the build target is "sdist".
179
+ - The is_simple predicate of invalid, self-intersecting linear rings now
180
+ returns ``False``.
181
+ - Remove VERSION.txt from repo, it's now written by the distutils setup script
182
+ with value of shapely.__version__.
183
+
184
+ 1.2.15 (2012-06-27)
185
+ -------------------
167
186
  - Eliminate numerical sensitivity in a method chaining test (Debian bug
168
187
  #663210).
169
188
  - Account for cascaded union of random buffered test points being a polygon
@@ -5,7 +5,7 @@ README
5
5
  PostGIS-ish operations outside a database context for Pythoneers and
6
6
  Pythonistas.
7
7
 
8
- .. image:: http://farm3.static.flickr.com/2738/4511827859_b5822043b7_o_d.png
8
+ .. image:: images/4511827859_b5822043b7_o.png
9
9
  :width: 800
10
10
  :height: 400
11
11
 
@@ -113,34 +113,7 @@ Support
113
113
 
114
114
  Bugs may be reported and questions asked via https://github.com/Toblerity/Shapely.
115
115
 
116
- Credits
117
- =======
118
-
119
- Shapely is written by:
120
-
121
- * Sean Gillies
122
- * Aron Bierbaum
123
- * Kai Lautaportti
124
- * Oliver Tonnhofer
125
-
126
- Patches contributed by:
127
-
128
- * Howard Butler
129
- * Frédéric Junod
130
- * Éric Lemoine
131
- * Jonathan Tartley
132
- * Kristian Thy
133
- * Mike Toews (https://github.com/mwtoews)
134
-
135
- Additional help from:
136
-
137
- * Justin Bronn (GeoDjango) for ctypes inspiration
138
- * Martin Davis (JTS)
139
- * Jaakko Salli for the Windows distributions
140
- * Sandro Santilli, Mateusz Loskot, Paul Ramsey, et al (GEOS_ Project)
141
-
142
- Major portions of this work were supported by a grant (for Pleiades_) from the
143
- U.S. National Endowment for the Humanities (http://www.neh.gov).
116
+ .. include:: CREDITS.txt
144
117
 
145
118
  .. _JTS: http://www.vividsolutions.com/jts/jtshome.htm
146
119
  .. _PostGIS: http://postgis.org
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 1.0
2
2
  Name: Shapely
3
- Version: 1.2.15
3
+ Version: 1.2.16
4
4
  Summary: Geometric objects, predicates, and operations
5
- Home-page: https://github.com/sgillies/shapely
5
+ Home-page: https://github.com/Toblerity/Shapely
6
6
  Author: Sean Gillies
7
7
  Author-email: sean.gillies@gmail.com
8
8
  License: BSD
@@ -13,7 +13,7 @@ Description: ======
13
13
  PostGIS-ish operations outside a database context for Pythoneers and
14
14
  Pythonistas.
15
15
 
16
- .. image:: http://farm3.static.flickr.com/2738/4511827859_b5822043b7_o_d.png
16
+ .. image:: images/4511827859_b5822043b7_o.png
17
17
  :width: 800
18
18
  :height: 400
19
19
 
@@ -121,6 +121,17 @@ Description: ======
121
121
 
122
122
  Bugs may be reported and questions asked via https://github.com/Toblerity/Shapely.
123
123
 
124
+
125
+
126
+ .. _JTS: http://www.vividsolutions.com/jts/jtshome.htm
127
+ .. _PostGIS: http://postgis.org
128
+ .. _GEOS: http://trac.osgeo.org/geos/
129
+ .. _example apps: http://trac.gispython.org/lab/wiki/Examples
130
+ .. _wiki: http://trac.gispython.org/lab/wiki/Shapely
131
+ .. _manual: http://toblerity.github.com/shapely/manual.html
132
+ .. _Pleiades: http://pleiades.stoa.org
133
+
134
+
124
135
  Credits
125
136
  =======
126
137
 
@@ -134,8 +145,8 @@ Description: ======
134
145
  Patches contributed by:
135
146
 
136
147
  * Howard Butler
137
- * Frédéric Junod
138
- * Éric Lemoine
148
+ * Fr |eaigue| d |eaigue| ric Junod
149
+ * Eric Lemoine
139
150
  * Jonathan Tartley
140
151
  * Kristian Thy
141
152
  * Mike Toews (https://github.com/mwtoews)
@@ -145,25 +156,33 @@ Description: ======
145
156
  * Justin Bronn (GeoDjango) for ctypes inspiration
146
157
  * Martin Davis (JTS)
147
158
  * Jaakko Salli for the Windows distributions
148
- * Sandro Santilli, Mateusz Loskot, Paul Ramsey, et al (GEOS_ Project)
159
+ * Sandro Santilli, Mateusz Loskot, Paul Ramsey, et al (GEOS Project)
149
160
 
150
161
  Major portions of this work were supported by a grant (for Pleiades_) from the
151
162
  U.S. National Endowment for the Humanities (http://www.neh.gov).
152
163
 
153
- .. _JTS: http://www.vividsolutions.com/jts/jtshome.htm
154
- .. _PostGIS: http://postgis.org
155
- .. _GEOS: http://trac.osgeo.org/geos/
156
- .. _example apps: http://trac.gispython.org/lab/wiki/Examples
157
- .. _wiki: http://trac.gispython.org/lab/wiki/Shapely
158
- .. _manual: http://toblerity.github.com/shapely/manual.html
164
+ .. |eaigue| unicode:: U+00E9
165
+ :trim:
159
166
  .. _Pleiades: http://pleiades.stoa.org
160
167
 
161
-
162
168
  Changes
163
169
  =======
164
170
 
165
- 1.2.15 (2012-)
166
- --------------
171
+ 1.2.16 (2012-09-18)
172
+ -------------------
173
+ - Add ops.unary_union function.
174
+ - Alias ops.cascaded_union to ops.unary_union when GEOS CAPI >= (1,7,0).
175
+ - Add geos_version_string attribute to shapely.geos.
176
+ - Ensure parent is set when child geometry is accessed.
177
+ - Generate _speedups.c using Cython when building from repo when missing,
178
+ stale, or the build target is "sdist".
179
+ - The is_simple predicate of invalid, self-intersecting linear rings now
180
+ returns ``False``.
181
+ - Remove VERSION.txt from repo, it's now written by the distutils setup script
182
+ with value of shapely.__version__.
183
+
184
+ 1.2.15 (2012-06-27)
185
+ -------------------
167
186
  - Eliminate numerical sensitivity in a method chaining test (Debian bug
168
187
  #663210).
169
188
  - Account for cascaded union of random buffered test points being a polygon
@@ -82,6 +82,7 @@ shapely/tests/test_prepared.py
82
82
  shapely/tests/test_products_z.py
83
83
  shapely/tests/test_singularity.py
84
84
  shapely/tests/test_speedups.py
85
+ shapely/tests/test_unary_union.py
85
86
  shapely/tests/test_validation.py
86
87
  shapely/tests/test_xy.py
87
88
  shapely/tests/threading_test.py
@@ -0,0 +1 @@
1
+ 1.2.16
@@ -5,8 +5,8 @@ The Shapely User Manual
5
5
  =======================
6
6
 
7
7
  :Author: Sean Gillies, <sean.gillies@gmail.com>
8
- :Revision: 1.2.14
9
- :Date: 21 January 2012
8
+ :Revision: 1.2.16
9
+ :Date: 18 September 2012
10
10
  :Copyright:
11
11
  This work is licensed under a `Creative Commons Attribution 3.0
12
12
  United States License`__.
@@ -943,7 +943,11 @@ meaningless for others.
943
943
  .. attribute:: object.is_simple
944
944
 
945
945
  Returns ``True`` if the feature does not cross itself.
946
-
946
+
947
+ .. note::
948
+
949
+ The simplicity test is meaningful only for `LineStrings` and `LinearRings`.
950
+
947
951
  .. sourcecode:: pycon
948
952
 
949
953
  >>> LineString([(0, 0), (1, 1), (1, -1), (0, 1)]).is_simple
@@ -1482,6 +1486,40 @@ Figure 1. Convex hull (blue) of 2 points (left) and of 6 points (right).
1482
1486
  >>> MultiPoint([(0, 0), (1, 1)]).envelope
1483
1487
  <shapely.geometry.polygon.Polygon object at 0x...>
1484
1488
 
1489
+ .. method:: object.parallel_offset(distance, side, resolution=16, join_style=1, mitre_limit=1.0)
1490
+
1491
+ Returns a LineString or MultiLineString geometry at a distance from the
1492
+ object on its right or its left side.
1493
+
1494
+ Distance must be a positive float value. The side parameter may be 'left' or
1495
+ 'right'. The resolution of the offset around each vertex of the object is
1496
+ parameterized as in the buffer method.
1497
+
1498
+ The styles of joins between offset segments are: 1 (round, the default),
1499
+ 2 (mitre or miter), and 3 (bevel).
1500
+
1501
+ Severely mitered corners can be controlled by the mitre_limit parameter
1502
+ (spelled in British English, en-gb). The ratio of the distance from the
1503
+ corner to the end of the mitred offset corner is the miter ratio. Corners
1504
+ with a ratio which exceed the limit will be beveled.
1505
+
1506
+ .. note::
1507
+
1508
+ This method is only available for `LinearRing`, `LineString`, and
1509
+ `MultiLineString` objects.
1510
+
1511
+ .. plot:: code/parallel_offset.py
1512
+
1513
+ Figure 1. Three styles of parallel offset lines on the left side of a simple
1514
+ line string (its starting point shown as a circle) and one offset on the right
1515
+ side, a multipart.
1516
+
1517
+ The effect of the `mitre_limit` parameter is shown below.
1518
+
1519
+ .. plot:: code/parallel_offset_mitre.py
1520
+
1521
+ Figure 1. Large and small mitre_limit values for left and right offsets.
1522
+
1485
1523
  .. method:: object.simplify(tolerance, preserve_topology=True)
1486
1524
 
1487
1525
  Returns a simplified representation of the geometric object.
@@ -1591,6 +1629,17 @@ The function is particularly useful in dissolving `MultiPolygons`.
1591
1629
  >>> cascaded_union(m).area
1592
1630
  6.6103013551167971
1593
1631
 
1632
+ .. note::
1633
+
1634
+ In 1.2.16 :func:`shapely.ops.cascaded_union` is superceded by
1635
+ :func:`shapely.ops.unary_union` if GEOS 3.2+ is used. The unary union
1636
+ function can operate on different geometry types, not only polygons as is
1637
+ the case for the older cascaded unions.
1638
+
1639
+ .. function:: shapely.ops.unary_union(geoms)
1640
+
1641
+ Returns a representation of the union of the given geometric objects.
1642
+
1594
1643
  Prepared Geometry Operations
1595
1644
  ----------------------------
1596
1645
 
@@ -1632,7 +1681,7 @@ Diagnostics
1632
1681
  The messages may or may not have a representation of a problem point that can
1633
1682
  be parsed out.
1634
1683
 
1635
- .. sourcecode:: python
1684
+ .. sourcecode:: pycon
1636
1685
 
1637
1686
  >>> coords = [(0, 0), (0, 2), (1, 1), (2, 2), (2, 0), (1, 1), (0, 0)]
1638
1687
  >>> p = Polygon(coords)
@@ -1640,6 +1689,23 @@ be parsed out.
1640
1689
  >>> explain_validity(p)
1641
1690
  'Ring Self-intersection[1 1]'
1642
1691
 
1692
+ The Shapely version, GEOS library version, and GEOS C API version are
1693
+ accessible via :attr:`shapely.__version__`,
1694
+ :attr:`shapely.geos.geos_version_string`, and
1695
+ :attr:`shapely.geos.geos_capi_version`.
1696
+
1697
+ .. sourcecode:: pycon
1698
+
1699
+ >>> import shapely
1700
+ >>> shapely.__version__
1701
+ '1.2.16'
1702
+ >>> import shapely.geos
1703
+ >>> shapely.geos.geos_version_string
1704
+ '3.3.0-CAPI-1.7.0'
1705
+ >>> shapely.geos.geos_capi_version
1706
+ (1, 7, 0)
1707
+
1708
+
1643
1709
  Interoperation
1644
1710
  ==============
1645
1711
 
@@ -5,7 +5,7 @@ try:
5
5
  use_setuptools()
6
6
  except:
7
7
  warnings.warn(
8
- "Failed to import distribute_setup, continuing without distribute.",
8
+ "Failed to import distribute_setup, continuing without distribute.",
9
9
  Warning)
10
10
 
11
11
  from distutils.errors import CCompilerError, DistutilsExecError, \
@@ -15,6 +15,7 @@ import os
15
15
  import platform
16
16
  from setuptools.extension import Extension
17
17
  from setuptools import setup, find_packages
18
+ from setuptools.command.build_ext import build_ext as distutils_build_ext
18
19
  import subprocess
19
20
  import sys
20
21
 
@@ -29,10 +30,12 @@ for line in open('shapely/__init__.py', 'rb'):
29
30
  open('VERSION.txt', 'wb').write(version)
30
31
 
31
32
  readme_text = open('README.rst', 'rb').read()
33
+ readme_text = readme_text.replace(".. include:: CREDITS.txt", "")
34
+
35
+ f = open('CREDITS.txt', 'rb')
36
+ credits = f.read()
32
37
 
33
- # Skip the first line of the changes file to get the right header level
34
38
  f = open('CHANGES.txt', 'rb')
35
- f.readline()
36
39
  changes_text = f.read()
37
40
 
38
41
  setup_args = dict(
@@ -40,7 +43,7 @@ setup_args = dict(
40
43
  name = 'Shapely',
41
44
  version = version,
42
45
  requires_python = '>=2.5,<3',
43
- requires_external = 'libgeos_c (>=3.1)',
46
+ requires_external = 'libgeos_c (>=3.1)',
44
47
  description = 'Geometric objects, predicates, and operations',
45
48
  license = 'BSD',
46
49
  keywords = 'geometry topology gis',
@@ -48,8 +51,8 @@ setup_args = dict(
48
51
  author_email = 'sean.gillies@gmail.com',
49
52
  maintainer = 'Sean Gillies',
50
53
  maintainer_email = 'sean.gillies@gmail.com',
51
- url = 'https://github.com/sgillies/shapely',
52
- long_description = readme_text + "\n" + changes_text,
54
+ url = 'https://github.com/Toblerity/Shapely',
55
+ long_description = readme_text + "\n" + credits + "\n" + changes_text,
53
56
  packages = find_packages(),
54
57
  test_suite = 'shapely.tests.test_suite',
55
58
  classifiers = [
@@ -72,7 +75,7 @@ if sys.platform == 'win32':
72
75
  elif platform.python_version().startswith('2.5.'):
73
76
  setup_args.update(
74
77
  data_files=[('DLLs', glob.glob('DLLs_x86_VC7/*.dll'))]
75
- )
78
+ )
76
79
  else:
77
80
  setup_args.update(
78
81
  data_files=[('DLLs', glob.glob('DLLs_x86_VC9/*.dll'))]
@@ -92,29 +95,22 @@ else:
92
95
  class BuildFailed(Exception):
93
96
  pass
94
97
 
95
- try:
96
- # try to use Cython if present
97
- from Cython.Distutils import build_ext
98
- except ImportError:
99
- # else try to build from existing .c file
100
- from setuptools.command.build_ext import build_ext as distutils_build_ext
101
-
102
- class build_ext(distutils_build_ext):
103
- # This class allows C extension building to fail.
104
-
105
- def run(self):
106
- try:
107
- distutils_build_ext.run(self)
108
- except DistutilsPlatformError, x:
109
- raise BuildFailed(x)
110
-
111
- def build_extension(self, ext):
112
- try:
113
- distutils_build_ext.build_extension(self, ext)
114
- except ext_errors, x:
115
- raise BuildFailed(x)
116
-
117
- if (hasattr(platform, 'python_implementation')
98
+ class build_ext(distutils_build_ext):
99
+ # This class allows C extension building to fail.
100
+
101
+ def run(self):
102
+ try:
103
+ distutils_build_ext.run(self)
104
+ except DistutilsPlatformError, x:
105
+ raise BuildFailed(x)
106
+
107
+ def build_extension(self, ext):
108
+ try:
109
+ distutils_build_ext.build_extension(self, ext)
110
+ except ext_errors, x:
111
+ raise BuildFailed(x)
112
+
113
+ if (hasattr(platform, 'python_implementation')
118
114
  and platform.python_implementation() == 'PyPy'):
119
115
  # python_implementation is only available since 2.6
120
116
  ext_modules = []
@@ -125,16 +121,31 @@ else:
125
121
  libraries = ['geos_c']
126
122
 
127
123
  if os.path.exists("MANIFEST.in"):
128
- subprocess.check_call(["cython", "shapely/speedups/_speedups.pyx"])
124
+ pyx_file = "shapely/speedups/_speedups.pyx"
125
+ c_file = "shapely/speedups/_speedups.c"
126
+
127
+ force_cython = False
128
+ if 'sdist' in sys.argv:
129
+ force_cython = True
130
+
131
+ try:
132
+ if (force_cython or not os.path.exists(c_file)
133
+ or os.path.getmtime(pyx_file) > os.path.getmtime(c_file)):
134
+ print >>sys.stderr, "Updating C extension with Cython."
135
+ subprocess.check_call(["cython", "shapely/speedups/_speedups.pyx"])
136
+ except (subprocess.CalledProcessError, OSError):
137
+ print >>sys.stderr, "Warning: Could not (re)create C extension with Cython."
138
+ if force_cython:
139
+ raise
129
140
  if not os.path.exists("shapely/speedups/_speedups.c"):
130
- raise RuntimeError("Failed to generate C extension from PYX")
141
+ print >>sys.stderr, "Warning: speedup extension not found"
131
142
 
132
143
  ext_modules = [
133
144
  Extension(
134
145
  "shapely.speedups._speedups",
135
146
  ["shapely/speedups/_speedups.c"],
136
147
  libraries=libraries )]
137
-
148
+
138
149
  try:
139
150
  # try building with speedups
140
151
  setup(
@@ -0,0 +1 @@
1
+ __version__ = "1.2.16"
@@ -282,3 +282,7 @@ def prototype(lgeos, geosVersion):
282
282
  lgeos.GEOSInterpolateNormalized.argtypes = [ctypes.c_void_p,
283
283
  ctypes.c_double]
284
284
 
285
+ # TODO: Find out what version of geos_c came with geos 3.3.0
286
+ if geosVersion >= (1, 6, 3):
287
+ lgeos.GEOSUnaryUnion.restype = ctypes.c_void_p
288
+ lgeos.GEOSUnaryUnion.argtypes = [ctypes.c_void_p]