shapely 1.2.14__tar.gz → 1.2.15__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 (91) hide show
  1. {Shapely-1.2.14 → Shapely-1.2.15}/CHANGES.txt +9 -0
  2. {Shapely-1.2.14/Shapely.egg-info → Shapely-1.2.15}/PKG-INFO +10 -1
  3. {Shapely-1.2.14 → Shapely-1.2.15/Shapely.egg-info}/PKG-INFO +10 -1
  4. {Shapely-1.2.14 → Shapely-1.2.15}/Shapely.egg-info/SOURCES.txt +2 -1
  5. Shapely-1.2.15/VERSION.txt +1 -0
  6. {Shapely-1.2.14 → Shapely-1.2.15}/setup.py +56 -33
  7. Shapely-1.2.15/shapely/__init__.py +1 -0
  8. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/coords.py +15 -0
  9. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/geometry/linestring.py +4 -0
  10. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/geometry/multipoint.py +4 -0
  11. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/geometry/point.py +7 -0
  12. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/geometry/polygon.py +4 -0
  13. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/geos.py +3 -0
  14. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/speedups/_speedups.c +1090 -975
  15. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/tests/__init__.py +2 -0
  16. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/tests/attribute-chains.txt +2 -4
  17. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/tests/cascaded_union.txt +3 -2
  18. Shapely-1.2.15/shapely/tests/test_ndarrays.py +35 -0
  19. Shapely-1.2.14/shapely/__init__.py +0 -2
  20. Shapely-1.2.14/shapely/speedups/_speedups.pyx +0 -295
  21. {Shapely-1.2.14 → Shapely-1.2.15}/CREDITS.txt +0 -0
  22. {Shapely-1.2.14 → Shapely-1.2.15}/LICENSE.txt +0 -0
  23. {Shapely-1.2.14 → Shapely-1.2.15}/README.rst +0 -0
  24. {Shapely-1.2.14 → Shapely-1.2.15}/Shapely.egg-info/dependency_links.txt +0 -0
  25. {Shapely-1.2.14 → Shapely-1.2.15}/Shapely.egg-info/top_level.txt +0 -0
  26. {Shapely-1.2.14 → Shapely-1.2.15}/docs/manual.txt +0 -0
  27. {Shapely-1.2.14 → Shapely-1.2.15}/setup.cfg +0 -0
  28. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/algorithms/__init__.py +0 -0
  29. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/algorithms/cga.py +0 -0
  30. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/ctypes_declarations.py +0 -0
  31. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/examples/__init__.py +0 -0
  32. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/examples/dissolve.py +0 -0
  33. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/examples/geoms.py +0 -0
  34. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/examples/intersect.py +0 -0
  35. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/examples/world.py +0 -0
  36. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/ftools.py +0 -0
  37. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/geometry/__init__.py +0 -0
  38. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/geometry/base.py +0 -0
  39. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/geometry/collection.py +0 -0
  40. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/geometry/geo.py +0 -0
  41. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/geometry/multilinestring.py +0 -0
  42. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/geometry/multipolygon.py +0 -0
  43. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/geometry/proxy.py +0 -0
  44. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/impl.py +0 -0
  45. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/iterops.py +0 -0
  46. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/linref.py +0 -0
  47. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/ops.py +0 -0
  48. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/predicates.py +0 -0
  49. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/prepared.py +0 -0
  50. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/speedups/__init__.py +0 -0
  51. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/tests/Array.txt +0 -0
  52. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/tests/GeoInterface.txt +0 -0
  53. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/tests/IterOps.txt +0 -0
  54. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/tests/LineString.txt +0 -0
  55. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/tests/MultiLineString.txt +0 -0
  56. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/tests/MultiPoint.txt +0 -0
  57. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/tests/MultiPolygon.txt +0 -0
  58. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/tests/Operations.txt +0 -0
  59. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/tests/Persist.txt +0 -0
  60. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/tests/Point.txt +0 -0
  61. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/tests/Polygon.txt +0 -0
  62. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/tests/Predicates.txt +0 -0
  63. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/tests/binascii_hex.txt +0 -0
  64. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/tests/dimensions.txt +0 -0
  65. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/tests/invalid_intersection.txt +0 -0
  66. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/tests/linemerge.txt +0 -0
  67. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/tests/polygonize.txt +0 -0
  68. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/tests/test_box.py +0 -0
  69. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/tests/test_cga.py +0 -0
  70. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/tests/test_collection.py +0 -0
  71. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/tests/test_delegated.py +0 -0
  72. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/tests/test_dlls.py +0 -0
  73. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/tests/test_doctests.py +0 -0
  74. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/tests/test_emptiness.py +0 -0
  75. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/tests/test_equality.py +0 -0
  76. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/tests/test_geomseq.py +0 -0
  77. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/tests/test_getitem.py +0 -0
  78. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/tests/test_linear_referencing.py +0 -0
  79. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/tests/test_mapping.py +0 -0
  80. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/tests/test_prepared.py +0 -0
  81. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/tests/test_products_z.py +0 -0
  82. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/tests/test_singularity.py +0 -0
  83. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/tests/test_speedups.py +0 -0
  84. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/tests/test_validation.py +0 -0
  85. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/tests/test_xy.py +0 -0
  86. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/tests/threading_test.py +0 -0
  87. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/tests/wkt_locale.txt +0 -0
  88. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/topology.py +0 -0
  89. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/validation.py +0 -0
  90. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/wkb.py +0 -0
  91. {Shapely-1.2.14 → Shapely-1.2.15}/shapely/wkt.py +0 -0
@@ -2,6 +2,15 @@
2
2
  Changes
3
3
  =======
4
4
 
5
+ 1.2.15 (2012-)
6
+ --------------
7
+ - Eliminate numerical sensitivity in a method chaining test (Debian bug
8
+ #663210).
9
+ - Account for cascaded union of random buffered test points being a polygon
10
+ or multipolygon (Debian bug #666655).
11
+ - Use Cython to build speedups if it is installed.
12
+ - Avoid stumbling over SVN revision numbers in GEOS C API version strings.
13
+
5
14
  1.2.14 (2012-01-23)
6
15
  -------------------
7
16
  - A geometry's coords property is now sliceable, yielding a list of coordinate
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.0
2
2
  Name: Shapely
3
- Version: 1.2.14
3
+ Version: 1.2.15
4
4
  Summary: Geometric objects, predicates, and operations
5
5
  Home-page: https://github.com/sgillies/shapely
6
6
  Author: Sean Gillies
@@ -162,6 +162,15 @@ Description: ======
162
162
  Changes
163
163
  =======
164
164
 
165
+ 1.2.15 (2012-)
166
+ --------------
167
+ - Eliminate numerical sensitivity in a method chaining test (Debian bug
168
+ #663210).
169
+ - Account for cascaded union of random buffered test points being a polygon
170
+ or multipolygon (Debian bug #666655).
171
+ - Use Cython to build speedups if it is installed.
172
+ - Avoid stumbling over SVN revision numbers in GEOS C API version strings.
173
+
165
174
  1.2.14 (2012-01-23)
166
175
  -------------------
167
176
  - A geometry's coords property is now sliceable, yielding a list of coordinate
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.0
2
2
  Name: Shapely
3
- Version: 1.2.14
3
+ Version: 1.2.15
4
4
  Summary: Geometric objects, predicates, and operations
5
5
  Home-page: https://github.com/sgillies/shapely
6
6
  Author: Sean Gillies
@@ -162,6 +162,15 @@ Description: ======
162
162
  Changes
163
163
  =======
164
164
 
165
+ 1.2.15 (2012-)
166
+ --------------
167
+ - Eliminate numerical sensitivity in a method chaining test (Debian bug
168
+ #663210).
169
+ - Account for cascaded union of random buffered test points being a polygon
170
+ or multipolygon (Debian bug #666655).
171
+ - Use Cython to build speedups if it is installed.
172
+ - Avoid stumbling over SVN revision numbers in GEOS C API version strings.
173
+
165
174
  1.2.14 (2012-01-23)
166
175
  -------------------
167
176
  - A geometry's coords property is now sliceable, yielding a list of coordinate
@@ -2,6 +2,7 @@ CHANGES.txt
2
2
  CREDITS.txt
3
3
  LICENSE.txt
4
4
  README.rst
5
+ VERSION.txt
5
6
  setup.cfg
6
7
  setup.py
7
8
  Shapely.egg-info/PKG-INFO
@@ -44,7 +45,6 @@ shapely/geometry/polygon.py
44
45
  shapely/geometry/proxy.py
45
46
  shapely/speedups/__init__.py
46
47
  shapely/speedups/_speedups.c
47
- shapely/speedups/_speedups.pyx
48
48
  shapely/tests/Array.txt
49
49
  shapely/tests/GeoInterface.txt
50
50
  shapely/tests/IterOps.txt
@@ -77,6 +77,7 @@ shapely/tests/test_geomseq.py
77
77
  shapely/tests/test_getitem.py
78
78
  shapely/tests/test_linear_referencing.py
79
79
  shapely/tests/test_mapping.py
80
+ shapely/tests/test_ndarrays.py
80
81
  shapely/tests/test_prepared.py
81
82
  shapely/tests/test_products_z.py
82
83
  shapely/tests/test_singularity.py
@@ -0,0 +1 @@
1
+ 1.2.15
@@ -1,4 +1,3 @@
1
- import glob
2
1
  import warnings
3
2
 
4
3
  try:
@@ -11,11 +10,23 @@ except:
11
10
 
12
11
  from distutils.errors import CCompilerError, DistutilsExecError, \
13
12
  DistutilsPlatformError
13
+ import glob
14
+ import os
15
+ import platform
14
16
  from setuptools.extension import Extension
15
- from setuptools.command.build_ext import build_ext
16
17
  from setuptools import setup, find_packages
18
+ import subprocess
17
19
  import sys
18
- import platform
20
+
21
+ # Parse the version from the shapely module
22
+ for line in open('shapely/__init__.py', 'rb'):
23
+ if line.find("__version__") >= 0:
24
+ version = line.split("=")[1].strip()
25
+ version = version.strip('"')
26
+ version = version.strip("'")
27
+ continue
28
+
29
+ open('VERSION.txt', 'wb').write(version)
19
30
 
20
31
  readme_text = open('README.rst', 'rb').read()
21
32
 
@@ -27,7 +38,7 @@ changes_text = f.read()
27
38
  setup_args = dict(
28
39
  metadata_version = '1.2',
29
40
  name = 'Shapely',
30
- version = '1.2.14',
41
+ version = version,
31
42
  requires_python = '>=2.5,<3',
32
43
  requires_external = 'libgeos_c (>=3.1)',
33
44
  description = 'Geometric objects, predicates, and operations',
@@ -81,41 +92,53 @@ else:
81
92
  class BuildFailed(Exception):
82
93
  pass
83
94
 
84
- class ve_build_ext(build_ext):
85
- # This class allows C extension building to fail.
86
-
87
- def run(self):
88
- try:
89
- build_ext.run(self)
90
- except DistutilsPlatformError, x:
91
- raise BuildFailed(x)
92
-
93
- def build_extension(self, ext):
94
- try:
95
- build_ext.build_extension(self, ext)
96
- except ext_errors, x:
97
- raise BuildFailed(x)
98
-
99
- if sys.platform == 'win32':
100
- # geos DLL is geos.dll instead of geos_c.dll on Windows
101
- ext_modules = [
102
- Extension("shapely.speedups._speedups",
103
- ["shapely/speedups/_speedups.c"], libraries=['geos']),
104
- ]
105
- elif (hasattr(platform, 'python_implementation')
95
+ try:
96
+ # try to use Cython if present
97
+ from Cython.Distutils import build_ext
98
+ except ImportError:
99
+ # else try to build from existing .c file
100
+ from setuptools.command.build_ext import build_ext as distutils_build_ext
101
+
102
+ class build_ext(distutils_build_ext):
103
+ # This class allows C extension building to fail.
104
+
105
+ def run(self):
106
+ try:
107
+ distutils_build_ext.run(self)
108
+ except DistutilsPlatformError, x:
109
+ raise BuildFailed(x)
110
+
111
+ def build_extension(self, ext):
112
+ try:
113
+ distutils_build_ext.build_extension(self, ext)
114
+ except ext_errors, x:
115
+ raise BuildFailed(x)
116
+
117
+ if (hasattr(platform, 'python_implementation')
106
118
  and platform.python_implementation() == 'PyPy'):
107
- # python_implementation >= 2.6
119
+ # python_implementation is only available since 2.6
108
120
  ext_modules = []
109
- else:
110
- ext_modules = [
111
- Extension("shapely.speedups._speedups",
112
- ["shapely/speedups/_speedups.c"], libraries=['geos_c']),
113
- ]
114
121
 
122
+ elif sys.platform == 'win32':
123
+ libraries = ['geos']
124
+ else:
125
+ libraries = ['geos_c']
126
+
127
+ if os.path.exists("MANIFEST.in"):
128
+ subprocess.check_call(["cython", "shapely/speedups/_speedups.pyx"])
129
+ if not os.path.exists("shapely/speedups/_speedups.c"):
130
+ raise RuntimeError("Failed to generate C extension from PYX")
131
+
132
+ ext_modules = [
133
+ Extension(
134
+ "shapely.speedups._speedups",
135
+ ["shapely/speedups/_speedups.c"],
136
+ libraries=libraries )]
137
+
115
138
  try:
116
139
  # try building with speedups
117
140
  setup(
118
- cmdclass={'build_ext': ve_build_ext},
141
+ cmdclass={'build_ext': build_ext},
119
142
  ext_modules=ext_modules,
120
143
  **setup_args
121
144
  )
@@ -0,0 +1 @@
1
+ __version__ = "1.2.15"
@@ -8,6 +8,21 @@ import sys
8
8
  from shapely.geos import lgeos
9
9
  from shapely.topology import Validating
10
10
 
11
+ try:
12
+ import numpy
13
+ has_numpy = True
14
+ except ImportError:
15
+ has_numpy = False
16
+
17
+ def required(ob):
18
+ """Return an object that meets Shapely requirements for self-owned
19
+ C-continguous data, copying if necessary, or just return the original
20
+ object."""
21
+ if has_numpy and hasattr(ob, '__array_interface__'):
22
+ return numpy.require(ob, numpy.float64, ["C", "OWNDATA"])
23
+ else:
24
+ return ob
25
+
11
26
 
12
27
  class CoordinateSequence(object):
13
28
  """
@@ -4,6 +4,7 @@
4
4
  from ctypes import c_double, cast, POINTER
5
5
  from ctypes import ArgumentError
6
6
 
7
+ from shapely.coords import required
7
8
  from shapely.geos import lgeos, TopologicalError
8
9
  from shapely.geometry.base import BaseGeometry, geom_factory
9
10
  from shapely.geometry.proxy import CachingGeometryProxy
@@ -151,6 +152,9 @@ def asLineString(context):
151
152
 
152
153
 
153
154
  def geos_linestring_from_py(ob, update_geom=None, update_ndim=0):
155
+ # If numpy is present, we use numpy.require to ensure that we have a
156
+ # C-continguous array that owns its data. View data will be copied.
157
+ ob = required(ob)
154
158
  try:
155
159
  # From array protocol
156
160
  array = ob.__array_interface__
@@ -4,6 +4,7 @@
4
4
  from ctypes import byref, c_double, c_void_p, cast, POINTER
5
5
  from ctypes import ArgumentError
6
6
 
7
+ from shapely.coords import required
7
8
  from shapely.geos import lgeos
8
9
  from shapely.geometry.base import BaseMultipartGeometry, exceptNull
9
10
  from shapely.geometry.point import Point, geos_point_from_py
@@ -128,6 +129,9 @@ def asMultiPoint(context):
128
129
 
129
130
 
130
131
  def geos_multipoint_from_py(ob):
132
+ # If numpy is present, we use numpy.require to ensure that we have a
133
+ # C-continguous array that owns its data. View data will be copied.
134
+ ob = required(ob)
131
135
  try:
132
136
  # From array protocol
133
137
  array = ob.__array_interface__
@@ -4,6 +4,7 @@
4
4
  from ctypes import c_double
5
5
  from ctypes import cast, POINTER
6
6
 
7
+ from shapely.coords import required
7
8
  from shapely.geos import lgeos, DimensionError
8
9
  from shapely.geometry.base import BaseGeometry
9
10
  from shapely.geometry.proxy import CachingGeometryProxy
@@ -172,6 +173,9 @@ def geos_point_from_py(ob, update_geom=None, update_ndim=0):
172
173
 
173
174
  Returns the GEOS geometry and the number of its dimensions.
174
175
  """
176
+ # If numpy is present, we use numpy.require to ensure that we have a
177
+ # C-continguous array that owns its data. View data will be copied.
178
+ ob = required(ob)
175
179
  try:
176
180
  # From array protocol
177
181
  array = ob.__array_interface__
@@ -183,6 +187,9 @@ def geos_point_from_py(ob, update_geom=None, update_ndim=0):
183
187
  da = array['data']
184
188
  if type(da) == type((0,)):
185
189
  cdata = da[0]
190
+ # If we had numpy, we would do
191
+ # from numpy.ctypeslib import as_ctypes
192
+ # cp = as_ctypes(ob) - check that code?
186
193
  cp = cast(cdata, POINTER(c_double))
187
194
  dx = c_double(cp[0])
188
195
  dy = c_double(cp[1])
@@ -6,6 +6,7 @@ from ctypes import ArgumentError
6
6
  import weakref
7
7
 
8
8
  from shapely.algorithms.cga import signed_area
9
+ from shapely.coords import required
9
10
  from shapely.geos import lgeos
10
11
  from shapely.geometry.base import BaseGeometry
11
12
  from shapely.geometry.linestring import LineString, LineStringAdapter
@@ -309,6 +310,9 @@ def orient(polygon, sign=1.0):
309
310
  return Polygon(rings[0], rings[1:])
310
311
 
311
312
  def geos_linearring_from_py(ob, update_geom=None, update_ndim=0):
313
+ # If numpy is present, we use numpy.require to ensure that we have a
314
+ # C-continguous array that owns its data. View data will be copied.
315
+ ob = required(ob)
312
316
  try:
313
317
  # From array protocol
314
318
  array = ob.__array_interface__
@@ -95,6 +95,9 @@ def _geos_c_version():
95
95
  func.argtypes = []
96
96
  func.restype = c_char_p
97
97
  v = func().split('-')[2]
98
+ # Ditch any SVN revision numbering that may have crept in without (ftm)
99
+ # importing `re`.
100
+ v = v.split()[0]
98
101
  return tuple(int(n) for n in v.split('.'))
99
102
 
100
103
  geos_capi_version = geos_c_version = _geos_c_version()