shapely 1.0.5__tar.gz → 1.0.6__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 (59) hide show
  1. {Shapely-1.0.5 → Shapely-1.0.6}/CHANGES.txt +6 -0
  2. {Shapely-1.0.5 → Shapely-1.0.6}/CREDITS.txt +0 -1
  3. {Shapely-1.0.5 → Shapely-1.0.6}/PKG-INFO +1 -2
  4. {Shapely-1.0.5 → Shapely-1.0.6}/README.txt +0 -1
  5. {Shapely-1.0.5 → Shapely-1.0.6}/Shapely.egg-info/PKG-INFO +1 -2
  6. {Shapely-1.0.5 → Shapely-1.0.6}/setup.py +1 -1
  7. {Shapely-1.0.5 → Shapely-1.0.6}/setup_windows.py +2 -2
  8. {Shapely-1.0.5 → Shapely-1.0.6}/shapely/geometry/geo.py +3 -3
  9. {Shapely-1.0.5 → Shapely-1.0.6}/shapely/geometry/multipolygon.py +24 -4
  10. {Shapely-1.0.5 → Shapely-1.0.6}/shapely/predicates.py +4 -2
  11. {Shapely-1.0.5 → Shapely-1.0.6}/tests/GeoInterface.txt +1 -1
  12. {Shapely-1.0.5 → Shapely-1.0.6}/HISTORY.txt +0 -0
  13. {Shapely-1.0.5 → Shapely-1.0.6}/LICENSE.txt +0 -0
  14. {Shapely-1.0.5 → Shapely-1.0.6}/Shapely.egg-info/SOURCES.txt +0 -0
  15. {Shapely-1.0.5 → Shapely-1.0.6}/Shapely.egg-info/dependency_links.txt +0 -0
  16. {Shapely-1.0.5 → Shapely-1.0.6}/Shapely.egg-info/requires.txt +0 -0
  17. {Shapely-1.0.5 → Shapely-1.0.6}/Shapely.egg-info/top_level.txt +0 -0
  18. {Shapely-1.0.5 → Shapely-1.0.6}/examples/geoms.py +0 -0
  19. {Shapely-1.0.5 → Shapely-1.0.6}/examples/world.py +0 -0
  20. {Shapely-1.0.5 → Shapely-1.0.6}/manual/manual.txt +0 -0
  21. {Shapely-1.0.5 → Shapely-1.0.6}/manual/style.css +0 -0
  22. {Shapely-1.0.5 → Shapely-1.0.6}/setup.cfg +0 -0
  23. {Shapely-1.0.5 → Shapely-1.0.6}/shapely/__init__.py +0 -0
  24. {Shapely-1.0.5 → Shapely-1.0.6}/shapely/geometry/__init__.py +0 -0
  25. {Shapely-1.0.5 → Shapely-1.0.6}/shapely/geometry/base.py +0 -0
  26. {Shapely-1.0.5 → Shapely-1.0.6}/shapely/geometry/collection.py +0 -0
  27. {Shapely-1.0.5 → Shapely-1.0.6}/shapely/geometry/linestring.py +0 -0
  28. {Shapely-1.0.5 → Shapely-1.0.6}/shapely/geometry/multilinestring.py +0 -0
  29. {Shapely-1.0.5 → Shapely-1.0.6}/shapely/geometry/multipoint.py +0 -0
  30. {Shapely-1.0.5 → Shapely-1.0.6}/shapely/geometry/point.py +0 -0
  31. {Shapely-1.0.5 → Shapely-1.0.6}/shapely/geometry/polygon.py +0 -0
  32. {Shapely-1.0.5 → Shapely-1.0.6}/shapely/geometry/proxy.py +0 -0
  33. {Shapely-1.0.5 → Shapely-1.0.6}/shapely/geos.py +0 -0
  34. {Shapely-1.0.5 → Shapely-1.0.6}/shapely/iterops.py +0 -0
  35. {Shapely-1.0.5 → Shapely-1.0.6}/shapely/kml.py +0 -0
  36. {Shapely-1.0.5 → Shapely-1.0.6}/shapely/ops.py +0 -0
  37. {Shapely-1.0.5 → Shapely-1.0.6}/shapely/topology.py +0 -0
  38. {Shapely-1.0.5 → Shapely-1.0.6}/shapely/wkb.py +0 -0
  39. {Shapely-1.0.5 → Shapely-1.0.6}/shapely/wkt.py +0 -0
  40. {Shapely-1.0.5 → Shapely-1.0.6}/tests/Array.txt +0 -0
  41. {Shapely-1.0.5 → Shapely-1.0.6}/tests/IterOps.txt +0 -0
  42. {Shapely-1.0.5 → Shapely-1.0.6}/tests/LineString.txt +0 -0
  43. {Shapely-1.0.5 → Shapely-1.0.6}/tests/MultiLineString.txt +0 -0
  44. {Shapely-1.0.5 → Shapely-1.0.6}/tests/MultiPoint.txt +0 -0
  45. {Shapely-1.0.5 → Shapely-1.0.6}/tests/MultiPolygon.txt +0 -0
  46. {Shapely-1.0.5 → Shapely-1.0.6}/tests/Operations.txt +0 -0
  47. {Shapely-1.0.5 → Shapely-1.0.6}/tests/Persist.txt +0 -0
  48. {Shapely-1.0.5 → Shapely-1.0.6}/tests/Point.txt +0 -0
  49. {Shapely-1.0.5 → Shapely-1.0.6}/tests/Polygon.txt +0 -0
  50. {Shapely-1.0.5 → Shapely-1.0.6}/tests/Predicates.txt +0 -0
  51. {Shapely-1.0.5 → Shapely-1.0.6}/tests/__init__.py +0 -0
  52. {Shapely-1.0.5 → Shapely-1.0.6}/tests/attribute-chains.txt +0 -0
  53. {Shapely-1.0.5 → Shapely-1.0.6}/tests/binascii_hex.txt +0 -0
  54. {Shapely-1.0.5 → Shapely-1.0.6}/tests/invalid_intersection.txt +0 -0
  55. {Shapely-1.0.5 → Shapely-1.0.6}/tests/polygonize.txt +0 -0
  56. {Shapely-1.0.5 → Shapely-1.0.6}/tests/rungrind.dist +0 -0
  57. {Shapely-1.0.5 → Shapely-1.0.6}/tests/test_doctests.py +0 -0
  58. {Shapely-1.0.5 → Shapely-1.0.6}/tests/test_threads.py +0 -0
  59. {Shapely-1.0.5 → Shapely-1.0.6}/tests/valgrind-python.supp +0 -0
