shapely 1.0.1__tar.gz → 1.0.3__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 (57) hide show
  1. Shapely-1.0.3/CHANGES.txt +10 -0
  2. Shapely-1.0.1/CHANGES.txt → Shapely-1.0.3/HISTORY.txt +16 -0
  3. {Shapely-1.0.1 → Shapely-1.0.3}/PKG-INFO +9 -6
  4. {Shapely-1.0.1 → Shapely-1.0.3}/README.txt +8 -5
  5. {Shapely-1.0.1 → Shapely-1.0.3}/Shapely.egg-info/PKG-INFO +9 -6
  6. {Shapely-1.0.1 → Shapely-1.0.3}/Shapely.egg-info/SOURCES.txt +1 -0
  7. {Shapely-1.0.1 → Shapely-1.0.3}/setup.py +1 -1
  8. {Shapely-1.0.1 → Shapely-1.0.3}/setup_windows.py +1 -1
  9. {Shapely-1.0.1 → Shapely-1.0.3}/shapely/geometry/base.py +3 -1
  10. {Shapely-1.0.1 → Shapely-1.0.3}/shapely/geometry/polygon.py +5 -5
  11. {Shapely-1.0.1 → Shapely-1.0.3}/shapely/geos.py +5 -5
  12. {Shapely-1.0.1 → Shapely-1.0.3}/shapely/topology.py +2 -2
  13. {Shapely-1.0.1 → Shapely-1.0.3}/tests/attribute-chains.txt +7 -3
  14. Shapely-1.0.3/tests/test_threads.py +33 -0
  15. Shapely-1.0.1/HISTORY.txt +0 -16
  16. {Shapely-1.0.1 → Shapely-1.0.3}/CREDITS.txt +0 -0
  17. {Shapely-1.0.1 → Shapely-1.0.3}/LICENSE.txt +0 -0
  18. {Shapely-1.0.1 → Shapely-1.0.3}/Shapely.egg-info/dependency_links.txt +0 -0
  19. {Shapely-1.0.1 → Shapely-1.0.3}/Shapely.egg-info/requires.txt +0 -0
  20. {Shapely-1.0.1 → Shapely-1.0.3}/Shapely.egg-info/top_level.txt +0 -0
  21. {Shapely-1.0.1 → Shapely-1.0.3}/examples/geoms.py +0 -0
  22. {Shapely-1.0.1 → Shapely-1.0.3}/examples/world.py +0 -0
  23. {Shapely-1.0.1 → Shapely-1.0.3}/manual/manual.txt +0 -0
  24. {Shapely-1.0.1 → Shapely-1.0.3}/manual/style.css +0 -0
  25. {Shapely-1.0.1 → Shapely-1.0.3}/setup.cfg +0 -0
  26. {Shapely-1.0.1 → Shapely-1.0.3}/shapely/__init__.py +0 -0
  27. {Shapely-1.0.1 → Shapely-1.0.3}/shapely/geometry/__init__.py +0 -0
  28. {Shapely-1.0.1 → Shapely-1.0.3}/shapely/geometry/collection.py +0 -0
  29. {Shapely-1.0.1 → Shapely-1.0.3}/shapely/geometry/geo.py +0 -0
  30. {Shapely-1.0.1 → Shapely-1.0.3}/shapely/geometry/linestring.py +0 -0
  31. {Shapely-1.0.1 → Shapely-1.0.3}/shapely/geometry/multilinestring.py +0 -0
  32. {Shapely-1.0.1 → Shapely-1.0.3}/shapely/geometry/multipoint.py +0 -0
  33. {Shapely-1.0.1 → Shapely-1.0.3}/shapely/geometry/multipolygon.py +0 -0
  34. {Shapely-1.0.1 → Shapely-1.0.3}/shapely/geometry/point.py +0 -0
  35. {Shapely-1.0.1 → Shapely-1.0.3}/shapely/iterops.py +0 -0
  36. {Shapely-1.0.1 → Shapely-1.0.3}/shapely/kml.py +0 -0
  37. {Shapely-1.0.1 → Shapely-1.0.3}/shapely/predicates.py +0 -0
  38. {Shapely-1.0.1 → Shapely-1.0.3}/shapely/wkb.py +0 -0
  39. {Shapely-1.0.1 → Shapely-1.0.3}/shapely/wkt.py +0 -0
  40. {Shapely-1.0.1 → Shapely-1.0.3}/tests/Array.txt +0 -0
  41. {Shapely-1.0.1 → Shapely-1.0.3}/tests/GeoInterface.txt +0 -0
  42. {Shapely-1.0.1 → Shapely-1.0.3}/tests/IterOps.txt +0 -0
  43. {Shapely-1.0.1 → Shapely-1.0.3}/tests/LineString.txt +0 -0
  44. {Shapely-1.0.1 → Shapely-1.0.3}/tests/MultiLineString.txt +0 -0
  45. {Shapely-1.0.1 → Shapely-1.0.3}/tests/MultiPoint.txt +0 -0
  46. {Shapely-1.0.1 → Shapely-1.0.3}/tests/MultiPolygon.txt +0 -0
  47. {Shapely-1.0.1 → Shapely-1.0.3}/tests/Operations.txt +0 -0
  48. {Shapely-1.0.1 → Shapely-1.0.3}/tests/Persist.txt +0 -0
  49. {Shapely-1.0.1 → Shapely-1.0.3}/tests/Point.txt +0 -0
  50. {Shapely-1.0.1 → Shapely-1.0.3}/tests/Polygon.txt +0 -0
  51. {Shapely-1.0.1 → Shapely-1.0.3}/tests/Predicates.txt +0 -0
  52. {Shapely-1.0.1 → Shapely-1.0.3}/tests/__init__.py +0 -0
  53. {Shapely-1.0.1 → Shapely-1.0.3}/tests/binascii_hex.txt +0 -0
  54. {Shapely-1.0.1 → Shapely-1.0.3}/tests/invalid_intersection.txt +0 -0
  55. {Shapely-1.0.1 → Shapely-1.0.3}/tests/rungrind.dist +0 -0
  56. {Shapely-1.0.1 → Shapely-1.0.3}/tests/test_doctests.py +0 -0
  57. {Shapely-1.0.1 → Shapely-1.0.3}/tests/valgrind-python.supp +0 -0
