shapely 1.2.13__py2.7-win-amd64.egg → 1.2.18__py2.7-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 +452 -377
- EGG-INFO/SOURCES.txt +96 -0
- EGG-INFO/dependency_links.txt +1 -0
- EGG-INFO/native_libs.txt +2 -0
- EGG-INFO/not-zip-safe +1 -1
- EGG-INFO/top_level.txt +1 -0
- shapely/DLLs/geos.dll +0 -0
- shapely/DLLs/geos_c.dll +0 -0
- shapely/__init__.py +1 -2
- shapely/__init__.pyc +0 -0
- shapely/affinity.py +252 -0
- shapely/affinity.pyc +0 -0
- shapely/algorithms/__init__.pyc +0 -0
- shapely/algorithms/cga.pyc +0 -0
- shapely/coords.py +53 -21
- shapely/coords.pyc +0 -0
- shapely/ctypes_declarations.py +16 -3
- shapely/ctypes_declarations.pyc +0 -0
- shapely/examples/__init__.pyc +0 -0
- shapely/examples/dissolve.pyc +0 -0
- shapely/examples/geoms.pyc +0 -0
- shapely/examples/intersect.pyc +0 -0
- shapely/examples/world.pyc +0 -0
- shapely/ftools.pyc +0 -0
- shapely/geometry/__init__.py +4 -4
- shapely/geometry/__init__.pyc +0 -0
- shapely/geometry/base.py +155 -54
- shapely/geometry/base.pyc +0 -0
- shapely/geometry/collection.pyc +0 -0
- shapely/geometry/geo.py +2 -2
- shapely/geometry/geo.pyc +0 -0
- shapely/geometry/linestring.py +24 -19
- shapely/geometry/linestring.pyc +0 -0
- shapely/geometry/multilinestring.py +2 -2
- shapely/geometry/multilinestring.pyc +0 -0
- shapely/geometry/multipoint.py +4 -0
- shapely/geometry/multipoint.pyc +0 -0
- shapely/geometry/multipolygon.py +8 -5
- shapely/geometry/multipolygon.pyc +0 -0
- shapely/geometry/point.py +7 -0
- shapely/geometry/point.pyc +0 -0
- shapely/geometry/polygon.py +28 -9
- shapely/geometry/polygon.pyc +0 -0
- shapely/geometry/proxy.py +1 -3
- shapely/geometry/proxy.pyc +0 -0
- shapely/geos.py +45 -14
- shapely/geos.pyc +0 -0
- shapely/impl.py +8 -5
- shapely/impl.pyc +0 -0
- shapely/iterops.pyc +0 -0
- shapely/linref.pyc +0 -0
- shapely/ops.py +125 -3
- shapely/ops.pyc +0 -0
- shapely/predicates.pyc +0 -0
- shapely/prepared.pyc +0 -0
- shapely/speedups/__init__.pyc +0 -0
- shapely/speedups/_speedups.c +5201 -0
- shapely/speedups/_speedups.pyc +0 -0
- shapely/speedups/_speedups.pyd +0 -0
- shapely/tests/Array.txt +86 -0
- shapely/tests/GeoInterface.txt +69 -0
- shapely/tests/IterOps.txt +31 -0
- shapely/tests/LineString.txt +134 -0
- shapely/tests/MultiLineString.txt +81 -0
- shapely/tests/MultiPoint.txt +101 -0
- shapely/tests/MultiPolygon.txt +71 -0
- shapely/tests/Operations.txt +89 -0
- shapely/tests/Operators.txt +18 -0
- shapely/tests/Persist.txt +35 -0
- shapely/tests/Point.txt +148 -0
- shapely/tests/Polygon.txt +143 -0
- shapely/tests/Predicates.txt +51 -0
- shapely/tests/__init__.py +10 -1
- shapely/tests/__init__.pyc +0 -0
- shapely/tests/attribute-chains.txt +38 -0
- shapely/tests/binascii_hex.txt +47 -0
- shapely/tests/cascaded_union.txt +26 -0
- shapely/tests/dimensions.txt +17 -0
- shapely/tests/invalid_intersection.txt +29 -0
- shapely/tests/linemerge.txt +61 -0
- shapely/tests/polygonize.txt +40 -0
- shapely/tests/test_affinity.py +239 -0
- shapely/tests/test_affinity.pyc +0 -0
- shapely/tests/test_box.pyc +0 -0
- shapely/tests/test_cga.pyc +0 -0
- shapely/tests/test_collection.py +15 -0
- shapely/tests/test_collection.pyc +0 -0
- shapely/tests/test_delegated.pyc +0 -0
- shapely/tests/test_dlls.py +1 -1
- shapely/tests/test_dlls.pyc +0 -0
- shapely/tests/test_doctests.pyc +0 -0
- shapely/tests/test_emptiness.py +41 -8
- shapely/tests/test_emptiness.pyc +0 -0
- shapely/tests/test_equality.pyc +0 -0
- shapely/tests/test_geomseq.pyc +0 -0
- shapely/tests/test_getitem.py +113 -0
- shapely/tests/test_getitem.pyc +0 -0
- shapely/tests/test_linear_referencing.pyc +0 -0
- shapely/tests/test_mapping.pyc +0 -0
- shapely/tests/test_ndarrays.py +35 -0
- shapely/tests/test_ndarrays.pyc +0 -0
- shapely/tests/test_pickle.py +15 -0
- shapely/tests/test_pickle.pyc +0 -0
- shapely/tests/test_prepared.pyc +0 -0
- shapely/tests/test_products_z.pyc +0 -0
- shapely/tests/test_singularity.pyc +0 -0
- shapely/tests/test_speedups.pyc +0 -0
- shapely/tests/test_styles.py +17 -0
- shapely/tests/test_styles.pyc +0 -0
- shapely/tests/test_transform.py +61 -0
- shapely/tests/test_transform.pyc +0 -0
- shapely/tests/test_unary_union.py +40 -0
- shapely/tests/test_unary_union.pyc +0 -0
- shapely/tests/test_validation.pyc +0 -0
- shapely/tests/test_xy.pyc +0 -0
- shapely/tests/threading_test.pyc +0 -0
- shapely/tests/wkt_locale.txt +28 -0
- shapely/topology.pyc +0 -0
- shapely/validation.pyc +0 -0
- shapely/wkb.py +3 -17
- shapely/wkb.pyc +0 -0
- shapely/wkt.py +3 -13
- shapely/wkt.pyc +0 -0
- DLLs/geos.dll +0 -0
- DLLs/geos_c.dll +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
from itertools import islice
|
|
2
|
+
import unittest
|
|
3
|
+
from shapely.geometry import Point
|
|
4
|
+
from shapely.ops import unary_union
|
|
5
|
+
|
|
6
|
+
def halton(base):
|
|
7
|
+
"""Returns an iterator over an infinite Halton sequence"""
|
|
8
|
+
def value(index):
|
|
9
|
+
result = 0.0
|
|
10
|
+
f = 1.0/base
|
|
11
|
+
i = index
|
|
12
|
+
while i > 0:
|
|
13
|
+
result += f * (i % base)
|
|
14
|
+
i = i/base
|
|
15
|
+
f = f/base
|
|
16
|
+
return result
|
|
17
|
+
i = 1
|
|
18
|
+
while i > 0:
|
|
19
|
+
yield value(i)
|
|
20
|
+
i += 1
|
|
21
|
+
|
|
22
|
+
class UnionTestCase(unittest.TestCase):
|
|
23
|
+
def test_1(self):
|
|
24
|
+
# Instead of random points, use deterministic, pseudo-random Halton
|
|
25
|
+
# sequences for repeatability sake.
|
|
26
|
+
coords = zip(
|
|
27
|
+
list(islice(halton(5), 20, 120)),
|
|
28
|
+
list(islice(halton(7), 20, 120)) )
|
|
29
|
+
patches = [Point(xy).buffer(0.05) for xy in coords]
|
|
30
|
+
u = unary_union(patches)
|
|
31
|
+
self.failUnlessEqual(u.geom_type, 'MultiPolygon')
|
|
32
|
+
self.failUnlessAlmostEqual(u.area, 0.71857254056)
|
|
33
|
+
|
|
34
|
+
def test_suite():
|
|
35
|
+
try:
|
|
36
|
+
patches = [Point((0, 0)).buffer(0.05)]
|
|
37
|
+
unary_union(patches)
|
|
38
|
+
except KeyError:
|
|
39
|
+
return lambda x: None
|
|
40
|
+
return unittest.TestLoader().loadTestsFromTestCase(UnionTestCase)
|
|
Binary file
|
|
Binary file
|
shapely/tests/test_xy.pyc
CHANGED
|
Binary file
|
shapely/tests/threading_test.pyc
CHANGED
|
Binary file
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
Test locale independence of WKT
|
|
2
|
+
===============================
|
|
3
|
+
|
|
4
|
+
Set locale to one that uses a comma as decimal seperator`
|
|
5
|
+
|
|
6
|
+
>>> import locale, sys
|
|
7
|
+
>>> if sys.platform == 'win32':
|
|
8
|
+
... _ = locale.setlocale(locale.LC_ALL, 'portuguese_brazil')
|
|
9
|
+
... else:
|
|
10
|
+
... _ = locale.setlocale(locale.LC_ALL, 'pt_BR.UTF-8')
|
|
11
|
+
|
|
12
|
+
Test reading and writing`
|
|
13
|
+
|
|
14
|
+
>>> from shapely.wkt import loads
|
|
15
|
+
>>> p = loads('POINT (0.0 0.0)')
|
|
16
|
+
>>> p.x == 0.0
|
|
17
|
+
True
|
|
18
|
+
>>> p.y == 0.0
|
|
19
|
+
True
|
|
20
|
+
>>> p.wkt
|
|
21
|
+
'POINT (0.0...)'
|
|
22
|
+
>>> from shapely.wkt import dumps
|
|
23
|
+
>>> dumps(p)
|
|
24
|
+
'POINT (0.0...)'
|
|
25
|
+
|
|
26
|
+
Reset locale
|
|
27
|
+
|
|
28
|
+
>>> _ = locale.setlocale(locale.LC_ALL, '')
|
shapely/topology.pyc
CHANGED
|
Binary file
|
shapely/validation.pyc
CHANGED
|
Binary file
|
shapely/wkb.py
CHANGED
|
@@ -1,24 +1,13 @@
|
|
|
1
1
|
"""Load/dump geometries using the well-known binary (WKB) format
|
|
2
2
|
"""
|
|
3
3
|
|
|
4
|
-
from
|
|
5
|
-
|
|
6
|
-
from shapely.geos import lgeos, ReadingError
|
|
7
|
-
|
|
4
|
+
from shapely.geometry.base import geom_from_wkb, geom_to_wkb
|
|
8
5
|
|
|
9
6
|
# Pickle-like convenience functions
|
|
10
7
|
|
|
11
|
-
def deserialize(data):
|
|
12
|
-
geom = lgeos.GEOSGeomFromWKB_buf(c_char_p(data), c_size_t(len(data)));
|
|
13
|
-
if not geom:
|
|
14
|
-
raise ReadingError(
|
|
15
|
-
"Could not create geometry because of errors while reading input.")
|
|
16
|
-
return geom
|
|
17
|
-
|
|
18
8
|
def loads(data):
|
|
19
9
|
"""Load a geometry from a WKB string."""
|
|
20
|
-
|
|
21
|
-
return geom_factory(deserialize(data))
|
|
10
|
+
return geom_from_wkb(data)
|
|
22
11
|
|
|
23
12
|
def load(fp):
|
|
24
13
|
"""Load a geometry from an open file."""
|
|
@@ -27,10 +16,7 @@ def load(fp):
|
|
|
27
16
|
|
|
28
17
|
def dumps(ob):
|
|
29
18
|
"""Dump a WKB representation of a geometry to a byte string."""
|
|
30
|
-
|
|
31
|
-
raise ValueError("Null geometry supports no operations")
|
|
32
|
-
size = c_size_t()
|
|
33
|
-
return lgeos.GEOSGeomToWKB_buf(c_void_p(ob._geom), pointer(size))
|
|
19
|
+
return geom_to_wkb(ob)
|
|
34
20
|
|
|
35
21
|
def dump(ob, fp):
|
|
36
22
|
"""Dump a geometry to an open file."""
|
shapely/wkb.pyc
CHANGED
|
Binary file
|
shapely/wkt.py
CHANGED
|
@@ -1,21 +1,13 @@
|
|
|
1
1
|
"""Load/dump geometries using the well-known text (WKT) format
|
|
2
2
|
"""
|
|
3
3
|
|
|
4
|
-
from
|
|
5
|
-
|
|
6
|
-
from shapely.geos import lgeos, ReadingError
|
|
7
|
-
|
|
4
|
+
from shapely.geometry.base import geom_from_wkt, geom_to_wkt
|
|
8
5
|
|
|
9
6
|
# Pickle-like convenience functions
|
|
10
7
|
|
|
11
8
|
def loads(data):
|
|
12
9
|
"""Load a geometry from a WKT string."""
|
|
13
|
-
|
|
14
|
-
geom = lgeos.GEOSGeomFromWKT(c_char_p(data))
|
|
15
|
-
if not geom:
|
|
16
|
-
raise ReadingError, \
|
|
17
|
-
"Could not create geometry because of errors while reading input."
|
|
18
|
-
return geom_factory(geom)
|
|
10
|
+
return geom_from_wkt(data) #factory(geom)
|
|
19
11
|
|
|
20
12
|
def load(fp):
|
|
21
13
|
"""Load a geometry from an open file."""
|
|
@@ -24,9 +16,7 @@ def load(fp):
|
|
|
24
16
|
|
|
25
17
|
def dumps(ob):
|
|
26
18
|
"""Dump a WKB representation of a geometry to a byte string."""
|
|
27
|
-
|
|
28
|
-
raise ValueError("Null geometry supports no operations")
|
|
29
|
-
return lgeos.GEOSGeomToWKT(ob._geom)
|
|
19
|
+
return geom_to_wkt(ob)
|
|
30
20
|
|
|
31
21
|
def dump(ob, fp):
|
|
32
22
|
"""Dump a geometry to an open file."""
|
shapely/wkt.pyc
CHANGED
|
Binary file
|
DLLs/geos.dll
DELETED
|
Binary file
|
DLLs/geos_c.dll
DELETED
|
Binary file
|