@@ -1,5 +1,11 @@
1
1
  All tickets are children of http://trac.gispython.org/projects/PCL/ticket/
2
2
 
3
+ 1.0.6 (2008-07-10)
4
+ ------------------
5
+ - Fixed adaptation of multi polygon data.
6
+ - Raise exceptions earlier from binary predicates.
7
+ - Beginning distributing new windows DLLs (#166).
8
+
3
9
  1.0.5 (2008-05-20)
4
10
  ------------------
5
11
  - Added access to GEOS polygonizer function.
@@ -4,7 +4,6 @@ Kai Lautaportti (Hexagon IT)
4
4
  Frédéric Junod (Camptocamp SA)
5
5
  Eric Lemoine (Camptocamp SA)
6
6
  Justin Bronn (GeoDjango) for ctypes inspiration
7
- Artem Pavlenko (Mapnik) for help with GEOS DLLs
8
7
 
9
8
  Some of this work was supported by a grant from the U.S. National Endowment for
10
9
  the Humanities (http://www.neh.gov).
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.0
2
2
  Name: Shapely
3
- Version: 1.0.5
3
+ Version: 1.0.6
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
@@ -161,7 +161,6 @@ Description: Shapely
161
161
  * Fr |eaigue| d |eaigue| ric Junod (Camptocamp SA)
162
162
  * Eric Lemoine (Camptocamp SA)
163
163
  * Justin Bronn (GeoDjango) for ctypes inspiration
164
- * Artem Pavlenko (Mapnik) for help with GEOS DLLs
165
164
 
166
165
  .. |eaigue| unicode:: U+00E9
167
166
  :trim:
@@ -153,7 +153,6 @@ Credits
153
153
  * Fr |eaigue| d |eaigue| ric Junod (Camptocamp SA)
154
154
  * Eric Lemoine (Camptocamp SA)
155
155
  * Justin Bronn (GeoDjango) for ctypes inspiration
156
- * Artem Pavlenko (Mapnik) for help with GEOS DLLs
157
156
 
158
157
  .. |eaigue| unicode:: U+00E9
159
158
  :trim:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.0
2
2
  Name: Shapely
3
- Version: 1.0.5
3
+ Version: 1.0.6
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
@@ -161,7 +161,6 @@ Description: Shapely
161
161
  * Fr |eaigue| d |eaigue| ric Junod (Camptocamp SA)
162
162
  * Eric Lemoine (Camptocamp SA)
163
163
  * Justin Bronn (GeoDjango) for ctypes inspiration
164
- * Artem Pavlenko (Mapnik) for help with GEOS DLLs
165
164
 
166
165
  .. |eaigue| unicode:: U+00E9
167
166
  :trim:
@@ -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.5',
14
+ version = '1.0.6',
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.5',
14
+ version = '1.0.6',
15
15
  description = 'Geospatial geometries, predicates, and operations',
16
16
  license = 'BSD',
17
17
  keywords = 'geometry topology',
@@ -22,7 +22,7 @@ setup(name = 'Shapely',
22
22
  url = 'http://trac.gispython.org/projects/PCL/wiki/Shapely',
23
23
  long_description = readme_text,
24
24
  packages = ['shapely', 'shapely.geometry'],
25
- data_files=[('DLLs', ['DLLs/geos.dll']),],
25
+ data_files=[('DLLs', ['DLLs/geos.dll', 'DLLs/libgeos-3-0-0.dll']),],
26
26
  install_requires = install_requires,
27
27
  #tests_require = ['numpy'], -- not working with "tests" command
28
28
  test_suite = 'tests.test_suite',
@@ -7,7 +7,7 @@ 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, asMultiPolygon
10
+ from multipolygon import MultiPolygon, MultiPolygonAdapter, asMultiPolygon
11
11
 
12
12
 
13
13
  def shape(context):
@@ -30,7 +30,7 @@ def shape(context):
30
30
  elif geom_type == "multilinestring":
31
31
  return MultiLineString(ob["coordinates"])
32
32
  elif geom_type == "multipolygon":
33
- return MultiPolygon(ob["coordinates"])
33
+ return MultiPolygon(ob["coordinates"], context_type='geojson')
34
34
  else:
35
35
  raise ValueError, "Unknown geometry type: %s" % geom_type
36
36
 
@@ -59,6 +59,6 @@ def asShape(context):
59
59
  elif geom_type == "multilinestring":
60
60
  return asMultiLineString(ob["coordinates"])
61
61
  elif geom_type == "multipolygon":
62
- return asMultiPolygon(ob["coordinates"])
62
+ return MultiPolygonAdapter(ob["coordinates"], context_type='geojson')
63
63
  else:
64
64
  raise ValueError, "Unknown geometry type: %s" % geom_type
@@ -11,6 +11,20 @@ from shapely.geometry.proxy import CachingGeometryProxy
11
11
 
12
12
 
13
13
  def geos_multipolygon_from_py(ob):
14
+ """ob must provide Python geo interface coordinates."""
15
+ L = len(ob)
16
+ N = len(ob[0][0][0])
17
+ assert L >= 1
18
+ assert N == 2 or N == 3
19
+
20
+ subs = (c_void_p * L)()
21
+ for l in xrange(L):
22
+ geom, ndims = geos_polygon_from_py(ob[l][0], ob[l][1:])
23
+ subs[l] = cast(geom, c_void_p)
24
+
25
+ return (lgeos.GEOSGeom_createCollection(6, subs, L), N)
26
+
27
+ def geos_multipolygon_from_polygons(ob):
14
28
  """ob must be either a sequence or array of sequences or arrays."""
15
29
  L = len(ob)
16
30
  N = len(ob[0][0][0])
@@ -25,12 +39,13 @@ def geos_multipolygon_from_py(ob):
25
39
  return (lgeos.GEOSGeom_createCollection(6, subs, L), N)
26
40
 
27
41
 
42
+
28
43
  class MultiPolygon(BaseGeometry):
29
44
 
30
45
  """a multiple polygon geometry.
31
46
  """
32
47
 
33
- def __init__(self, polygons=None):
48
+ def __init__(self, polygons=None, context_type='polygons'):
34
49
  """Initialize.
35
50
 
36
51
  Parameters
@@ -55,7 +70,9 @@ class MultiPolygon(BaseGeometry):
55
70
  if polygons is None:
56
71
  # allow creation of null collections, to support unpickling
57
72
  pass
58
- else:
73
+ elif context_type == 'polygons':
74
+ self._geom, self._ndim = geos_multipolygon_from_polygons(polygons)
75
+ elif context_type == 'geojson':
59
76
  self._geom, self._ndim = geos_multipolygon_from_py(polygons)
60
77
 
61
78
  @property
@@ -111,9 +128,12 @@ class MultiPolygonAdapter(CachingGeometryProxy, MultiPolygon):
111
128
  context = None
112
129
  _owned = False
113
130
 
114
- def __init__(self, context):
131
+ def __init__(self, context, context_type='polygons'):
115
132
  self.context = context
116
- self.factory = geos_multipolygon_from_py
133
+ if context_type == 'geojson':
134
+ self.factory = geos_multipolygon_from_py
135
+ elif context_type == 'polygons':
136
+ self.factory = geos_multipolygon_from_polygons
117
137
 
118
138
  @property
119
139
  def _ndim(self):
@@ -23,12 +23,14 @@ class BinaryPredicate(object):
23
23
  self.fn.errcheck = errcheck
24
24
 
25
25
  def __get__(self, obj, objtype=None):
26
+ if not obj._geom:
27
+ raise ValueError, "Null geometry supports no operations"
26
28
  self.context = obj
27
29
  return self
28
30
 
29
31
  def __call__(self, other):
30
- if not self.context._geom or not other._geom:
31
- raise ValueError, "Null geometry supports no operations"
32
+ if not other._geom:
33
+ raise ValueError, "Null geometry can not be operated upon"
32
34
  return bool(self.fn(self.context._geom, other._geom))
33
35
 
34
36
 
@@ -61,7 +61,7 @@ Test implementation of geo interface
61
61
 
62
62
  multi polygon
63
63
 
64
- >>> shape = asShape({'type': 'MultiPolygon', 'coordinates': [(((0.0, 0.0), (0.0, 1.0), (1.0, 1.0), (1.0, 0.0), (0.0, 0.0)), [((0.10000000000000001, 0.10000000000000001), (0.10000000000000001, 0.20000000000000001), (0.20000000000000001, 0.20000000000000001), (0.20000000000000001, 0.10000000000000001), (0.10000000000000001, 0.10000000000000001))])]})
64
+ >>> shape = asShape({'type': 'MultiPolygon', 'coordinates': [(((0.0, 0.0), (0.0, 1.0), (1.0, 1.0), (1.0, 0.0), (0.0, 0.0)), ((0.10000000000000001, 0.10000000000000001), (0.10000000000000001, 0.20000000000000001), (0.20000000000000001, 0.20000000000000001), (0.20000000000000001, 0.10000000000000001), (0.10000000000000001, 0.10000000000000001)))]})
65
65
  >>> shape # doctest: +ELLIPSIS
66
66
  <shapely.geometry.multipolygon.MultiPolygonAdapter object at ...>
67
67
  >>> len(shape.geoms)
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
File without changes
File without changes