shapely 1.0.13__tar.gz → 1.0.14__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 (86) hide show
  1. {Shapely-1.0.13 → Shapely-1.0.14}/CHANGES.txt +5 -0
  2. {Shapely-1.0.13 → Shapely-1.0.14}/PKG-INFO +1 -1
  3. {Shapely-1.0.13 → Shapely-1.0.14}/Shapely.egg-info/PKG-INFO +1 -1
  4. {Shapely-1.0.13 → Shapely-1.0.14}/Shapely.egg-info/SOURCES.txt +7 -0
  5. Shapely-1.0.14/Shapely.egg-info/requires.txt +2 -0
  6. Shapely-1.0.14/manual/style.css +231 -0
  7. {Shapely-1.0.13 → Shapely-1.0.14}/setup.py +1 -1
  8. Shapely-1.0.14/setup_windows.py +37 -0
  9. {Shapely-1.0.13 → Shapely-1.0.14}/shapely/ctypes_declarations.py +4 -0
  10. {Shapely-1.0.13 → Shapely-1.0.14}/shapely/geometry/base.py +4 -3
  11. {Shapely-1.0.13 → Shapely-1.0.14}/shapely/geos.py +5 -1
  12. {Shapely-1.0.13 → Shapely-1.0.14}/shapely/wkb.py +4 -2
  13. Shapely-1.0.14/tests/__init__.py +2 -0
  14. Shapely-1.0.14/tests/rungrind.dist +4 -0
  15. Shapely-1.0.14/tests/test_doctests.py +35 -0
  16. Shapely-1.0.14/tests/test_threads.py +33 -0
  17. Shapely-1.0.14/tests/valgrind-python.supp +240 -0
  18. Shapely-1.0.13/._CHANGES.txt +0 -0
  19. Shapely-1.0.13/._CREDITS.txt +0 -0
  20. Shapely-1.0.13/._HISTORY.txt +0 -0
  21. Shapely-1.0.13/._MANIFEST.in +0 -0
  22. Shapely-1.0.13/._README.txt +0 -0
  23. Shapely-1.0.13/._setup.py +0 -0
  24. Shapely-1.0.13/Shapely.egg-info/requires.txt +0 -1
  25. Shapely-1.0.13/shapely/.___init__.py +0 -0
  26. Shapely-1.0.13/shapely/._ctypes_declarations.py +0 -0
  27. Shapely-1.0.13/shapely/._geos.py +0 -0
  28. Shapely-1.0.13/shapely/._iterops.py +0 -0
  29. Shapely-1.0.13/shapely/._ops.py +0 -0
  30. Shapely-1.0.13/shapely/._predicates.py +0 -0
  31. Shapely-1.0.13/shapely/._topology.py +0 -0
  32. Shapely-1.0.13/shapely/._wkb.py +0 -0
  33. Shapely-1.0.13/shapely/geometry/._linestring.py +0 -0
  34. Shapely-1.0.13/tests/._Array.txt +0 -0
  35. Shapely-1.0.13/tests/._GeoInterface.txt +0 -0
  36. Shapely-1.0.13/tests/._Persist.txt +0 -0
  37. Shapely-1.0.13/tests/._Point.txt +0 -0
  38. Shapely-1.0.13/tests/._Predicates.txt +0 -0
  39. Shapely-1.0.13/tests/._binascii_hex.txt +0 -0
  40. Shapely-1.0.13/tests/._wkt_locale.txt +0 -0
  41. {Shapely-1.0.13 → Shapely-1.0.14}/CREDITS.txt +0 -0
  42. {Shapely-1.0.13 → Shapely-1.0.14}/GEOS-C-API.txt +0 -0
  43. {Shapely-1.0.13 → Shapely-1.0.14}/HISTORY.txt +0 -0
  44. {Shapely-1.0.13 → Shapely-1.0.14}/LICENSE.txt +0 -0
  45. {Shapely-1.0.13 → Shapely-1.0.14}/MANIFEST.in +0 -0
  46. {Shapely-1.0.13 → Shapely-1.0.14}/README.txt +0 -0
  47. {Shapely-1.0.13 → Shapely-1.0.14}/Shapely.egg-info/dependency_links.txt +0 -0
  48. {Shapely-1.0.13 → Shapely-1.0.14}/Shapely.egg-info/top_level.txt +0 -0
  49. {Shapely-1.0.13 → Shapely-1.0.14}/examples/geoms.py +0 -0
  50. {Shapely-1.0.13 → Shapely-1.0.14}/examples/world.py +0 -0
  51. {Shapely-1.0.13 → Shapely-1.0.14}/manual/manual.txt +0 -0
  52. {Shapely-1.0.13 → Shapely-1.0.14}/setup.cfg +0 -0
  53. {Shapely-1.0.13 → Shapely-1.0.14}/shapely/__init__.py +0 -0
  54. {Shapely-1.0.13 → Shapely-1.0.14}/shapely/geometry/__init__.py +0 -0
  55. {Shapely-1.0.13 → Shapely-1.0.14}/shapely/geometry/collection.py +0 -0
  56. {Shapely-1.0.13 → Shapely-1.0.14}/shapely/geometry/geo.py +0 -0
  57. {Shapely-1.0.13 → Shapely-1.0.14}/shapely/geometry/linestring.py +0 -0
  58. {Shapely-1.0.13 → Shapely-1.0.14}/shapely/geometry/multilinestring.py +0 -0
  59. {Shapely-1.0.13 → Shapely-1.0.14}/shapely/geometry/multipoint.py +0 -0
  60. {Shapely-1.0.13 → Shapely-1.0.14}/shapely/geometry/multipolygon.py +0 -0
  61. {Shapely-1.0.13 → Shapely-1.0.14}/shapely/geometry/point.py +0 -0
  62. {Shapely-1.0.13 → Shapely-1.0.14}/shapely/geometry/polygon.py +0 -0
  63. {Shapely-1.0.13 → Shapely-1.0.14}/shapely/geometry/proxy.py +0 -0
  64. {Shapely-1.0.13 → Shapely-1.0.14}/shapely/iterops.py +0 -0
  65. {Shapely-1.0.13 → Shapely-1.0.14}/shapely/ops.py +0 -0
  66. {Shapely-1.0.13 → Shapely-1.0.14}/shapely/predicates.py +0 -0
  67. {Shapely-1.0.13 → Shapely-1.0.14}/shapely/topology.py +0 -0
  68. {Shapely-1.0.13 → Shapely-1.0.14}/shapely/wkt.py +0 -0
  69. {Shapely-1.0.13 → Shapely-1.0.14}/tests/Array.txt +0 -0
  70. {Shapely-1.0.13 → Shapely-1.0.14}/tests/GeoInterface.txt +0 -0
  71. {Shapely-1.0.13 → Shapely-1.0.14}/tests/IterOps.txt +0 -0
  72. {Shapely-1.0.13 → Shapely-1.0.14}/tests/LineString.txt +0 -0
  73. {Shapely-1.0.13 → Shapely-1.0.14}/tests/MultiLineString.txt +0 -0
  74. {Shapely-1.0.13 → Shapely-1.0.14}/tests/MultiPoint.txt +0 -0
  75. {Shapely-1.0.13 → Shapely-1.0.14}/tests/MultiPolygon.txt +0 -0
  76. {Shapely-1.0.13 → Shapely-1.0.14}/tests/Operations.txt +0 -0
  77. {Shapely-1.0.13 → Shapely-1.0.14}/tests/Persist.txt +0 -0
  78. {Shapely-1.0.13 → Shapely-1.0.14}/tests/Point.txt +0 -0
  79. {Shapely-1.0.13 → Shapely-1.0.14}/tests/Polygon.txt +0 -0
  80. {Shapely-1.0.13 → Shapely-1.0.14}/tests/Predicates.txt +0 -0
  81. {Shapely-1.0.13 → Shapely-1.0.14}/tests/attribute-chains.txt +0 -0
  82. {Shapely-1.0.13 → Shapely-1.0.14}/tests/binascii_hex.txt +0 -0
  83. {Shapely-1.0.13 → Shapely-1.0.14}/tests/dimensions.txt +0 -0
  84. {Shapely-1.0.13 → Shapely-1.0.14}/tests/invalid_intersection.txt +0 -0
  85. {Shapely-1.0.13 → Shapely-1.0.14}/tests/polygonize.txt +0 -0
  86. {Shapely-1.0.13 → Shapely-1.0.14}/tests/wkt_locale.txt +0 -0
@@ -1,5 +1,10 @@
1
1
  All tickets are children of http://trac.gispython.org/lab/ticket.
2
2
 
3
+ 1.0.14 (2009-10-05)
4
+ -------------------
5
+ - Proper prototyping of WKB writer, and avoidance of errors on 64-bit systems
6
+ (#191).
7
+
3
8
  1.0.13 (2009-09-29)
4
9
  -------------------
5
10
  - Prototype libgeos_c functions in a way that lets py2exe apps import shapely
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.0
2
2
  Name: Shapely
3
- Version: 1.0.13
3
+ Version: 1.0.14
4
4
  Summary: Geospatial geometries, predicates, and operations
5
5
  Home-page: http://trac.gispython.org/lab/wiki/Shapely
6
6
  Author: Sean Gillies
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.0
2
2
  Name: Shapely
3
- Version: 1.0.13
3
+ Version: 1.0.14
4
4
  Summary: Geospatial geometries, predicates, and operations
5
5
  Home-page: http://trac.gispython.org/lab/wiki/Shapely
6
6
  Author: Sean Gillies
@@ -6,6 +6,7 @@ LICENSE.txt
6
6
  MANIFEST.in
7
7
  README.txt
8
8
  setup.py
9
+ setup_windows.py
9
10
  Shapely.egg-info/PKG-INFO
10
11
  Shapely.egg-info/SOURCES.txt
11
12
  Shapely.egg-info/dependency_links.txt
@@ -14,6 +15,7 @@ Shapely.egg-info/top_level.txt
14
15
  examples/geoms.py
15
16
  examples/world.py
16
17
  manual/manual.txt
18
+ manual/style.css
17
19
  shapely/__init__.py
18
20
  shapely/ctypes_declarations.py
19
21
  shapely/geos.py
@@ -46,9 +48,14 @@ tests/Persist.txt
46
48
  tests/Point.txt
47
49
  tests/Polygon.txt
48
50
  tests/Predicates.txt
51
+ tests/__init__.py
49
52
  tests/attribute-chains.txt
50
53
  tests/binascii_hex.txt
51
54
  tests/dimensions.txt
52
55
  tests/invalid_intersection.txt
53
56
  tests/polygonize.txt
57
+ tests/rungrind.dist
58
+ tests/test_doctests.py
59
+ tests/test_threads.py
60
+ tests/valgrind-python.supp
54
61
  tests/wkt_locale.txt
@@ -0,0 +1,2 @@
1
+ setuptools
2
+ ctypes
@@ -0,0 +1,231 @@
1
+ /* css */
2
+
3
+ body {
4
+ font: 90% 'Lucida Grande', Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif;
5
+ background: #ffffff;
6
+ color: black;
7
+ margin: 2em;
8
+ padding: 2em;
9
+ }
10
+
11
+ a[href] {
12
+ color: #436976;
13
+ background-color: transparent;
14
+ }
15
+
16
+ a.toc-backref {
17
+ text-decoration: none;
18
+ }
19
+
20
+ h1 a[href] {
21
+ text-decoration: none;
22
+ color: #fcb100;
23
+ background-color: transparent;
24
+ }
25
+
26
+ a.strong {
27
+ font-weight: bold;
28
+ }
29
+
30
+ img {
31
+ margin: 0;
32
+ border: 0;
33
+ }
34
+
35
+ p {
36
+ margin: 0.5em 0 1em 0;
37
+ line-height: 1.5em;
38
+ }
39
+ p a {
40
+ text-decoration: underline;
41
+ }
42
+ p a:visited {
43
+ color: purple;
44
+ background-color: transparent;
45
+ }
46
+ p a:active {
47
+ color: red;
48
+ background-color: transparent;
49
+ }
50
+ a:hover {
51
+ text-decoration: none;
52
+ }
53
+ p img {
54
+ border: 0;
55
+ margin: 0;
56
+ }
57
+
58
+ h1, h2, h3, h4, h5, h6 {
59
+ color: #003a6b;
60
+ background-color: transparent;
61
+ font: 100% 'Lucida Grande', Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif;
62
+ margin: 0;
63
+ padding-top: 0.5em;
64
+ }
65
+
66
+ h1 {
67
+ font-size: 160%;
68
+ margin-bottom: 0.5em;
69
+ border-bottom: 1px solid #fcb100;
70
+ }
71
+ h2 {
72
+ font-size: 140%;
73
+ margin-bottom: 0.5em;
74
+ border-bottom: 1px solid #aaa;
75
+ }
76
+ h3 {
77
+ font-size: 130%;
78
+ margin-bottom: 0.5em;
79
+ text-decoration: underline;
80
+ }
81
+ h4 {
82
+ font-size: 110%;
83
+ font-weight: bold;
84
+ }
85
+ h5 {
86
+ font-size: 100%;
87
+ font-weight: bold;
88
+ }
89
+ h6 {
90
+ font-size: 80%;
91
+ font-weight: bold;
92
+ }
93
+
94
+ ul a, ol a {
95
+ text-decoration: underline;
96
+ }
97
+
98
+ dt {
99
+ font-weight: bold;
100
+ }
101
+ dt a {
102
+ text-decoration: none;
103
+ }
104
+
105
+ dd {
106
+ line-height: 1.5em;
107
+ margin-bottom: 1em;
108
+ }
109
+
110
+ legend {
111
+ background: #ffffff;
112
+ padding: 0.5em;
113
+ }
114
+
115
+ form {
116
+ margin: 0;
117
+ }
118
+
119
+
120
+ dl.form {
121
+ margin: 0;
122
+ padding: 1em;
123
+ }
124
+
125
+ dl.form dt {
126
+ width: 30%;
127
+ float: left;
128
+ margin: 0;
129
+ padding: 0 0.5em 0.5em 0;
130
+ text-align: right;
131
+ }
132
+
133
+ input {
134
+ font: 100% 'Lucida Grande', Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif;
135
+ color: black;
136
+ background-color: white;
137
+ vertical-align: middle;
138
+ }
139
+
140
+ abbr, acronym, .explain {
141
+ color: black;
142
+ background-color: transparent;
143
+ }
144
+
145
+ q, blockquote {
146
+ }
147
+
148
+ code, pre {
149
+ font-family: monospace;
150
+ font-size: 1.2em;
151
+ display: block;
152
+ padding: 10px;
153
+ border: 1px solid #838183;
154
+ background-color: #eee;
155
+ color: #000;
156
+ overflow: auto;
157
+ margin: 0.5em 1em;
158
+ }
159
+
160
+ tt.docutils {
161
+ background-color: #eeeeee;
162
+ }
163
+
164
+ .docinfo {
165
+ text-align: left;
166
+ }
167
+
168
+ div.highlight {
169
+ margin-left: 2em ;
170
+ margin-right: 2em ;
171
+ background-color: #eeeeee
172
+ }
173
+
174
+ .c { color: #008800; font-style: italic } /* Comment */
175
+ .err { border: 1px solid #FF0000 } /* Error */
176
+ .k { color: #AA22FF; font-weight: bold } /* Keyword */
177
+ .o { color: #666666 } /* Operator */
178
+ .cm { color: #008800; font-style: italic } /* Comment.Multiline */
179
+ .cp { color: #008800 } /* Comment.Preproc */
180
+ .c1 { color: #008800; font-style: italic } /* Comment.Single */
181
+ .gd { color: #A00000 } /* Generic.Deleted */
182
+ .ge { font-style: italic } /* Generic.Emph */
183
+ .gr { color: #FF0000 } /* Generic.Error */
184
+ .gh { color: #000080; font-weight: bold } /* Generic.Heading */
185
+ .gi { color: #00A000 } /* Generic.Inserted */
186
+ .go { color: #808080 } /* Generic.Output */
187
+ .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
188
+ .gs { font-weight: bold } /* Generic.Strong */
189
+ .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
190
+ .gt { color: #0040D0 } /* Generic.Traceback */
191
+ .kc { color: #AA22FF; font-weight: bold } /* Keyword.Constant */
192
+ .kd { color: #AA22FF; font-weight: bold } /* Keyword.Declaration */
193
+ .kp { color: #AA22FF } /* Keyword.Pseudo */
194
+ .kr { color: #AA22FF; font-weight: bold } /* Keyword.Reserved */
195
+ .kt { color: #AA22FF; font-weight: bold } /* Keyword.Type */
196
+ .m { color: #666666 } /* Literal.Number */
197
+ .s { color: #BB4444 } /* Literal.String */
198
+ .na { color: #BB4444 } /* Name.Attribute */
199
+ .nb { color: #AA22FF } /* Name.Builtin */
200
+ .nc { color: #0000FF } /* Name.Class */
201
+ .no { color: #880000 } /* Name.Constant */
202
+ .nd { color: #AA22FF } /* Name.Decorator */
203
+ .ni { color: #999999; font-weight: bold } /* Name.Entity */
204
+ .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
205
+ .nf { color: #00A000 } /* Name.Function */
206
+ .nl { color: #A0A000 } /* Name.Label */
207
+ .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
208
+ .nt { color: #008000; font-weight: bold } /* Name.Tag */
209
+ .nv { color: #B8860B } /* Name.Variable */
210
+ .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
211
+ .mf { color: #666666 } /* Literal.Number.Float */
212
+ .mh { color: #666666 } /* Literal.Number.Hex */
213
+ .mi { color: #666666 } /* Literal.Number.Integer */
214
+ .mo { color: #666666 } /* Literal.Number.Oct */
215
+ .sb { color: #BB4444 } /* Literal.String.Backtick */
216
+ .sc { color: #BB4444 } /* Literal.String.Char */
217
+ .sd { color: #BB4444; font-style: italic } /* Literal.String.Doc */
218
+ .s2 { color: #BB4444 } /* Literal.String.Double */
219
+ .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
220
+ .sh { color: #BB4444 } /* Literal.String.Heredoc */
221
+ .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
222
+ .sx { color: #008000 } /* Literal.String.Other */
223
+ .sr { color: #BB6688 } /* Literal.String.Regex */
224
+ .s1 { color: #BB4444 } /* Literal.String.Single */
225
+ .ss { color: #B8860B } /* Literal.String.Symbol */
226
+ .bp { color: #AA22FF } /* Name.Builtin.Pseudo */
227
+ .vc { color: #B8860B } /* Name.Variable.Class */
228
+ .vg { color: #B8860B } /* Name.Variable.Global */
229
+ .vi { color: #B8860B } /* Name.Variable.Instance */
230
+ .il { color: #666666 } /* Literal.Number.Integer.Long */
231
+
@@ -10,7 +10,7 @@ if version_info[:2] < (2,5):
10
10
  readme_text = file('README.txt', 'rb').read()
11
11
 
12
12
  setup(name = 'Shapely',
13
- version = '1.0.13',
13
+ version = '1.0.14',
14
14
  description = 'Geospatial geometries, predicates, and operations',
15
15
  license = 'BSD',
16
16
  keywords = 'geometry topology',
@@ -0,0 +1,37 @@
1
+ from setuptools import setup, Extension
2
+ from sys import version_info
3
+
4
+ # Require ctypes egg only for Python < 2.5
5
+ install_requires = ['setuptools']
6
+ if version_info[:2] < (2,5):
7
+ install_requires.append('ctypes')
8
+
9
+ # Get text from README.txt
10
+ readme_text = file('README.txt', 'rb').read()
11
+
12
+ setup(name = 'Shapely',
13
+ version = '1.0.14',
14
+ description = 'Geospatial geometries, predicates, and operations',
15
+ license = 'BSD',
16
+ keywords = 'geometry topology',
17
+ author = 'Sean Gillies',
18
+ author_email = 'sgillies@frii.com',
19
+ maintainer = 'Sean Gillies',
20
+ maintainer_email = 'sgillies@frii.com',
21
+ url = 'http://trac.gispython.org/lab/wiki/Shapely',
22
+ long_description = readme_text,
23
+ packages = ['shapely', 'shapely.geometry'],
24
+ data_files=[('DLLs', ['DLLs/geos.dll', 'DLLs/libgeos-3-0-0.dll']),],
25
+ install_requires = install_requires,
26
+ #tests_require = ['numpy'], -- not working with "tests" command
27
+ test_suite = 'tests.test_suite',
28
+ classifiers = [
29
+ 'Development Status :: 5 - Production/Stable',
30
+ 'Intended Audience :: Developers',
31
+ 'Intended Audience :: Science/Research',
32
+ 'License :: OSI Approved :: BSD License',
33
+ 'Operating System :: OS Independent',
34
+ 'Programming Language :: Python',
35
+ 'Topic :: Scientific/Engineering :: GIS',
36
+ ],
37
+ )
@@ -23,6 +23,10 @@ def prototype(lgeos):
23
23
  lgeos.GEOSGeomFromWKB_buf.restype = ctypes.c_void_p
24
24
  lgeos.GEOSGeomFromWKB_buf.argtypes = [ctypes.c_void_p, ctypes.c_size_t]
25
25
 
26
+ lgeos.GEOSGeomToWKB_buf.restype = ctypes.c_void_p
27
+ lgeos.GEOSGeomToWKB_buf.argtypes = [ctypes.c_void_p , ctypes.POINTER(ctypes.c_size_t)]
28
+
29
+
26
30
  lgeos.GEOSCoordSeq_create.restype = ctypes.c_void_p
27
31
  lgeos.GEOSCoordSeq_create.argtypes = [ctypes.c_uint, ctypes.c_uint]
28
32
 
@@ -2,7 +2,7 @@
2
2
  Base geometry class and utilities.
3
3
  """
4
4
 
5
- from ctypes import string_at, byref, c_int, c_size_t, c_char_p, c_double
5
+ from ctypes import string_at, byref, c_int, c_size_t, c_char_p, c_double, c_void_p
6
6
  import sys
7
7
 
8
8
  from shapely.geos import lgeos, free, allocated_c_char_p
@@ -349,13 +349,14 @@ class BaseGeometry(object):
349
349
  def to_wkb(self):
350
350
  """Returns a WKB byte string representation of the geometry."""
351
351
  func = lgeos.GEOSGeomToWKB_buf
352
- size = c_int()
352
+ size = c_size_t()
353
353
  def errcheck(result, func, argtuple):
354
+ if not result: return None
354
355
  retval = string_at(result, size.value)[:]
355
356
  free(result)
356
357
  return retval
357
358
  func.errcheck = errcheck
358
- return func(self._geom, byref(size))
359
+ return func(c_void_p(self._geom), byref(size))
359
360
 
360
361
  @exceptNull
361
362
  def to_wkt(self):
@@ -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, PyDLL, CFUNCTYPE, c_char_p
6
+ from ctypes import cdll, CDLL, PyDLL, CFUNCTYPE, c_char_p, c_void_p
7
7
  from ctypes.util import find_library
8
8
  import os
9
9
  import sys
@@ -43,6 +43,8 @@ elif sys.platform == 'darwin':
43
43
  raise ImportError, "Could not find geos_c library"
44
44
  lgeos = PyDLL(lib)
45
45
  free = CDLL(find_library('libc')).free
46
+ free.argtypes=[c_void_p]
47
+ free.restype=None
46
48
  else:
47
49
  # Try the major versioned name first, falling back on the unversioned name.
48
50
  try:
@@ -52,6 +54,8 @@ else:
52
54
  except:
53
55
  raise
54
56
  free = CDLL('libc.so.6').free
57
+ free.argtypes=[c_void_p]
58
+ free.restype=None
55
59
 
56
60
  # Prototype the libgeos_c functions using new code from `tarley` in
57
61
  # http://trac.gispython.org/lab/ticket/189
@@ -3,6 +3,7 @@ Load/dump geometries using the well-known binary (WKB) format.
3
3
  """
4
4
 
5
5
  from ctypes import byref, c_int, c_size_t, c_char_p, string_at
6
+ from ctypes import c_void_p, c_size_t
6
7
 
7
8
  from shapely.geos import lgeos, free, ReadingError
8
9
  from shapely.geometry.base import geom_factory
@@ -26,13 +27,14 @@ def load(fp):
26
27
  def dumps(ob):
27
28
  """Dump a WKB representation of a geometry to a byte string."""
28
29
  func = lgeos.GEOSGeomToWKB_buf
29
- size = c_int()
30
+ size = c_size_t()
30
31
  def errcheck(result, func, argtuple):
32
+ if not result: return None
31
33
  retval = string_at(result, size.value)[:]
32
34
  free(result)
33
35
  return retval
34
36
  func.errcheck = errcheck
35
- return func(ob._geom, byref(size))
37
+ return func(c_void_p(ob._geom), byref(size))
36
38
 
37
39
  def dump(ob, fp):
38
40
  """Dump a geometry to an open file."""
@@ -0,0 +1,2 @@
1
+ # package
2
+ from test_doctests import test_suite
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ #export PYTHONPATH=YOUR_CUSTOM_PATH
3
+ valgrind --tool=memcheck --leak-check=yes --suppressions=valgrind-python.supp python test_doctests.py
4
+
@@ -0,0 +1,35 @@
1
+ import doctest
2
+ import unittest
3
+ import glob
4
+ import os
5
+
6
+ optionflags = (doctest.REPORT_ONLY_FIRST_FAILURE |
7
+ doctest.NORMALIZE_WHITESPACE |
8
+ doctest.ELLIPSIS)
9
+
10
+ def list_doctests():
11
+ print __file__
12
+ return [filename
13
+ for filename
14
+ in glob.glob(os.path.join(os.path.dirname(__file__), '*.txt'))]
15
+
16
+ def open_file(filename, mode='r'):
17
+ """Helper function to open files from within the tests package."""
18
+ return open(os.path.join(os.path.dirname(__file__), filename), mode)
19
+
20
+ def setUp(test):
21
+ test.globs.update(dict(
22
+ open_file = open_file,
23
+ ))
24
+
25
+ def test_suite():
26
+ return unittest.TestSuite(
27
+ [doctest.DocFileSuite(os.path.basename(filename),
28
+ optionflags=optionflags,
29
+ setUp=setUp)
30
+ for filename
31
+ in list_doctests()])
32
+
33
+ if __name__ == "__main__":
34
+ runner = unittest.TextTestRunner(verbosity=1)
35
+ runner.run(test_suite())
@@ -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
+
@@ -0,0 +1,240 @@
1
+ #
2
+ # This is a valgrind suppression file that should be used when using valgrind.
3
+ #
4
+ # Here's an example of running valgrind:
5
+ #
6
+ # cd python/dist/src
7
+ # valgrind --tool=memcheck --suppressions=Misc/valgrind-python.supp \
8
+ # ./python -E -tt ./Lib/test/regrtest.py -u bsddb,network
9
+ #
10
+ # You must edit Objects/obmalloc.c and uncomment Py_USING_MEMORY_DEBUGGER
11
+ # to use the preferred suppressions with Py_ADDRESS_IN_RANGE.
12
+ #
13
+ # If you do not want to recompile Python, you can uncomment
14
+ # suppressions for PyObject_Free and PyObject_Realloc.
15
+ #
16
+ # See Misc/README.valgrind for more information.
17
+
18
+ # all tool names: Addrcheck,Memcheck,cachegrind,helgrind,massif
19
+ {
20
+ ADDRESS_IN_RANGE/Invalid read of size 4
21
+ Memcheck:Addr4
22
+ fun:Py_ADDRESS_IN_RANGE
23
+ }
24
+
25
+ {
26
+ ADDRESS_IN_RANGE/Invalid read of size 4
27
+ Memcheck:Value4
28
+ fun:Py_ADDRESS_IN_RANGE
29
+ }
30
+
31
+ {
32
+ ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value
33
+ Memcheck:Cond
34
+ fun:Py_ADDRESS_IN_RANGE
35
+ }
36
+
37
+ {
38
+ ADDRESS_IN_RANGE/Invalid read of size 4
39
+ Memcheck:Addr4
40
+ fun:PyObject_Free
41
+ }
42
+
43
+ {
44
+ ADDRESS_IN_RANGE/Invalid read of size 4
45
+ Memcheck:Value4
46
+ fun:PyObject_Free
47
+ }
48
+
49
+ {
50
+ ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value
51
+ Memcheck:Cond
52
+ fun:PyObject_Free
53
+ }
54
+
55
+ {
56
+ ADDRESS_IN_RANGE/Invalid read of size 4
57
+ Memcheck:Addr4
58
+ fun:PyObject_Realloc
59
+ }
60
+
61
+ {
62
+ ADDRESS_IN_RANGE/Invalid read of size 4
63
+ Memcheck:Value4
64
+ fun:PyObject_Realloc
65
+ }
66
+
67
+ {
68
+ ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value
69
+ Memcheck:Cond
70
+ fun:PyObject_Realloc
71
+ }
72
+
73
+ ###
74
+ ### All the suppressions below are for errors that occur within libraries
75
+ ### that Python uses. The problems to not appear to be related to Python's
76
+ ### use of the libraries.
77
+ ###
78
+ {
79
+ GDBM problems, see test_gdbm
80
+ Memcheck:Param
81
+ write(buf)
82
+ fun:write
83
+ fun:gdbm_open
84
+
85
+ }
86
+
87
+ ###
88
+ ### These occur from somewhere within the SSL, when running
89
+ ### test_socket_sll. They are too general to leave on by default.
90
+ ###
91
+ ###{
92
+ ### somewhere in SSL stuff
93
+ ### Memcheck:Cond
94
+ ### fun:memset
95
+ ###}
96
+ ###{
97
+ ### somewhere in SSL stuff
98
+ ### Memcheck:Value4
99
+ ### fun:memset
100
+ ###}
101
+ ###
102
+ ###{
103
+ ### somewhere in SSL stuff
104
+ ### Memcheck:Cond
105
+ ### fun:MD5_Update
106
+ ###}
107
+ ###
108
+ ###{
109
+ ### somewhere in SSL stuff
110
+ ### Memcheck:Value4
111
+ ### fun:MD5_Update
112
+ ###}
113
+
114
+ #
115
+ # All of these problems come from using test_socket_ssl
116
+ #
117
+ {
118
+ from test_socket_ssl
119
+ Memcheck:Cond
120
+ fun:BN_bin2bn
121
+ }
122
+
123
+ {
124
+ from test_socket_ssl
125
+ Memcheck:Cond
126
+ fun:BN_num_bits_word
127
+ }
128
+
129
+ {
130
+ from test_socket_ssl
131
+ Memcheck:Value4
132
+ fun:BN_num_bits_word
133
+ }
134
+
135
+ {
136
+ from test_socket_ssl
137
+ Memcheck:Cond
138
+ fun:BN_mod_exp_mont_word
139
+ }
140
+
141
+ {
142
+ from test_socket_ssl
143
+ Memcheck:Cond
144
+ fun:BN_mod_exp_mont
145
+ }
146
+
147
+ {
148
+ from test_socket_ssl
149
+ Memcheck:Param
150
+ write(buf)
151
+ fun:write
152
+ obj:/usr/lib/libcrypto.so.0.9.7
153
+ }
154
+
155
+ {
156
+ from test_socket_ssl
157
+ Memcheck:Cond
158
+ fun:RSA_verify
159
+ }
160
+
161
+ {
162
+ from test_socket_ssl
163
+ Memcheck:Value4
164
+ fun:RSA_verify
165
+ }
166
+
167
+ {
168
+ from test_socket_ssl
169
+ Memcheck:Value4
170
+ fun:DES_set_key_unchecked
171
+ }
172
+
173
+ {
174
+ from test_socket_ssl
175
+ Memcheck:Value4
176
+ fun:DES_encrypt2
177
+ }
178
+
179
+ {
180
+ from test_socket_ssl
181
+ Memcheck:Cond
182
+ obj:/usr/lib/libssl.so.0.9.7
183
+ }
184
+
185
+ {
186
+ from test_socket_ssl
187
+ Memcheck:Value4
188
+ obj:/usr/lib/libssl.so.0.9.7
189
+ }
190
+
191
+ {
192
+ from test_socket_ssl
193
+ Memcheck:Cond
194
+ fun:BUF_MEM_grow_clean
195
+ }
196
+
197
+ {
198
+ from test_socket_ssl
199
+ Memcheck:Cond
200
+ fun:memcpy
201
+ fun:ssl3_read_bytes
202
+ }
203
+
204
+ {
205
+ from test_socket_ssl
206
+ Memcheck:Cond
207
+ fun:SHA1_Update
208
+ }
209
+
210
+ {
211
+ from test_socket_ssl
212
+ Memcheck:Value4
213
+ fun:SHA1_Update
214
+ }
215
+
216
+
217
+ # some extra lxml specific (?) suppressions..
218
+
219
+ {
220
+ Test
221
+ Memcheck:Param
222
+ sigaction(act)
223
+ fun:__libc_sigaction
224
+ }
225
+
226
+ {
227
+ ld
228
+ Memcheck:Cond
229
+ obj:/lib/ld-2.6.so
230
+ obj:/lib/ld-2.6.so
231
+ obj:*
232
+ }
233
+
234
+ {
235
+ ld
236
+ Memcheck:Addr4
237
+ obj:/lib/ld-2.6.so
238
+ obj:/lib/ld-2.6.so
239
+ obj:*
240
+ }
Binary file
Binary file
Binary file
Binary file
Binary file
Shapely-1.0.13/._setup.py DELETED
Binary file
@@ -1 +0,0 @@
1
- setuptools
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
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