shapely 1.2.8__py2.6-win-amd64.egg → 1.2.9__py2.6-win-amd64.egg
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.
- EGG-INFO/PKG-INFO +197 -4
- shapely/coords.py +1 -2
- shapely/coords.pyc +0 -0
- shapely/geometry/__init__.py +2 -2
- shapely/geometry/__init__.pyc +0 -0
- shapely/geometry/geo.py +8 -1
- shapely/geometry/geo.pyc +0 -0
- shapely/geometry/proxy.py +0 -1
- shapely/geometry/proxy.pyc +0 -0
- shapely/geos.py +1 -2
- shapely/geos.pyc +0 -0
- shapely/iterops.py +1 -1
- shapely/iterops.pyc +0 -0
- shapely/predicates.py +0 -1
- shapely/predicates.pyc +0 -0
- shapely/wkb.py +1 -2
- shapely/wkb.pyc +0 -0
- EGG-INFO/scripts/dissolve.py +0 -53
- EGG-INFO/scripts/intersect.py +0 -81
EGG-INFO/PKG-INFO
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
Metadata-Version: 1.0
|
|
2
2
|
Name: Shapely
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.9
|
|
4
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:
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
Description: ======
|
|
10
|
+
README
|
|
11
|
+
======
|
|
12
12
|
|
|
13
13
|
.. image:: http://farm3.static.flickr.com/2738/4511827859_b5822043b7_o_d.png
|
|
14
14
|
:width: 800
|
|
@@ -162,6 +162,199 @@ Description: =======
|
|
|
162
162
|
:trim:
|
|
163
163
|
.. _Pleiades: http://pleiades.stoa.org
|
|
164
164
|
|
|
165
|
+
=======
|
|
166
|
+
CHANGES
|
|
167
|
+
=======
|
|
168
|
+
|
|
169
|
+
1.2.9 (2011-03-31)
|
|
170
|
+
------------------
|
|
171
|
+
- Remove extra glob import.
|
|
172
|
+
- Move examples to shapely.examples.
|
|
173
|
+
- Add box() constructor for rectangular polygons.
|
|
174
|
+
- Fix extraneous imports.
|
|
175
|
+
|
|
176
|
+
1.2.8 (2011-12-03)
|
|
177
|
+
------------------
|
|
178
|
+
- New parallel_offset method (#6).
|
|
179
|
+
- Support for Python 2.4.
|
|
180
|
+
|
|
181
|
+
1.2.7 (2010-11-05)
|
|
182
|
+
------------------
|
|
183
|
+
- Support for Windows eggs.
|
|
184
|
+
|
|
185
|
+
1.2.6 (2010-10-21)
|
|
186
|
+
------------------
|
|
187
|
+
- The geoms property of an empty collection yields [] instead of a ValueError
|
|
188
|
+
(#3).
|
|
189
|
+
- The coords and geometry type sproperties have the same behavior as above.
|
|
190
|
+
- Ensure that z values carry through into products of operations (#4).
|
|
191
|
+
|
|
192
|
+
1.2.5 (2010-09-19)
|
|
193
|
+
------------------
|
|
194
|
+
- Stop distributing docs/_build.
|
|
195
|
+
- Include library fallbacks in test_dlls.py for linux platform.
|
|
196
|
+
|
|
197
|
+
1.2.4 (2010-09-09)
|
|
198
|
+
------------------
|
|
199
|
+
- Raise AttributeError when there's no backend support for a method.
|
|
200
|
+
- Raise OSError if libgeos_c.so (or variants) can't be found and loaded.
|
|
201
|
+
- Add geos_c DLL loading support for linux platforms where find_library doesn't
|
|
202
|
+
work.
|
|
203
|
+
|
|
204
|
+
1.2.3 (2010-08-17)
|
|
205
|
+
------------------
|
|
206
|
+
- Add mapping function.
|
|
207
|
+
- Fix problem with GEOSisValidReason symbol for GEOS < 3.1.
|
|
208
|
+
|
|
209
|
+
1.2.2 (2010-07-23)
|
|
210
|
+
------------------
|
|
211
|
+
- Add representative_point method.
|
|
212
|
+
|
|
213
|
+
1.2.1 (2010-06-23)
|
|
214
|
+
------------------
|
|
215
|
+
- Fixed bounds of singular polygons.
|
|
216
|
+
- Added shapely.validation.explain_validity function (#226).
|
|
217
|
+
|
|
218
|
+
1.2 (2010-05-27)
|
|
219
|
+
----------------
|
|
220
|
+
- Final release.
|
|
221
|
+
|
|
222
|
+
1.2rc2 (2010-05-26)
|
|
223
|
+
-------------------
|
|
224
|
+
- Add examples and tests to MANIFEST.in.
|
|
225
|
+
- Release candidate 2.
|
|
226
|
+
|
|
227
|
+
1.2rc1 (2010-05-25)
|
|
228
|
+
-------------------
|
|
229
|
+
- Release candidate.
|
|
230
|
+
|
|
231
|
+
1.2b7 (2010-04-22)
|
|
232
|
+
------------------
|
|
233
|
+
- Memory leak associated with new empty geometry state fixed.
|
|
234
|
+
|
|
235
|
+
1.2b6 (2010-04-13)
|
|
236
|
+
------------------
|
|
237
|
+
- Broken GeometryCollection fixed.
|
|
238
|
+
|
|
239
|
+
1.2b5 (2010-04-09)
|
|
240
|
+
------------------
|
|
241
|
+
- Objects can be constructed from others of the same type, thereby making
|
|
242
|
+
copies. Collections can be constructed from sequences of objects, also making
|
|
243
|
+
copies.
|
|
244
|
+
- Collections are now iterators over their component objects.
|
|
245
|
+
- New code for manual figures, using the descartes package.
|
|
246
|
+
|
|
247
|
+
1.2b4 (2010-03-19)
|
|
248
|
+
------------------
|
|
249
|
+
- Adds support for the "sunos5" platform.
|
|
250
|
+
|
|
251
|
+
1.2b3 (2010-02-28)
|
|
252
|
+
------------------
|
|
253
|
+
- Only provide simplification implementations for GEOS C API >= 1.5.
|
|
254
|
+
|
|
255
|
+
1.2b2 (2010-02-19)
|
|
256
|
+
------------------
|
|
257
|
+
- Fix cascaded_union bug introduced in 1.2b1 (#212).
|
|
258
|
+
|
|
259
|
+
1.2b1 (2010-02-18)
|
|
260
|
+
------------------
|
|
261
|
+
- Update the README. Remove cruft from setup.py. Add some version 1.2 metadata
|
|
262
|
+
regarding required Python version (>=2.5,<3) and external dependency
|
|
263
|
+
(libgeos_c >= 3.1).
|
|
264
|
+
|
|
265
|
+
1.2a6 (2010-02-09)
|
|
266
|
+
------------------
|
|
267
|
+
- Add accessor for separate arrays of X and Y values (#210).
|
|
268
|
+
|
|
269
|
+
TODO: fill gap here
|
|
270
|
+
|
|
271
|
+
1.2a1 (2010-01-20)
|
|
272
|
+
------------------
|
|
273
|
+
- Proper prototyping of WKB writer, and avoidance of errors on 64-bit systems
|
|
274
|
+
(#191).
|
|
275
|
+
- Prototype libgeos_c functions in a way that lets py2exe apps import shapely
|
|
276
|
+
(#189).
|
|
277
|
+
|
|
278
|
+
=========================
|
|
279
|
+
1.2 Branched (2009-09-19)
|
|
280
|
+
=========================
|
|
281
|
+
|
|
282
|
+
1.0.12 (2009-04-09)
|
|
283
|
+
-------------------
|
|
284
|
+
- Fix for references held by topology and predicate descriptors.
|
|
285
|
+
|
|
286
|
+
1.0.11 (2008-11-20)
|
|
287
|
+
-------------------
|
|
288
|
+
- Work around bug in GEOS 2.2.3, GEOSCoordSeq_getOrdinate not exported properly
|
|
289
|
+
(#178).
|
|
290
|
+
|
|
291
|
+
1.0.10 (2008-11-17)
|
|
292
|
+
-------------------
|
|
293
|
+
- Fixed compatibility with GEOS 2.2.3 that was broken in 1.0.8 release (#176).
|
|
294
|
+
|
|
295
|
+
1.0.9 (2008-11-16)
|
|
296
|
+
------------------
|
|
297
|
+
- Find and load MacPorts libgeos.
|
|
298
|
+
|
|
299
|
+
1.0.8 (2008-11-01)
|
|
300
|
+
------------------
|
|
301
|
+
- Fill out GEOS function result and argument types to prevent faults on a
|
|
302
|
+
64-bit arch.
|
|
303
|
+
|
|
304
|
+
1.0.7 (2008-08-22)
|
|
305
|
+
------------------
|
|
306
|
+
- Polygon rings now have the same dimensions as parent (#168).
|
|
307
|
+
- Eliminated reference cycles in polygons (#169).
|
|
308
|
+
|
|
309
|
+
1.0.6 (2008-07-10)
|
|
310
|
+
------------------
|
|
311
|
+
- Fixed adaptation of multi polygon data.
|
|
312
|
+
- Raise exceptions earlier from binary predicates.
|
|
313
|
+
- Beginning distributing new windows DLLs (#166).
|
|
314
|
+
|
|
315
|
+
1.0.5 (2008-05-20)
|
|
316
|
+
------------------
|
|
317
|
+
- Added access to GEOS polygonizer function.
|
|
318
|
+
- Raise exception when insufficient coordinate tuples are passed to LinearRing
|
|
319
|
+
constructor (#164).
|
|
320
|
+
|
|
321
|
+
1.0.4 (2008-05-01)
|
|
322
|
+
------------------
|
|
323
|
+
- Disentangle Python and topological equality (#163).
|
|
324
|
+
- Add shape(), a factory that copies coordinates from a geo interface provider.
|
|
325
|
+
To be used instead of asShape() unless you really need to store coordinates
|
|
326
|
+
outside shapely for efficient use in other code.
|
|
327
|
+
- Cache GEOS geometries in adapters (#163).
|
|
328
|
+
|
|
329
|
+
1.0.3 (2008-04-09)
|
|
330
|
+
------------------
|
|
331
|
+
- Do not release GIL when calling GEOS functions (#158).
|
|
332
|
+
- Prevent faults when chaining multiple GEOS operators (#159).
|
|
333
|
+
|
|
334
|
+
1.0.2 (2008-02-26)
|
|
335
|
+
------------------
|
|
336
|
+
- Fix loss of dimensionality in polygon rings (#155).
|
|
337
|
+
|
|
338
|
+
1.0.1 (2008-02-08)
|
|
339
|
+
------------------
|
|
340
|
+
- Allow chaining expressions involving coordinate sequences and geometry parts
|
|
341
|
+
(#151).
|
|
342
|
+
- Protect against abnormal use of coordinate accessors (#152).
|
|
343
|
+
- Coordinate sequences now implement the numpy array protocol (#153).
|
|
344
|
+
|
|
345
|
+
1.0 (2008-01-18)
|
|
346
|
+
----------------
|
|
347
|
+
- Final release.
|
|
348
|
+
|
|
349
|
+
1.0 RC2 (2008-01-16)
|
|
350
|
+
--------------------
|
|
351
|
+
- Added temporary solution for #149.
|
|
352
|
+
|
|
353
|
+
1.0 RC1 (2008-01-14)
|
|
354
|
+
--------------------
|
|
355
|
+
- First release candidate
|
|
356
|
+
|
|
357
|
+
|
|
165
358
|
Keywords: geometry topology gis
|
|
166
359
|
Platform: UNKNOWN
|
|
167
360
|
Classifier: Development Status :: 5 - Production/Stable
|
shapely/coords.py
CHANGED
shapely/coords.pyc
CHANGED
|
Binary file
|
shapely/geometry/__init__.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""Geometry classes and factories
|
|
2
2
|
"""
|
|
3
3
|
|
|
4
|
-
from geo import shape, asShape, mapping
|
|
4
|
+
from geo import box, shape, asShape, mapping
|
|
5
5
|
from point import Point, asPoint
|
|
6
6
|
from linestring import LineString, asLineString
|
|
7
7
|
from polygon import Polygon, asPolygon
|
|
@@ -11,7 +11,7 @@ from multipolygon import MultiPolygon, asMultiPolygon
|
|
|
11
11
|
from collection import GeometryCollection
|
|
12
12
|
|
|
13
13
|
__all__ = [
|
|
14
|
-
'shape', 'asShape', 'Point', 'asPoint', 'LineString', 'asLineString',
|
|
14
|
+
'box', 'shape', 'asShape', 'Point', 'asPoint', 'LineString', 'asLineString',
|
|
15
15
|
'Polygon', 'asPolygon', 'MultiPoint', 'asMultiPoint',
|
|
16
16
|
'MultiLineString', 'asMultiLineString', 'MultiPolygon', 'asMultiPolygon',
|
|
17
17
|
'GeometryCollection', 'mapping'
|
shapely/geometry/__init__.pyc
CHANGED
|
Binary file
|
shapely/geometry/geo.py
CHANGED
|
@@ -7,9 +7,16 @@ from linestring import LineString, asLineString
|
|
|
7
7
|
from polygon import Polygon, asPolygon
|
|
8
8
|
from multipoint import MultiPoint, asMultiPoint
|
|
9
9
|
from multilinestring import MultiLineString, asMultiLineString
|
|
10
|
-
from multipolygon import MultiPolygon, MultiPolygonAdapter
|
|
10
|
+
from multipolygon import MultiPolygon, MultiPolygonAdapter
|
|
11
11
|
|
|
12
12
|
|
|
13
|
+
def box(minx, miny, maxx, maxy, ccw=True):
|
|
14
|
+
"""Return a rectangular polygon with configurable normal vector"""
|
|
15
|
+
coords = [(maxx, miny), (maxx, maxy), (minx, maxy), (minx, miny)]
|
|
16
|
+
if not ccw:
|
|
17
|
+
coords = coords[::-1]
|
|
18
|
+
return Polygon(coords)
|
|
19
|
+
|
|
13
20
|
def shape(context):
|
|
14
21
|
"""Return a new, independent geometry with coordinates *copied* from the
|
|
15
22
|
context.
|
shapely/geometry/geo.pyc
CHANGED
|
Binary file
|
shapely/geometry/proxy.py
CHANGED
shapely/geometry/proxy.pyc
CHANGED
|
Binary file
|
shapely/geos.py
CHANGED
|
@@ -6,10 +6,9 @@ import atexit
|
|
|
6
6
|
import logging
|
|
7
7
|
import os
|
|
8
8
|
import sys
|
|
9
|
-
import time
|
|
10
9
|
import threading
|
|
11
10
|
import ctypes
|
|
12
|
-
from ctypes import cdll, CDLL,
|
|
11
|
+
from ctypes import cdll, CDLL, CFUNCTYPE, c_char_p, c_void_p, string_at
|
|
13
12
|
from ctypes.util import find_library
|
|
14
13
|
|
|
15
14
|
import ftools
|
shapely/geos.pyc
CHANGED
|
Binary file
|
shapely/iterops.py
CHANGED
shapely/iterops.pyc
CHANGED
|
Binary file
|
shapely/predicates.py
CHANGED
shapely/predicates.pyc
CHANGED
|
Binary file
|
shapely/wkb.py
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"""Load/dump geometries using the well-known binary (WKB) format
|
|
2
2
|
"""
|
|
3
3
|
|
|
4
|
-
from ctypes import byref, c_size_t, c_char_p,
|
|
5
|
-
from ctypes import c_void_p, c_size_t
|
|
4
|
+
from ctypes import byref, c_size_t, c_char_p, c_void_p
|
|
6
5
|
|
|
7
6
|
from shapely.geos import lgeos, ReadingError
|
|
8
7
|
|
shapely/wkb.pyc
CHANGED
|
Binary file
|
EGG-INFO/scripts/dissolve.py
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
# dissolve.py
|
|
2
|
-
#
|
|
3
|
-
# Demonstrate how Shapely can be used to build up a collection of patches by
|
|
4
|
-
# dissolving circular regions and how Shapely supports plotting of the results.
|
|
5
|
-
|
|
6
|
-
from functools import partial
|
|
7
|
-
import random
|
|
8
|
-
|
|
9
|
-
import pylab
|
|
10
|
-
|
|
11
|
-
from shapely.geometry import Point
|
|
12
|
-
from shapely.ops import cascaded_union
|
|
13
|
-
|
|
14
|
-
# Use a partial function to make 100 points uniformly distributed in a 40x40
|
|
15
|
-
# box centered on 0,0.
|
|
16
|
-
r = partial(random.uniform, -20.0, 20.0)
|
|
17
|
-
points = [Point(r(), r()) for i in range(100)]
|
|
18
|
-
|
|
19
|
-
# Buffer the points, producing 100 polygon spots
|
|
20
|
-
spots = [p.buffer(2.5) for p in points]
|
|
21
|
-
|
|
22
|
-
# Perform a cascaded union of the polygon spots, dissolving them into a
|
|
23
|
-
# collection of polygon patches
|
|
24
|
-
patches = cascaded_union(spots)
|
|
25
|
-
|
|
26
|
-
if __name__ == "__main__":
|
|
27
|
-
# Illustrate the results using matplotlib's pylab interface
|
|
28
|
-
pylab.figure(num=None, figsize=(4, 4), dpi=180)
|
|
29
|
-
|
|
30
|
-
for patch in patches.geoms:
|
|
31
|
-
assert patch.geom_type in ['Polygon']
|
|
32
|
-
assert patch.is_valid
|
|
33
|
-
|
|
34
|
-
# Fill and outline each patch
|
|
35
|
-
x, y = patch.exterior.xy
|
|
36
|
-
pylab.fill(x, y, color='#cccccc', aa=True)
|
|
37
|
-
pylab.plot(x, y, color='#666666', aa=True, lw=1.0)
|
|
38
|
-
|
|
39
|
-
# Do the same for the holes of the patch
|
|
40
|
-
for hole in patch.interiors:
|
|
41
|
-
x, y = hole.xy
|
|
42
|
-
pylab.fill(x, y, color='#ffffff', aa=True)
|
|
43
|
-
pylab.plot(x, y, color='#999999', aa=True, lw=1.0)
|
|
44
|
-
|
|
45
|
-
# Plot the original points
|
|
46
|
-
pylab.plot([p.x for p in points], [p.y for p in points], 'b,', alpha=0.75)
|
|
47
|
-
|
|
48
|
-
# Write the number of patches and the total patch area to the figure
|
|
49
|
-
pylab.text(-25, 25,
|
|
50
|
-
"Patches: %d, total area: %.2f" % (len(patches.geoms), patches.area))
|
|
51
|
-
|
|
52
|
-
pylab.savefig('dissolve.png')
|
|
53
|
-
|
EGG-INFO/scripts/intersect.py
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
# intersect.py
|
|
2
|
-
#
|
|
3
|
-
# Demonstrate how Shapely can be used to analyze and plot the intersection of
|
|
4
|
-
# a trajectory and regions in space.
|
|
5
|
-
|
|
6
|
-
from functools import partial
|
|
7
|
-
import random
|
|
8
|
-
|
|
9
|
-
import pylab
|
|
10
|
-
|
|
11
|
-
from shapely.geometry import LineString, Point
|
|
12
|
-
from shapely.ops import cascaded_union
|
|
13
|
-
|
|
14
|
-
# Build patches as in dissolved.py
|
|
15
|
-
r = partial(random.uniform, -20.0, 20.0)
|
|
16
|
-
points = [Point(r(), r()) for i in range(100)]
|
|
17
|
-
spots = [p.buffer(2.5) for p in points]
|
|
18
|
-
patches = cascaded_union(spots)
|
|
19
|
-
|
|
20
|
-
# Represent the following geolocation parameters
|
|
21
|
-
#
|
|
22
|
-
# initial position: -25, -25
|
|
23
|
-
# heading: 45.0
|
|
24
|
-
# speed: 50*sqrt(2)
|
|
25
|
-
#
|
|
26
|
-
# as a line
|
|
27
|
-
vector = LineString(((-25.0, -25.0), (25.0, 25.0)))
|
|
28
|
-
|
|
29
|
-
# Find intercepted and missed patches. List the former so we can count them
|
|
30
|
-
# later
|
|
31
|
-
intercepts = [patch for patch in patches.geoms if vector.intersects(patch)]
|
|
32
|
-
misses = (patch for patch in patches.geoms if not vector.intersects(patch))
|
|
33
|
-
|
|
34
|
-
# Plot the intersection
|
|
35
|
-
intersection = vector.intersection(patches)
|
|
36
|
-
assert intersection.geom_type in ['MultiLineString']
|
|
37
|
-
|
|
38
|
-
if __name__ == "__main__":
|
|
39
|
-
# Illustrate the results using matplotlib's pylab interface
|
|
40
|
-
pylab.figure(num=None, figsize=(4, 4), dpi=180)
|
|
41
|
-
|
|
42
|
-
# Plot the misses
|
|
43
|
-
for spot in misses:
|
|
44
|
-
x, y = spot.exterior.xy
|
|
45
|
-
pylab.fill(x, y, color='#cccccc', aa=True)
|
|
46
|
-
pylab.plot(x, y, color='#999999', aa=True, lw=1.0)
|
|
47
|
-
|
|
48
|
-
# Do the same for the holes of the patch
|
|
49
|
-
for hole in spot.interiors:
|
|
50
|
-
x, y = hole.xy
|
|
51
|
-
pylab.fill(x, y, color='#ffffff', aa=True)
|
|
52
|
-
pylab.plot(x, y, color='#999999', aa=True, lw=1.0)
|
|
53
|
-
|
|
54
|
-
# Plot the intercepts
|
|
55
|
-
for spot in intercepts:
|
|
56
|
-
x, y = spot.exterior.xy
|
|
57
|
-
pylab.fill(x, y, color='red', alpha=0.25, aa=True)
|
|
58
|
-
pylab.plot(x, y, color='red', alpha=0.5, aa=True, lw=1.0)
|
|
59
|
-
|
|
60
|
-
# Do the same for the holes of the patch
|
|
61
|
-
for hole in spot.interiors:
|
|
62
|
-
x, y = hole.xy
|
|
63
|
-
pylab.fill(x, y, color='#ffffff', aa=True)
|
|
64
|
-
pylab.plot(x, y, color='red', alpha=0.5, aa=True, lw=1.0)
|
|
65
|
-
|
|
66
|
-
# Draw the projected trajectory
|
|
67
|
-
pylab.arrow(-25, -25, 50, 50, color='#999999', aa=True,
|
|
68
|
-
head_width=1.0, head_length=1.0)
|
|
69
|
-
|
|
70
|
-
for segment in intersection.geoms:
|
|
71
|
-
x, y = segment.xy
|
|
72
|
-
pylab.plot(x, y, color='red', aa=True, lw=1.5)
|
|
73
|
-
|
|
74
|
-
# Write the number of patches and the total patch area to the figure
|
|
75
|
-
pylab.text(-28, 25,
|
|
76
|
-
"Patches: %d/%d (%d), total length: %.1f" \
|
|
77
|
-
% (len(intercepts), len(patches.geoms),
|
|
78
|
-
len(intersection.geoms), intersection.length))
|
|
79
|
-
|
|
80
|
-
pylab.savefig('intersect.png')
|
|
81
|
-
|