@@ -0,0 +1,10 @@
1
+ All tickets are children of http://trac.gispython.org/projects/PCL/ticket/
2
+
3
+ 1.0.3 (2008-04-09)
4
+ ------------------
5
+ - Do not release GIL when calling GEOS functions (#158).
6
+ - Prevent faults when chaining multiple GEOS operators (#159).
7
+
8
+ 1.0.2 (2008-02-26)
9
+ ------------------
10
+ - Fix loss of dimensionality in polygon rings (#155).
@@ -6,3 +6,19 @@ All ticket numbers are rooted at http://trac.gispython.org/projects/PCL/ticket/
6
6
  (#151).
7
7
  - Protect against abnormal use of coordinate accessors (#152).
8
8
  - Coordinate sequences now implement the numpy array protocol (#153).
9
+
10
+
11
+ 1.0: 18 January 2008
12
+ --------------------
13
+ - Final release.
14
+
15
+
16
+ 1.0 RC2: 16 January 2008
17
+ ------------------------
18
+ - Added temporary solution for #149.
19
+
20
+
21
+ 1.0 RC1: 14 January 2008
22
+ ------------------------
23
+ - First release candidate
24
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.0
2
2
  Name: Shapely
3
- Version: 1.0.1
3
+ Version: 1.0.3
4
4
  Summary: Geospatial geometries, predicates, and operations
5
5
  Home-page: http://trac.gispython.org/projects/PCL/wiki/Shapely
6
6
  Author: Sean Gillies
@@ -9,10 +9,11 @@ License: BSD
9
9
  Description: Shapely
10
10
  =======
11
11
 
12
- Shapely is a Python package for programming with 2D geospatial geometries. It
13
- is based on GEOS (http://geos.refractions.net). Shapely 1.0 is ignorant about
14
- coordinate and reference systems. Projection responsibility is left to specific
15
- applications. For more information, see:
12
+ Shapely is a Python package for manipulation and analysis of 2D geospatial
13
+ geometries. It is based on GEOS (http://geos.refractions.net). Shapely 1.0 is
14
+ not concerned with data formats or coordinate reference systems.
15
+ Responsibility for reading and writing data and projecting coordinates is left
16
+ to other packages like WorldMill_ and pyproj_. For more information, see:
16
17
 
17
18
  * Shapely wiki_
18
19
  * Shapely manual_
@@ -23,7 +24,9 @@ Description: Shapely
23
24
  See also CHANGES.txt_ and HISTORY.txt_.
24
25
 
25
26
  .. _CHANGES.txt: http://trac.gispython.org/projects/PCL/browser/Shapely/trunk/CHANGES.txt
26
- .. _HISTROY.txt: http://trac.gispython.org/projects/PCL/browser/Shapely/trunk/HISTORY.txt
27
+ .. _HISTORY.txt: http://trac.gispython.org/projects/PCL/browser/Shapely/trunk/HISTORY.txt
28
+ .. _WorldMill: http://pypi.python.org/pypi/WorldMill
29
+ .. _pyproj: http://pypi.python.org/pypi/pyproj
27
30
 
28
31
 
29
32
  Dependencies
@@ -1,10 +1,11 @@
1
1
  Shapely
2
2
  =======
3
3
 
4
- Shapely is a Python package for programming with 2D geospatial geometries. It
5
- is based on GEOS (http://geos.refractions.net). Shapely 1.0 is ignorant about
6
- coordinate and reference systems. Projection responsibility is left to specific
7
- applications. For more information, see:
4
+ Shapely is a Python package for manipulation and analysis of 2D geospatial
5
+ geometries. It is based on GEOS (http://geos.refractions.net). Shapely 1.0 is
6
+ not concerned with data formats or coordinate reference systems.
7
+ Responsibility for reading and writing data and projecting coordinates is left
8
+ to other packages like WorldMill_ and pyproj_. For more information, see:
8
9
 
9
10
  * Shapely wiki_
10
11
  * Shapely manual_
@@ -15,7 +16,9 @@ http://zcologia.com/news/564/shapely-for-python-3-0/.)
15
16
  See also CHANGES.txt_ and HISTORY.txt_.
16
17
 
17
18
  .. _CHANGES.txt: http://trac.gispython.org/projects/PCL/browser/Shapely/trunk/CHANGES.txt
18
- .. _HISTROY.txt: http://trac.gispython.org/projects/PCL/browser/Shapely/trunk/HISTORY.txt
19
+ .. _HISTORY.txt: http://trac.gispython.org/projects/PCL/browser/Shapely/trunk/HISTORY.txt
20
+ .. _WorldMill: http://pypi.python.org/pypi/WorldMill
21
+ .. _pyproj: http://pypi.python.org/pypi/pyproj
19
22
 
20
23
 
21
24
  Dependencies
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.0
2
2
  Name: Shapely
3
- Version: 1.0.1
3
+ Version: 1.0.3
4
4
  Summary: Geospatial geometries, predicates, and operations
5
5
  Home-page: http://trac.gispython.org/projects/PCL/wiki/Shapely
6
6
  Author: Sean Gillies
@@ -9,10 +9,11 @@ License: BSD
9
9
  Description: Shapely
10
10
  =======
11
11
 
12
- Shapely is a Python package for programming with 2D geospatial geometries. It
13
- is based on GEOS (http://geos.refractions.net). Shapely 1.0 is ignorant about
14
- coordinate and reference systems. Projection responsibility is left to specific
15
- applications. For more information, see:
12
+ Shapely is a Python package for manipulation and analysis of 2D geospatial
13
+ geometries. It is based on GEOS (http://geos.refractions.net). Shapely 1.0 is
14
+ not concerned with data formats or coordinate reference systems.
15
+ Responsibility for reading and writing data and projecting coordinates is left
16
+ to other packages like WorldMill_ and pyproj_. For more information, see:
16
17
 
17
18
  * Shapely wiki_
18
19
  * Shapely manual_
@@ -23,7 +24,9 @@ Description: Shapely
23
24
  See also CHANGES.txt_ and HISTORY.txt_.
24
25
 
25
26
  .. _CHANGES.txt: http://trac.gispython.org/projects/PCL/browser/Shapely/trunk/CHANGES.txt
26
- .. _HISTROY.txt: http://trac.gispython.org/projects/PCL/browser/Shapely/trunk/HISTORY.txt
27
+ .. _HISTORY.txt: http://trac.gispython.org/projects/PCL/browser/Shapely/trunk/HISTORY.txt
28
+ .. _WorldMill: http://pypi.python.org/pypi/WorldMill
29
+ .. _pyproj: http://pypi.python.org/pypi/pyproj
27
30
 
28
31
 
29
32
  Dependencies
@@ -50,4 +50,5 @@ tests/binascii_hex.txt
50
50
  tests/invalid_intersection.txt
51
51
  tests/rungrind.dist
52
52
  tests/test_doctests.py
53
+ tests/test_threads.py
53
54
  tests/valgrind-python.supp
@@ -11,7 +11,7 @@ if version_info[:2] < (2,5):
11
11
  readme_text = file('README.txt', 'rb').read()
12
12
 
13
13
  setup(name = 'Shapely',
14
- version = '1.0.1',
14
+ version = '1.0.3',
15
15
  description = 'Geospatial geometries, predicates, and operations',
16
16
  license = 'BSD',
17
17
  keywords = 'geometry topology',
@@ -11,7 +11,7 @@ if version_info[:2] < (2,5):
11
11
  readme_text = file('README.txt', 'rb').read()
12
12
 
13
13
  setup(name = 'Shapely',
14
- version = '1.0',
14
+ version = '1.0.3',
15
15
  description = 'Geospatial geometries, predicates, and operations',
16
16
  license = 'BSD',
17
17
  keywords = 'geometry topology',
@@ -28,7 +28,7 @@ def geometry_type_name(g):
28
28
 
29
29
  # Abstract geometry factory for use with topological methods below
30
30
 
31
- def geom_factory(g):
31
+ def geom_factory(g, parent=None):
32
32
  if not g:
33
33
  raise ValueError, "No Shapely geometry can be created from this null value"
34
34
  ob = BaseGeometry()
@@ -42,6 +42,7 @@ def geom_factory(g):
42
42
  )
43
43
  ob.__class__ = getattr(mod, geom_type)
44
44
  ob.__geom__ = g
45
+ ob.__p__ = parent
45
46
  ob._ndim = 2 # callers should be all from 2D worlds
46
47
  return ob
47
48
 
@@ -231,6 +232,7 @@ class BaseGeometry(object):
231
232
  """
232
233
 
233
234
  __geom__ = None # See _geom property below
235
+ __p__ = None
234
236
  _ctypes_data = None
235
237
  _ndim = None
236
238
  _crs = None
@@ -172,7 +172,7 @@ class LinearRing(LineString):
172
172
  # allow creation of null lines, to support unpickling
173
173
  pass
174
174
  else:
175
- self._geom, self._ndims = geos_linearring_from_py(coordinates)
175
+ self._geom, self._ndim = geos_linearring_from_py(coordinates)
176
176
 
177
177
  @property
178
178
  def __geo_interface__(self):
@@ -278,7 +278,7 @@ class InteriorRingSequence(object):
278
278
 
279
279
  def geos_polygon_from_py(shell, holes=None):
280
280
  if shell is not None:
281
- geos_shell, ndims = geos_linearring_from_py(shell)
281
+ geos_shell, ndim = geos_linearring_from_py(shell)
282
282
  if holes:
283
283
  ob = holes
284
284
  L = len(ob)
@@ -294,7 +294,7 @@ def geos_polygon_from_py(shell, holes=None):
294
294
 
295
295
  # add to coordinate sequence
296
296
  for l in xrange(L):
297
- geom, ndims = geos_linearring_from_py(ob[l])
297
+ geom, ndim = geos_linearring_from_py(ob[l])
298
298
  geos_holes[l] = cast(geom, c_void_p)
299
299
 
300
300
  else:
@@ -307,7 +307,7 @@ def geos_polygon_from_py(shell, holes=None):
307
307
  geos_holes,
308
308
  L
309
309
  ),
310
- ndims
310
+ ndim
311
311
  )
312
312
 
313
313
  class Polygon(BaseGeometry):
@@ -339,7 +339,7 @@ class Polygon(BaseGeometry):
339
339
  BaseGeometry.__init__(self)
340
340
 
341
341
  if shell is not None:
342
- self._geom, self._ndims = geos_polygon_from_py(shell, holes)
342
+ self._geom, self._ndim = geos_polygon_from_py(shell, holes)
343
343
 
344
344
  @property
345
345
  @exceptNull
@@ -3,7 +3,7 @@ Exports the libgeos_c shared lib, GEOS-specific exceptions, and utilities.
3
3
  """
4
4
 
5
5
  import atexit
6
- from ctypes import cdll, CDLL, CFUNCTYPE, c_char_p
6
+ from ctypes import cdll, CDLL, pydll, PyDLL, CFUNCTYPE, c_char_p
7
7
  from ctypes.util import find_library
8
8
  import os
9
9
  import sys
@@ -15,7 +15,7 @@ if sys.platform == 'win32':
15
15
  local_dlls = os.path.abspath(os.__file__ + "../../../DLLs")
16
16
  original_path = os.environ['PATH']
17
17
  os.environ['PATH'] = "%s;%s" % (local_dlls, original_path)
18
- lgeos = CDLL("geos.dll")
18
+ lgeos = PyDLL("geos.dll")
19
19
  except (ImportError, WindowsError):
20
20
  raise
21
21
  def free(m):
@@ -38,14 +38,14 @@ elif sys.platform == 'darwin':
38
38
  break
39
39
  else:
40
40
  raise ImportError, "Could not find geos_c library"
41
- lgeos = CDLL(lib)
41
+ lgeos = PyDLL(lib)
42
42
  free = CDLL(find_library('libc')).free
43
43
  else:
44
44
  # Try the major versioned name first, falling back on the unversioned name.
45
45
  try:
46
- lgeos = CDLL('libgeos_c.so.1')
46
+ lgeos = PyDLL('libgeos_c.so.1')
47
47
  except (OSError, ImportError):
48
- lgeos = CDLL('libgeos_c.so')
48
+ lgeos = PyDLL('libgeos_c.so')
49
49
  except:
50
50
  raise
51
51
  free = CDLL('libc.so.6').free
@@ -38,7 +38,7 @@ class BinaryTopologicalOp(object):
38
38
  raise TopologicalError, \
39
39
  "The operation '%s' produced a null geometry. Likely cause is invalidity of the 'other' geometry %s" % (self.fn.__name__, repr(other))
40
40
 
41
- return self.factory(product)
41
+ return self.factory(product, self.context)
42
42
 
43
43
 
44
44
  class UnaryTopologicalOp(object):
@@ -59,7 +59,7 @@ class UnaryTopologicalOp(object):
59
59
  def __get__(self, obj, objtype=None):
60
60
  if obj._geom is None:
61
61
  raise ValueError, "Null geometry supports no operations"
62
- return self.factory(self.fn(obj._geom))
62
+ return self.factory(self.fn(obj._geom), obj)
63
63
 
64
64
  def __set__(self, obj, value=None):
65
65
  raise AttributeError, "Attribute is read-only"
@@ -9,7 +9,7 @@ See also ticket #151.
9
9
  [(0.0, 0.0), (0.0, 1.0), (-1.0, 1.0), (-1.0, 0.0), (0.0, 0.0)]
10
10
 
11
11
  >>> print list(p.buffer(1).exterior.coords)
12
- [(-0.99999999999999989, 2.0), (0.0, 2.0)...
12
+ [(0.0, -1.0), (-1.0, -1.0), ...
13
13
 
14
14
  Test chained access to interiors
15
15
 
@@ -22,6 +22,10 @@ Test chained access to interiors
22
22
  >>> print list(p.interiors[0].coords)
23
23
  [(-0.25, 0.25), (-0.25, 0.75), (-0.75, 0.75), (-0.75, 0.25), (-0.25, 0.25)]
24
24
  >>> print list(p.interiors[0].buffer(1).exterior.coords)
25
- [(-0.24999999999999986, -0.75), (-0.25, -0.75)...
26
-
25
+ [(-0.25, -0.75), (-0.75, -0.75), ...
26
+
27
+ Test multiple operators, boundary of a buffer
28
+
29
+ >>> print list(p.buffer(1).boundary.coords)
30
+ [(0.0, -1.0), (-1.0, -1.0), ...
27
31
 
@@ -0,0 +1,33 @@
1
+ import threading
2
+
3
+ def main():
4
+ num_threads = 4
5
+ use_threads = True
6
+
7
+ if not use_threads:
8
+ # Run core code
9
+ runShapelyBuilding()
10
+ else:
11
+ threads = [threading.Thread(target=runShapelyBuilding) for x in range(num_threads)]
12
+ for t in threads:
13
+ t.start()
14
+ for t in threads:
15
+ t.join()
16
+
17
+ def runShapelyBuilding():
18
+ import shapely.wkt
19
+ import shapely.wkb
20
+
21
+ print "Running shapely tests on wkb"
22
+
23
+ wkb = shapely.wkt.loads("POINT (0 0)").wkb
24
+
25
+ for i in xrange(1000):
26
+ obj = shapely.wkb.loads(wkb)
27
+
28
+ print "Done"
29
+
30
+ # Run main
31
+ if __name__ == '__main__':
32
+ main()
33
+
Shapely-1.0.1/HISTORY.txt DELETED
@@ -1,16 +0,0 @@
1
- All ticket numbers are rooted at http://trac.gispython.org/projects/PCL/ticket/
2
-
3
- 1.0: 18 January 2008
4
- --------------------
5
- - Final release.
6
-
7
-
8
- 1.0 RC2: 16 January 2008
9
- ------------------------
10
- - Added temporary solution for #149.
11
-
12
-
13
- 1.0 RC1: 14 January 2008
14
- ------------------------
15
- - First release candidate
16
-
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes