shapely 1.2.10__py2.6-win-amd64.egg → 1.2.13__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 +48 -29
- EGG-INFO/native_libs.txt +1 -0
- EGG-INFO/not-zip-safe +1 -1
- shapely/__init__.py +2 -1
- shapely/__init__.pyc +0 -0
- shapely/ctypes_declarations.py +5 -0
- shapely/ctypes_declarations.pyc +0 -0
- shapely/examples/__init__.py +1 -0
- shapely/examples/__init__.pyc +0 -0
- shapely/examples/dissolve.py +53 -0
- shapely/examples/dissolve.pyc +0 -0
- shapely/examples/geoms.py +51 -0
- shapely/examples/geoms.pyc +0 -0
- shapely/examples/intersect.py +81 -0
- shapely/examples/intersect.pyc +0 -0
- shapely/examples/world.py +21 -0
- shapely/examples/world.pyc +0 -0
- shapely/geometry/base.py +4 -1
- shapely/geometry/base.pyc +0 -0
- shapely/geometry/linestring.py +8 -13
- shapely/geometry/linestring.pyc +0 -0
- shapely/geometry/multilinestring.py +0 -3
- shapely/geometry/multilinestring.pyc +0 -0
- shapely/geometry/multipoint.py +3 -2
- shapely/geometry/multipoint.pyc +0 -0
- shapely/geometry/polygon.py +19 -39
- shapely/geometry/polygon.pyc +0 -0
- shapely/geos.py +8 -7
- shapely/geos.pyc +0 -0
- shapely/predicates.py +2 -2
- shapely/predicates.pyc +0 -0
- shapely/prepared.py +4 -1
- shapely/prepared.pyc +0 -0
- shapely/speedups/__init__.py +42 -0
- shapely/speedups/__init__.pyc +0 -0
- shapely/speedups/_speedups.py +7 -0
- shapely/speedups/_speedups.pyc +0 -0
- shapely/speedups/_speedups.pyd +0 -0
- shapely/tests/__init__.py +28 -0
- shapely/tests/__init__.pyc +0 -0
- shapely/tests/test_box.py +19 -0
- shapely/tests/test_box.pyc +0 -0
- shapely/tests/test_cga.py +33 -0
- shapely/tests/test_cga.pyc +0 -0
- shapely/tests/test_collection.py +11 -0
- shapely/tests/test_collection.pyc +0 -0
- shapely/tests/test_delegated.py +26 -0
- shapely/tests/test_delegated.pyc +0 -0
- shapely/tests/test_dlls.py +16 -0
- shapely/tests/test_dlls.pyc +0 -0
- shapely/tests/test_doctests.py +35 -0
- shapely/tests/test_doctests.pyc +0 -0
- shapely/tests/test_emptiness.py +19 -0
- shapely/tests/test_emptiness.pyc +0 -0
- shapely/tests/test_equality.py +30 -0
- shapely/tests/test_equality.pyc +0 -0
- shapely/tests/test_geomseq.py +11 -0
- shapely/tests/test_geomseq.pyc +0 -0
- shapely/tests/test_linear_referencing.py +67 -0
- shapely/tests/test_linear_referencing.pyc +0 -0
- shapely/tests/test_mapping.py +11 -0
- shapely/tests/test_mapping.pyc +0 -0
- shapely/tests/test_prepared.py +28 -0
- shapely/tests/test_prepared.pyc +0 -0
- shapely/tests/test_products_z.py +14 -0
- shapely/tests/test_products_z.pyc +0 -0
- shapely/tests/test_singularity.py +15 -0
- shapely/tests/test_singularity.pyc +0 -0
- shapely/tests/test_speedups.py +38 -0
- shapely/tests/test_speedups.pyc +0 -0
- shapely/tests/test_validation.py +10 -0
- shapely/tests/test_validation.pyc +0 -0
- shapely/tests/test_xy.py +14 -0
- shapely/tests/test_xy.pyc +0 -0
- shapely/tests/threading_test.py +37 -0
- shapely/tests/threading_test.pyc +0 -0
- shapely/topology.py +6 -8
- shapely/topology.pyc +0 -0
- shapely/wkb.py +2 -2
- shapely/wkb.pyc +0 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import threading
|
|
2
|
+
|
|
3
|
+
def main():
|
|
4
|
+
num_threads = 10
|
|
5
|
+
use_threads = True
|
|
6
|
+
|
|
7
|
+
if not use_threads:
|
|
8
|
+
# Run core code
|
|
9
|
+
runShapelyBuilding()
|
|
10
|
+
else:
|
|
11
|
+
threads = [threading.Thread(target=runShapelyBuilding, name=str(i), args=(i,)) for i in range(num_threads)]
|
|
12
|
+
for t in threads:
|
|
13
|
+
t.start()
|
|
14
|
+
for t in threads:
|
|
15
|
+
t.join()
|
|
16
|
+
|
|
17
|
+
def runShapelyBuilding(num):
|
|
18
|
+
print "%s: Running shapely tests on wkb" % num
|
|
19
|
+
import shapely.geos
|
|
20
|
+
print "%s GEOS Handle: %s" % (num, shapely.geos.lgeos.geos_handle)
|
|
21
|
+
import shapely.wkt
|
|
22
|
+
import shapely.wkb
|
|
23
|
+
p = shapely.wkt.loads("POINT (0 0)")
|
|
24
|
+
print "%s WKT: %s" % (num, shapely.wkt.dumps(p))
|
|
25
|
+
wkb = shapely.wkb.dumps(p)
|
|
26
|
+
print "%s WKB: %s" % (num, wkb.encode('hex'))
|
|
27
|
+
|
|
28
|
+
for i in xrange(10):
|
|
29
|
+
obj = shapely.wkb.loads(wkb)
|
|
30
|
+
|
|
31
|
+
print "%s GEOS Handle: %s" % (num, shapely.geos.lgeos.geos_handle)
|
|
32
|
+
print "Done %s" % num
|
|
33
|
+
|
|
34
|
+
# Run main
|
|
35
|
+
if __name__ == '__main__':
|
|
36
|
+
main()
|
|
37
|
+
|
|
Binary file
|
shapely/topology.py
CHANGED
|
@@ -10,14 +10,12 @@ These methods return ctypes objects that should be recast by the caller.
|
|
|
10
10
|
from ctypes import byref, c_double
|
|
11
11
|
from shapely.geos import TopologicalError, lgeos
|
|
12
12
|
|
|
13
|
-
|
|
14
13
|
class Validating(object):
|
|
15
|
-
def _validate(self, ob):
|
|
16
|
-
|
|
17
|
-
assert ob is not None
|
|
18
|
-
assert ob._geom is not None
|
|
19
|
-
except AssertionError:
|
|
14
|
+
def _validate(self, ob, stop_prepared=False):
|
|
15
|
+
if ob is None or ob._geom is None:
|
|
20
16
|
raise ValueError("Null geometry supports no operations")
|
|
17
|
+
if stop_prepared and not hasattr(ob, 'type'):
|
|
18
|
+
raise ValueError("Prepared geometries cannot be operated on")
|
|
21
19
|
|
|
22
20
|
class Delegating(Validating):
|
|
23
21
|
def __init__(self, name):
|
|
@@ -26,7 +24,7 @@ class Delegating(Validating):
|
|
|
26
24
|
class BinaryRealProperty(Delegating):
|
|
27
25
|
def __call__(self, this, other):
|
|
28
26
|
self._validate(this)
|
|
29
|
-
self._validate(other)
|
|
27
|
+
self._validate(other, stop_prepared=True)
|
|
30
28
|
d = c_double()
|
|
31
29
|
retval = self.fn(this._geom, other._geom, byref(d))
|
|
32
30
|
return d.value
|
|
@@ -41,7 +39,7 @@ class UnaryRealProperty(Delegating):
|
|
|
41
39
|
class BinaryTopologicalOp(Delegating):
|
|
42
40
|
def __call__(self, this, other, *args):
|
|
43
41
|
self._validate(this)
|
|
44
|
-
self._validate(other)
|
|
42
|
+
self._validate(other, stop_prepared=True)
|
|
45
43
|
product = self.fn(this._geom, other._geom, *args)
|
|
46
44
|
if product is None:
|
|
47
45
|
if not this.is_valid:
|
shapely/topology.pyc
CHANGED
|
Binary file
|
shapely/wkb.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""Load/dump geometries using the well-known binary (WKB) format
|
|
2
2
|
"""
|
|
3
3
|
|
|
4
|
-
from ctypes import
|
|
4
|
+
from ctypes import pointer, c_size_t, c_char_p, c_void_p
|
|
5
5
|
|
|
6
6
|
from shapely.geos import lgeos, ReadingError
|
|
7
7
|
|
|
@@ -30,7 +30,7 @@ def dumps(ob):
|
|
|
30
30
|
if ob is None or ob._geom is None:
|
|
31
31
|
raise ValueError("Null geometry supports no operations")
|
|
32
32
|
size = c_size_t()
|
|
33
|
-
return lgeos.GEOSGeomToWKB_buf(c_void_p(ob._geom),
|
|
33
|
+
return lgeos.GEOSGeomToWKB_buf(c_void_p(ob._geom), pointer(size))
|
|
34
34
|
|
|
35
35
|
def dump(ob, fp):
|
|
36
36
|
"""Dump a geometry to an open file."""
|
shapely/wkb.pyc
CHANGED
|
Binary file
|