ffi-geos 1.2.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +5 -5
  2. data/.rubocop.yml +20 -0
  3. data/.travis.yml +7 -3
  4. data/Gemfile +1 -1
  5. data/Guardfile +4 -5
  6. data/ffi-geos.gemspec +1 -1
  7. data/lib/ffi-geos.rb +212 -196
  8. data/lib/ffi-geos/buffer_params.rb +9 -20
  9. data/lib/ffi-geos/coordinate_sequence.rb +342 -58
  10. data/lib/ffi-geos/geometry.rb +167 -178
  11. data/lib/ffi-geos/geometry_collection.rb +60 -12
  12. data/lib/ffi-geos/interrupt.rb +2 -4
  13. data/lib/ffi-geos/line_string.rb +146 -37
  14. data/lib/ffi-geos/linear_ring.rb +2 -3
  15. data/lib/ffi-geos/multi_line_string.rb +1 -2
  16. data/lib/ffi-geos/multi_point.rb +0 -1
  17. data/lib/ffi-geos/multi_polygon.rb +0 -1
  18. data/lib/ffi-geos/point.rb +69 -14
  19. data/lib/ffi-geos/polygon.rb +110 -21
  20. data/lib/ffi-geos/prepared_geometry.rb +11 -12
  21. data/lib/ffi-geos/strtree.rb +41 -52
  22. data/lib/ffi-geos/tools.rb +15 -18
  23. data/lib/ffi-geos/utils.rb +27 -44
  24. data/lib/ffi-geos/version.rb +1 -3
  25. data/lib/ffi-geos/wkb_reader.rb +4 -9
  26. data/lib/ffi-geos/wkb_writer.rb +14 -18
  27. data/lib/ffi-geos/wkt_reader.rb +2 -5
  28. data/lib/ffi-geos/wkt_writer.rb +17 -22
  29. data/test/.rubocop.yml +36 -0
  30. data/test/coordinate_sequence_tests.rb +263 -14
  31. data/test/geometry_collection_tests.rb +412 -1
  32. data/test/geometry_tests.rb +156 -86
  33. data/test/interrupt_tests.rb +2 -4
  34. data/test/line_string_tests.rb +212 -23
  35. data/test/linear_ring_tests.rb +1 -2
  36. data/test/misc_tests.rb +28 -29
  37. data/test/multi_line_string_tests.rb +0 -1
  38. data/test/point_tests.rb +158 -1
  39. data/test/polygon_tests.rb +284 -1
  40. data/test/prepared_geometry_tests.rb +1 -3
  41. data/test/strtree_tests.rb +9 -10
  42. data/test/test_helper.rb +49 -18
  43. data/test/tools_tests.rb +1 -3
  44. data/test/utils_tests.rb +22 -22
  45. data/test/wkb_reader_tests.rb +10 -9
  46. data/test/wkb_writer_tests.rb +5 -13
  47. data/test/wkt_reader_tests.rb +1 -2
  48. data/test/wkt_writer_tests.rb +9 -14
  49. metadata +6 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: e79b38a9334971a33360b04626fd41a3d6412b5e
4
- data.tar.gz: b8b363a4e8ce75fa6162f5e92abbd84c086cd3a9
2
+ SHA256:
3
+ metadata.gz: 0dd0041bd8bab6e1b13bf7fcc48e63ce4764552943719ab964a2f3aa22cbb942
4
+ data.tar.gz: fe36ddabfc21c8c0f99baf872c67618628b6c75935d215e527f19cc47397a126
5
5
  SHA512:
6
- metadata.gz: e74ad87eaedb4ff6bc39d45916eccf141275e09fc9023eb0beb6d36a8fff8e3f5234f7c4bc81496c3bc0b55a3ba91e0eafc44beeba488637f55b5735cc4f06e7
7
- data.tar.gz: a5ead93de53c8cbf16798374dea3ad303c3ce00f6d457bef061daec91c7c36890e2e1fa121da58d4a4fd647c9e0fa7491634e751110798f2ce61bdd839413868
6
+ metadata.gz: bb3cbfe068e624a6c2edbb1384b16c7ed95958077a6016c27ec9b28b8cb3bce70929dd087475f9aabbe0962d25496ce1a6545121fcb3bcfa1435e40b1c45ab75
7
+ data.tar.gz: 78460d3a705c113c52dd1f8df9dc9f7b34578b7d9c8b3d5e0de448bd26a16e7ed7256e2bc17d3f29ec17f565515d7a9b3e012d26c118f4adb41a84a54e0f989e
@@ -0,0 +1,20 @@
1
+
2
+ AllCops:
3
+ TargetRubyVersion: 2.4
4
+
5
+ Style/PercentLiteralDelimiters:
6
+ PreferredDelimiters:
7
+ '%': '{}'
8
+ '%i': '{}'
9
+ '%q': '{}'
10
+ '%Q': '{}'
11
+ '%r': '{}'
12
+ '%s': '{}'
13
+ '%w': '{}'
14
+ '%W': '{}'
15
+ '%x': '{}'
16
+
17
+ Metrics/LineLength:
18
+ Description: 'Limit lines to 80 characters.'
19
+ StyleGuide: '#80-character-limits'
20
+ Enabled: false
@@ -2,9 +2,10 @@ cache: bundler
2
2
  sudo: false
3
3
  language: ruby
4
4
  rvm:
5
- - 2.4.2
6
- - 2.3.5
7
- - 2.2.8
5
+ - 2.5.3
6
+ - 2.4.5
7
+ - 2.3.8
8
+ - 2.2.10
8
9
  - rbx-3
9
10
  - jruby-head
10
11
  matrix:
@@ -15,3 +16,6 @@ addons:
15
16
  apt:
16
17
  packages:
17
18
  - libgeos-c1
19
+ before_install:
20
+ - gem update --system
21
+ - gem install bundler
data/Gemfile CHANGED
@@ -18,6 +18,6 @@ if RUBY_VERSION >= '1.9'
18
18
  gem 'simplecov'
19
19
  end
20
20
 
21
- if File.exists?('Gemfile.local')
21
+ if File.exist?('Gemfile.local')
22
22
  instance_eval File.read('Gemfile.local')
23
23
  end
data/Guardfile CHANGED
@@ -1,17 +1,16 @@
1
1
 
2
- guard 'minitest', :test_folders => 'test', :test_file_patterns => '*_tests.rb' do
2
+ guard 'minitest', test_folders: 'test', test_file_patterns: '*_tests.rb' do
3
3
  watch(%r|^test/(.+)_tests\.rb|)
4
4
 
5
5
  watch(%r{^lib/(.*/)?([^/]+)\.rb$}) do |m|
6
6
  "test/#{m[2]}_tests.rb"
7
7
  end
8
8
 
9
- watch(%r|^test/test_helper\.rb|) do
10
- "test"
9
+ watch(%r{^test/test_helper\.rb}) do
10
+ 'test'
11
11
  end
12
12
  end
13
13
 
14
- if File.exists?('Guardfile.local')
14
+ if File.exist?('Guardfile.local')
15
15
  instance_eval File.read('Guardfile.local')
16
16
  end
17
-
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
15
15
  s.extra_rdoc_files = [
16
16
  'README.rdoc'
17
17
  ]
18
- s.files = `git ls-files`.split($\)
18
+ s.files = `git ls-files`.split($OUTPUT_RECORD_SEPARATOR)
19
19
  s.executables = s.files.grep(%r{^bin/}).map { |f| File.basename(f) }
20
20
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
21
21
  s.homepage = 'http://github.com/dark-panda/ffi-geos'
@@ -1,4 +1,3 @@
1
- # encoding: UTF-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  require 'ffi'
@@ -82,7 +81,7 @@ module Geos
82
81
  # For backwards compatibility with older ffi-geos versions where this
83
82
  # used to return an Array.
84
83
  def self.geos_library_paths
85
- [ self.geos_library_path ]
84
+ [ geos_library_path ]
86
85
  end
87
86
 
88
87
  extend ::FFI::Library
@@ -147,7 +146,7 @@ module Geos
147
146
  # Initialization and cleanup
148
147
 
149
148
  # deprecated in GEOS 3.5.0+
150
- :initGEOS_r => [
149
+ initGEOS_r: [
151
150
  :pointer,
152
151
 
153
152
  # notice callback
@@ -157,886 +156,900 @@ module Geos
157
156
  callback([ :string, :string ], :void)
158
157
  ],
159
158
 
160
- :finishGEOS_r => [
159
+ finishGEOS_r: [
161
160
  # void, *handle
162
161
  :void, :pointer
163
162
  ],
164
163
  # / deprecated in GEOS 3.5.0+
165
164
 
166
165
  # GEOS 3.5.0+
167
- :GEOS_init_r => [ :pointer ],
166
+ GEOS_init_r: [ :pointer ],
168
167
 
169
- :GEOSContext_setNoticeMessageHandler_r => [
168
+ GEOSContext_setNoticeMessageHandler_r: [
170
169
  # void, *handle, callback, *void
171
170
  :void, :pointer, callback([ :string, :string ], :void), :pointer
172
171
  ],
173
172
 
174
- :GEOSContext_setErrorMessageHandler_r => [
173
+ GEOSContext_setErrorMessageHandler_r: [
175
174
  # void, *handle, callback, *void
176
175
  :void, :pointer, callback([ :string, :string ], :void), :pointer
177
176
  ],
178
177
 
179
- :GEOS_finish_r => [
178
+ GEOS_finish_r: [
180
179
  # void, *handle
181
180
  :void, :pointer
182
181
  ],
183
182
  # / GEOS 3.5.0+
184
183
 
185
- :GEOS_interruptRegisterCallback => [
184
+ GEOS_interruptRegisterCallback: [
186
185
  :pointer,
187
186
  callback([], :void)
188
187
  ],
189
188
 
190
- :GEOS_interruptRequest => [
189
+ GEOS_interruptRequest: [
191
190
  :void
192
191
  ],
193
192
 
194
- :GEOS_interruptCancel => [
193
+ GEOS_interruptCancel: [
195
194
  :void
196
195
  ],
197
196
 
198
- :GEOSversion => [
197
+ GEOSversion: [
199
198
  :string
200
199
  ],
201
200
 
202
- :GEOSjtsport => [
201
+ GEOSjtsport: [
203
202
  :string
204
203
  ],
205
204
 
206
- :GEOSPolygonize_r => [
205
+ GEOSPolygonize_r: [
207
206
  # *geom, *handle, **geoms, ngeoms
208
207
  :pointer, :pointer, :pointer, :uint
209
208
  ],
210
209
 
211
- :GEOSPolygonizer_getCutEdges_r => [
210
+ GEOSPolygonizer_getCutEdges_r: [
212
211
  # *geom, *handle, **geoms, ngeoms
213
212
  :pointer, :pointer, :pointer, :uint
214
213
  ],
215
214
 
216
- :GEOSPolygonize_full_r => [
215
+ GEOSPolygonize_full_r: [
217
216
  # *geom, *handle, *geom, **cuts, **dangles, **invalid
218
217
  :pointer, :pointer, :pointer, :pointer, :pointer, :pointer
219
218
  ],
220
219
 
221
- :GEOSGeom_createPoint_r => [
220
+ GEOSGeom_createPoint_r: [
222
221
  # *geom, *handle, *coord_seq
223
222
  :pointer, :pointer, :pointer
224
223
  ],
225
224
 
226
- :GEOSGeom_createEmptyPoint_r => [
225
+ GEOSGeom_createEmptyPoint_r: [
227
226
  # *geom, *handle
228
227
  :pointer, :pointer
229
228
  ],
230
229
 
231
- :GEOSGeom_createEmptyLineString_r => [
230
+ GEOSGeom_createEmptyLineString_r: [
232
231
  # *geom, *handle
233
232
  :pointer, :pointer
234
233
  ],
235
234
 
236
- :GEOSGeom_createLinearRing_r => [
235
+ GEOSGeom_createLinearRing_r: [
237
236
  # *geom, *handle, *coord_seq
238
237
  :pointer, :pointer, :pointer
239
238
  ],
240
239
 
241
- :GEOSGeom_createLineString_r => [
240
+ GEOSGeom_createLineString_r: [
242
241
  # *geom, *handle, *coord_seq
243
242
  :pointer, :pointer, :pointer
244
243
  ],
245
244
 
246
- :GEOSGeom_createPolygon_r => [
245
+ GEOSGeom_createPolygon_r: [
247
246
  # *geom, *handle, *geom, **holes, nholes
248
247
  :pointer, :pointer, :pointer, :pointer, :uint
249
248
  ],
250
249
 
251
- :GEOSGeom_createEmptyPolygon_r => [
250
+ GEOSGeom_createEmptyPolygon_r: [
252
251
  # *geom, *handle
253
252
  :pointer, :pointer
254
253
  ],
255
254
 
256
- :GEOSGeom_createCollection_r => [
255
+ GEOSGeom_createCollection_r: [
257
256
  # *geom, *handle, type, **geoms, ngeoms
258
257
  :pointer, :pointer, :geometry_type, :pointer, :uint
259
258
  ],
260
259
 
261
- :GEOSGeom_createEmptyCollection_r => [
260
+ GEOSGeom_createEmptyCollection_r: [
262
261
  # *geom, *handle, type
263
262
  :pointer, :pointer, :geometry_type
264
263
  ],
265
264
  #### /Utility functions ####
266
265
 
267
266
  #### CoordinateSequence functions ####
268
- :GEOSCoordSeq_create_r => [
267
+ GEOSCoordSeq_create_r: [
269
268
  # *coord_seq, *handle, size, dims
270
269
  :pointer, :pointer, :uint, :uint
271
270
  ],
272
271
 
273
- :GEOSCoordSeq_destroy_r => [
272
+ GEOSCoordSeq_destroy_r: [
274
273
  # void, *handle, *coord_seq
275
274
  :void, :pointer, :pointer
276
275
  ],
277
276
 
278
- :GEOSCoordSeq_clone_r => [
277
+ GEOSCoordSeq_clone_r: [
279
278
  # *coord_seq, *handle, *coord_seq
280
279
  :pointer, :pointer, :pointer
281
280
  ],
282
281
 
283
- :GEOSCoordSeq_setX_r => [
282
+ GEOSCoordSeq_setX_r: [
284
283
  # 0 on exception, *handle, *coord_seq, idx, val
285
284
  :int, :pointer, :pointer, :uint, :double
286
285
  ],
287
286
 
288
- :GEOSCoordSeq_setY_r => [
287
+ GEOSCoordSeq_setY_r: [
289
288
  # 0 on exception, *handle, *coord_seq, idx, val
290
289
  :int, :pointer, :pointer, :uint, :double
291
290
  ],
292
291
 
293
- :GEOSCoordSeq_setZ_r => [
292
+ GEOSCoordSeq_setZ_r: [
294
293
  # 0 on exception, *handle, *coord_seq, idx, val
295
294
  :int, :pointer, :pointer, :uint, :double
296
295
  ],
297
296
 
298
- :GEOSCoordSeq_setOrdinate_r => [
297
+ GEOSCoordSeq_setOrdinate_r: [
299
298
  # 0 on exception, *handle, *coord_seq, idx, dim, val
300
299
  :int, :pointer, :pointer, :uint, :uint, :double
301
300
  ],
302
301
 
303
- :GEOSCoordSeq_getX_r => [
302
+ GEOSCoordSeq_getX_r: [
304
303
  # 0 on exception, *handle, *coord_seq, idx, (double *) val
305
304
  :int, :pointer, :pointer, :uint, :pointer
306
305
  ],
307
306
 
308
- :GEOSCoordSeq_getY_r => [
307
+ GEOSCoordSeq_getY_r: [
309
308
  # 0 on exception, *handle, *coord_seq, idx, (double *) val
310
309
  :int, :pointer, :pointer, :uint, :pointer
311
310
  ],
312
311
 
313
- :GEOSCoordSeq_getZ_r => [
312
+ GEOSCoordSeq_getZ_r: [
314
313
  # 0 on exception, *handle, *coord_seq, idx, (double *) val
315
314
  :int, :pointer, :pointer, :uint, :pointer
316
315
  ],
317
316
 
318
- :GEOSCoordSeq_getOrdinate_r => [
317
+ GEOSCoordSeq_getOrdinate_r: [
319
318
  # 0 on exception, *handle, *coord_seq, idx, dim, (double *) val
320
319
  :int, :pointer, :pointer, :uint, :uint, :pointer
321
320
  ],
322
321
 
323
- :GEOSCoordSeq_getSize_r => [
322
+ GEOSCoordSeq_getSize_r: [
324
323
  # 0 on exception, *handle, *coord_seq, (uint *) size
325
324
  :int, :pointer, :pointer, :pointer
326
325
  ],
327
326
 
328
- :GEOSCoordSeq_getDimensions_r => [
327
+ GEOSCoordSeq_getDimensions_r: [
329
328
  # 0 on exception, *handle, *coord_seq, (uint *) size
330
329
  :int, :pointer, :pointer, :pointer
331
330
  ],
332
331
  #### /CoordinateSequence functions ####
333
332
 
334
333
  #### Geometry functions ####
335
- :GEOSGeom_destroy_r => [
334
+ GEOSGeom_destroy_r: [
336
335
  # void, *handle, *geom
337
336
  :void, :pointer, :pointer
338
337
  ],
339
338
 
340
- :GEOSGeom_clone_r => [
339
+ GEOSGeom_clone_r: [
341
340
  # *geom, *handle, *geom
342
341
  :pointer, :pointer, :pointer
343
342
  ],
344
343
 
345
- :GEOSGeomTypeId_r => [
344
+ GEOSGeomTypeId_r: [
346
345
  # type, *handle, *geom
347
346
  :int, :pointer, :pointer
348
347
  ],
349
348
 
350
- :GEOSGeomType_r => [
349
+ GEOSGeomType_r: [
351
350
  # type, *handle, *geom
352
351
  :string, :pointer, :pointer
353
352
  ],
354
353
 
355
- :GEOSGetSRID_r => [
354
+ GEOSGetSRID_r: [
356
355
  # srid, *handle, *geom
357
356
  :int, :pointer, :pointer
358
357
  ],
359
358
 
360
- :GEOSSetSRID_r => [
359
+ GEOSSetSRID_r: [
361
360
  # void, *handle, *geom, srid
362
361
  :void, :pointer, :pointer, :int
363
362
  ],
364
363
 
365
- :GEOSGeom_getDimensions_r => [
364
+ GEOSGeom_getDimensions_r: [
366
365
  # dims, *handle, *geom
367
366
  :int, :pointer, :pointer
368
367
  ],
369
368
 
370
- :GEOSGetNumGeometries_r => [
369
+ GEOSGetNumGeometries_r: [
371
370
  # ngeoms, *handle, *geom
372
371
  :int, :pointer, :pointer
373
372
  ],
374
373
 
375
- :GEOSGetNumCoordinates_r => [
374
+ GEOSGetNumCoordinates_r: [
376
375
  # numcoords, *handle, *geom
377
376
  :int, :pointer, :pointer
378
377
  ],
379
378
 
380
- :GEOSGeom_getCoordSeq_r => [
379
+ GEOSGeom_getCoordSeq_r: [
381
380
  # *coord_seq, *handle, *geom
382
381
  :pointer, :pointer, :pointer
383
382
  ],
384
383
 
385
- :GEOSIntersection_r => [
384
+ GEOSIntersection_r: [
386
385
  # *geom, *handle, *geom_a, *geom_b
387
386
  :pointer, :pointer, :pointer, :pointer
388
387
  ],
389
388
 
390
- :GEOSBufferWithParams_r => [
389
+ GEOSBufferWithParams_r: [
391
390
  # *geom, *handle, *geom, *params, width
392
391
  :pointer, :pointer, :pointer, :pointer, :double
393
392
  ],
394
393
 
395
- :GEOSBuffer_r => [
394
+ GEOSBuffer_r: [
396
395
  # *geom, *handle, *geom, width, quad_segs
397
396
  :pointer, :pointer, :pointer, :double, :int
398
397
  ],
399
398
 
400
- :GEOSBufferWithStyle_r => [
399
+ GEOSBufferWithStyle_r: [
401
400
  # *geom, *handle, *geom, width, quad_segs, buffer_cap_style, buffer_join_style, mitre_limit
402
401
  :pointer, :pointer, :pointer, :double, :int, :buffer_cap_style, :buffer_join_style, :double
403
402
  ],
404
403
 
405
404
  # Deprecated in GEOS 3.3.0.
406
- :GEOSSingleSidedBuffer_r => [
405
+ GEOSSingleSidedBuffer_r: [
407
406
  # *geom, *handle, *geom, width, quad_segs, buffer_join_style, mitre_limit, is_left
408
407
  :pointer, :pointer, :pointer, :double, :int, :buffer_join_style, :double, :int
409
408
  ],
410
409
 
411
- :GEOSOffsetCurve_r => [
410
+ GEOSOffsetCurve_r: [
412
411
  # *geom, *handle, *geom, width, quad_segs, buffer_join_style, mitre_limit
413
412
  :pointer, :pointer, :pointer, :double, :int, :buffer_join_style, :double
414
413
  ],
415
414
 
416
- :GEOSConvexHull_r => [
415
+ GEOSConvexHull_r: [
417
416
  # *geom, *handle, *geom
418
417
  :pointer, :pointer, :pointer
419
418
  ],
420
419
 
421
- :GEOSDifference_r => [
420
+ GEOSDifference_r: [
422
421
  # *geom, *handle, *geom_a, *geom_b
423
422
  :pointer, :pointer, :pointer, :pointer
424
423
  ],
425
424
 
426
- :GEOSSymDifference_r => [
425
+ GEOSSymDifference_r: [
427
426
  # *geom, *handle, *geom_a, *geom_b
428
427
  :pointer, :pointer, :pointer, :pointer
429
428
  ],
430
429
 
431
- :GEOSBoundary_r => [
430
+ GEOSBoundary_r: [
432
431
  # *geom, *handle, *geom
433
432
  :pointer, :pointer, :pointer
434
433
  ],
435
434
 
436
- :GEOSUnion_r => [
435
+ GEOSUnion_r: [
437
436
  # *geom, *handle, *geom_a, *geom_b
438
437
  :pointer, :pointer, :pointer, :pointer
439
438
  ],
440
439
 
441
- :GEOSUnaryUnion_r => [
440
+ GEOSUnaryUnion_r: [
442
441
  # *geom, *handle, *geom
443
442
  :pointer, :pointer, :pointer
444
443
  ],
445
444
 
446
- :GEOSNode_r => [
445
+ GEOSNode_r: [
447
446
  # *geom, *handle, *geom
448
447
  :pointer, :pointer, :pointer
449
448
  ],
450
449
 
451
450
  # Deprecated in GEOS 3.3.0. Use GEOSUnaryUnion_r instead.
452
- :GEOSUnionCascaded_r => [
451
+ GEOSUnionCascaded_r: [
453
452
  # *geom, *handle, *geom
454
453
  :pointer, :pointer, :pointer
455
454
  ],
456
455
 
457
- :GEOSPointOnSurface_r => [
456
+ GEOSPointOnSurface_r: [
458
457
  # *geom, *handle, *geom
459
458
  :pointer, :pointer, :pointer
460
459
  ],
461
460
 
462
- :GEOSClipByRect_r => [
461
+ GEOSClipByRect_r: [
463
462
  # *geom, *handle, *geom, xmin, ymin, xmax, ymax
464
463
  :pointer, :pointer, :pointer, :double, :double, :double, :double
465
464
  ],
466
465
 
467
- :GEOSGetCentroid_r => [
466
+ GEOSGetCentroid_r: [
468
467
  # *geom, *handle, *geom
469
468
  :pointer, :pointer, :pointer
470
469
  ],
471
470
 
472
- :GEOSEnvelope_r => [
471
+ GEOSEnvelope_r: [
473
472
  # *geom, *handle, *geom
474
473
  :pointer, :pointer, :pointer
475
474
  ],
476
475
 
477
- :GEOSLineMerge_r => [
476
+ GEOSLineMerge_r: [
478
477
  # *geom, *handle, *geom
479
478
  :pointer, :pointer, :pointer
480
479
  ],
481
480
 
482
- :GEOSSimplify_r => [
481
+ GEOSSimplify_r: [
483
482
  # *geom, *handle, *geom, tolerance
484
483
  :pointer, :pointer, :pointer, :double
485
484
  ],
486
485
 
487
- :GEOSTopologyPreserveSimplify_r => [
486
+ GEOSTopologyPreserveSimplify_r: [
488
487
  # *geom, *handle, *geom, tolerance
489
488
  :pointer, :pointer, :pointer, :double
490
489
  ],
491
490
 
492
- :GEOSGeom_extractUniquePoints_r => [
491
+ GEOSGeom_extractUniquePoints_r: [
493
492
  # *geom, *handle, *geom
494
493
  :pointer, :pointer, :pointer
495
494
  ],
496
495
 
497
- :GEOSSharedPaths_r => [
496
+ GEOSSharedPaths_r: [
498
497
  # *geom, *handle, *geom_a, *geom_b
499
498
  :pointer, :pointer, :pointer, :pointer
500
499
  ],
501
500
 
502
- :GEOSSnap_r => [
501
+ GEOSSnap_r: [
503
502
  # *geom, *handle, *geom_a, *geom_b, tolerance
504
503
  :pointer, :pointer, :pointer, :pointer, :double
505
504
  ],
506
505
 
507
- :GEOSDelaunayTriangulation_r => [
506
+ GEOSDelaunayTriangulation_r: [
508
507
  # *geom, *handle, *geom, tolerance, only_edges
509
508
  :pointer, :pointer, :pointer, :double, :int
510
509
  ],
511
510
 
512
- :GEOSVoronoiDiagram_r => [
511
+ GEOSVoronoiDiagram_r: [
513
512
  # *geom, *handle, *geom, *envelope, tolerance, only_edges
514
513
  :pointer, :pointer, :pointer, :pointer, :double, :int
515
514
  ],
516
515
 
517
- :GEOSRelate_r => [
516
+ GEOSRelate_r: [
518
517
  # string, *handle, *geom_a, *geom_b
519
518
  :string, :pointer, :pointer, :pointer
520
519
  ],
521
520
 
522
- :GEOSRelatePatternMatch_r => [
521
+ GEOSRelatePatternMatch_r: [
523
522
  # (2 on exception, 1 on true, 2 on false), *handle, pattern_a, pattern_b
524
523
  :char, :pointer, :string, :string
525
524
  ],
526
525
 
527
- :GEOSRelatePattern_r => [
526
+ GEOSRelatePattern_r: [
528
527
  # (2 on exception, 1 on true, 2 on false), *handle, *geom_a, *geom_b, pattern
529
528
  :char, :pointer, :pointer, :pointer, :string
530
529
  ],
531
530
 
532
- :GEOSRelateBoundaryNodeRule_r => [
531
+ GEOSRelateBoundaryNodeRule_r: [
533
532
  # string, *handle, *geom_a, *geom_b, bnr
534
533
  :string, :pointer, :pointer, :pointer, :relate_boundary_node_rule
535
534
  ],
536
535
 
537
- :GEOSDisjoint_r => [
536
+ GEOSDisjoint_r: [
538
537
  # (2 on exception, 1 on true, 2 on false), *handle, *geom_a, *geom_b
539
538
  :char, :pointer, :pointer, :pointer
540
539
  ],
541
540
 
542
- :GEOSTouches_r => [
541
+ GEOSTouches_r: [
543
542
  # (2 on exception, 1 on true, 2 on false), *handle, *geom_a, *geom_b
544
543
  :char, :pointer, :pointer, :pointer
545
544
  ],
546
545
 
547
- :GEOSIntersects_r => [
546
+ GEOSIntersects_r: [
548
547
  # (2 on exception, 1 on true, 2 on false), *handle, *geom_a, *geom_b
549
548
  :char, :pointer, :pointer, :pointer
550
549
  ],
551
550
 
552
- :GEOSCrosses_r => [
551
+ GEOSCrosses_r: [
553
552
  # (2 on exception, 1 on true, 2 on false), *handle, *geom_a, *geom_b
554
553
  :char, :pointer, :pointer, :pointer
555
554
  ],
556
555
 
557
- :GEOSWithin_r => [
556
+ GEOSWithin_r: [
558
557
  # (2 on exception, 1 on true, 2 on false), *handle, *geom_a, *geom_b
559
558
  :char, :pointer, :pointer, :pointer
560
559
  ],
561
560
 
562
- :GEOSContains_r => [
561
+ GEOSContains_r: [
563
562
  # (2 on exception, 1 on true, 2 on false), *handle, *geom_a, *geom_b
564
563
  :char, :pointer, :pointer, :pointer
565
564
  ],
566
565
 
567
- :GEOSOverlaps_r => [
566
+ GEOSOverlaps_r: [
568
567
  # (2 on exception, 1 on true, 2 on false), *handle, *geom_a, *geom_b
569
568
  :char, :pointer, :pointer, :pointer
570
569
  ],
571
570
 
572
- :GEOSCovers_r => [
571
+ GEOSCovers_r: [
573
572
  # (2 on exception, 1 on true, 2 on false), *handle, *geom_a, *geom_b
574
573
  :char, :pointer, :pointer, :pointer
575
574
  ],
576
575
 
577
- :GEOSCoveredBy_r => [
576
+ GEOSCoveredBy_r: [
578
577
  # (2 on exception, 1 on true, 2 on false), *handle, *geom_a, *geom_b
579
578
  :char, :pointer, :pointer, :pointer
580
579
  ],
581
580
 
582
- :GEOSEquals_r => [
581
+ GEOSEquals_r: [
583
582
  # (2 on exception, 1 on true, 2 on false), *handle, *geom_a, *geom_b
584
583
  :char, :pointer, :pointer, :pointer
585
584
  ],
586
585
 
587
- :GEOSEqualsExact_r => [
586
+ GEOSEqualsExact_r: [
588
587
  # (2 on exception, 1 on true, 2 on false), *handle, *geom_a, *geom_b
589
588
  :char, :pointer, :pointer, :pointer, :double
590
589
  ],
591
590
 
592
- :GEOSisEmpty_r => [
591
+ GEOSisEmpty_r: [
593
592
  # (2 on exception, 1 on true, 2 on false), *handle, *geom
594
593
  :char, :pointer, :pointer
595
594
  ],
596
595
 
597
- :GEOSisValid_r => [
596
+ GEOSisValid_r: [
598
597
  # (2 on exception, 1 on true, 2 on false), *handle, *geom
599
598
  :char, :pointer, :pointer
600
599
  ],
601
600
 
602
- :GEOSisValidReason_r => [
601
+ GEOSisValidReason_r: [
603
602
  # reason, *handle, *geom
604
603
  :string, :pointer, :pointer
605
604
  ],
606
605
 
607
- :GEOSisValidDetail_r => [
606
+ GEOSisValidDetail_r: [
608
607
  # (2 on exception, 1 on true, 2 on false), *handle, *geom, flags, (string**) reasons, **geoms
609
608
  :char, :pointer, :pointer, :int, :pointer, :pointer
610
609
  ],
611
610
 
612
- :GEOSisSimple_r => [
611
+ GEOSisSimple_r: [
613
612
  # (2 on exception, 1 on true, 2 on false), *handle, *geom
614
613
  :char, :pointer, :pointer
615
614
  ],
616
615
 
617
- :GEOSisRing_r => [
616
+ GEOSisRing_r: [
618
617
  # (2 on exception, 1 on true, 2 on false), *handle, *geom
619
618
  :char, :pointer, :pointer
620
619
  ],
621
620
 
622
- :GEOSHasZ_r => [
621
+ GEOSHasZ_r: [
623
622
  # (2 on exception, 1 on true, 2 on false), *handle, *geom
624
623
  :char, :pointer, :pointer
625
624
  ],
626
625
 
627
- :GEOSisClosed_r => [
626
+ GEOSisClosed_r: [
628
627
  # (2 on exception, 1 on true, 2 on false), *handle, *geom
629
628
  :char, :pointer, :pointer
630
629
  ],
631
630
 
632
- :GEOSArea_r => [
631
+ GEOSArea_r: [
633
632
  # (0 on exception, 1 otherwise), *handle, *geom, (double *) area
634
633
  :int, :pointer, :pointer, :pointer
635
634
  ],
636
635
 
637
- :GEOSLength_r => [
636
+ GEOSLength_r: [
638
637
  # (0 on exception, 1 otherwise), *handle, *geom, (double *) length
639
638
  :int, :pointer, :pointer, :pointer
640
639
  ],
641
640
 
642
- :GEOSDistance_r => [
641
+ GEOSDistance_r: [
643
642
  # (0 on exception, 1 otherwise), *handle, *geom_a, *geom_b, (double *) distance
644
643
  :int, :pointer, :pointer, :pointer, :pointer
645
644
  ],
646
645
 
647
- :GEOSHausdorffDistance_r => [
646
+ GEOSHausdorffDistance_r: [
648
647
  # (0 on exception, 1 otherwise), *handle, *geom_a, *geom_b, (double *) distance
649
648
  :int, :pointer, :pointer, :pointer, :pointer
650
649
  ],
651
650
 
652
- :GEOSHausdorffDistanceDensify_r => [
651
+ GEOSHausdorffDistanceDensify_r: [
653
652
  # (0 on exception, 1 otherwise), *handle, *geom_a, *geom_b, densifyFrac, (double *) distance
654
653
  :int, :pointer, :pointer, :pointer, :double, :pointer
655
654
  ],
656
655
 
657
- :GEOSNearestPoints_r => [
656
+ GEOSNearestPoints_r: [
658
657
  # (NULL on exception, pointer to CoordinateSequence otherwise), *handle, *geom, *geom
659
658
  :pointer, :pointer, :pointer, :pointer
660
659
  ],
661
660
 
662
- :GEOSGetGeometryN_r => [
661
+ GEOSGetGeometryN_r: [
663
662
  # *geom, *handle, *geom, n
664
663
  :pointer, :pointer, :pointer, :int
665
664
  ],
666
665
 
667
- :GEOSGetNumInteriorRings_r => [
666
+ GEOSGetNumInteriorRings_r: [
668
667
  # rings, *handle, *geom
669
668
  :int, :pointer, :pointer
670
669
  ],
671
670
 
672
- :GEOSNormalize_r => [
671
+ GEOSNormalize_r: [
673
672
  # -1 on exception, *handle, *geom
674
673
  :int, :pointer, :pointer
675
674
  ],
676
675
 
677
- :GEOSGetInteriorRingN_r => [
676
+ GEOSGetInteriorRingN_r: [
678
677
  # *geom, *handle, *geom, n
679
678
  :pointer, :pointer, :pointer, :int
680
679
  ],
681
680
 
682
- :GEOSGetExteriorRing_r => [
681
+ GEOSGetExteriorRing_r: [
683
682
  # *geom, *handle, *geom
684
683
  :pointer, :pointer, :pointer
685
684
  ],
686
685
 
687
- :GEOSGeomGetNumPoints_r => [
686
+ GEOSGeomGetNumPoints_r: [
688
687
  # numpoints, *handle, *geom
689
688
  :int, :pointer, :pointer
690
689
  ],
691
690
 
692
- :GEOSGeomGetX_r => [
691
+ GEOSGeomGetX_r: [
693
692
  # -1 on exception, *handle, *geom, *point
694
693
  :int, :pointer, :pointer, :pointer
695
694
  ],
696
695
 
697
- :GEOSGeomGetY_r => [
696
+ GEOSGeomGetY_r: [
698
697
  # -1 on exception, *handle, *geom, *point
699
698
  :int, :pointer, :pointer, :pointer
700
699
  ],
701
700
 
702
- :GEOSGeomGetZ_r => [
701
+ GEOSGeomGetZ_r: [
703
702
  # -1 on exception, *handle, *geom, *point
704
703
  :int, :pointer, :pointer, :pointer
705
704
  ],
706
705
 
707
- :GEOSGeomGetPointN_r => [
706
+ GEOSGeomGetPointN_r: [
708
707
  # *point, *handle, *geom, n
709
708
  :pointer, :pointer, :pointer, :int
710
709
  ],
711
710
 
712
- :GEOSGeomGetStartPoint_r => [
711
+ GEOSGeomGetStartPoint_r: [
713
712
  # *point, *handle, *geom
714
713
  :pointer, :pointer, :pointer
715
714
  ],
716
715
 
717
- :GEOSGeomGetEndPoint_r => [
716
+ GEOSGeomGetEndPoint_r: [
718
717
  # *point, *handle, *geom
719
718
  :pointer, :pointer, :pointer
720
719
  ],
721
720
 
722
- :GEOSGeom_setPrecision_r => [
721
+ GEOSGeom_setPrecision_r: [
723
722
  # *geom, *hande, *geom, grid_size, int flags
724
723
  :pointer, :pointer, :pointer, :double, :int
725
724
  ],
726
725
 
727
- :GEOSGeom_getPrecision_r => [
726
+ GEOSGeom_getPrecision_r: [
728
727
  # precision, *hande, *geom
729
728
  :double, :pointer, :pointer
730
729
  ],
731
730
 
732
- :GEOSMinimumRotatedRectangle_r => [
731
+ GEOSMinimumRotatedRectangle_r: [
733
732
  # *geom, *handle, *geom
734
733
  :pointer, :pointer, :pointer
735
734
  ],
736
735
 
737
- :GEOSMinimumClearance_r => [
736
+ GEOSMinimumClearance_r: [
738
737
  # 0 on success, *handle, *geom, *clearance
739
738
  :int, :pointer, :pointer, :pointer
740
739
  ],
741
740
 
742
- :GEOSMinimumClearanceLine_r => [
741
+ GEOSMinimumClearanceLine_r: [
743
742
  # *geom, *handle, *geom
744
743
  :pointer, :pointer, :pointer
745
744
  ],
746
745
 
747
- :GEOSMinimumWidth_r => [
746
+ GEOSMinimumWidth_r: [
748
747
  # *geom, *handle, *geom
749
748
  :pointer, :pointer, :pointer
750
749
  ],
750
+
751
+ GEOSReverse_r: [
752
+ # *geom, *handle, *geom
753
+ :pointer, :pointer, :pointer
754
+ ],
755
+
756
+ GEOSFrechetDistance_r: [
757
+ # (0 on exception, 1 otherwise), *handle, *geom_a, *geom_b, (double *) distance
758
+ :int, :pointer, :pointer, :pointer, :pointer
759
+ ],
760
+
761
+ GEOSFrechetDistanceDensify_r: [
762
+ # (0 on exception, 1 otherwise), *handle, *geom_a, *geom_b, densifyFrac, (double *) distance
763
+ :int, :pointer, :pointer, :pointer, :double, :pointer
764
+ ],
751
765
  #### /Geometry functions ####
752
766
 
753
767
  #### STRtree functions ####
754
- :GEOSSTRtree_create_r => [
768
+ GEOSSTRtree_create_r: [
755
769
  # *tree, *handle, node_capacity
756
770
  :pointer, :pointer, :size_t
757
771
  ],
758
772
 
759
- :GEOSSTRtree_insert_r => [
773
+ GEOSSTRtree_insert_r: [
760
774
  # void, *handle, *tree, *geom, *void
761
775
  :void, :pointer, :pointer, :pointer, :pointer
762
776
  ],
763
777
 
764
- :GEOSSTRtree_query_r => [
778
+ GEOSSTRtree_query_r: [
765
779
  # void, *handle, *tree, *geom, void query_callback((void *) item, (void *) user_data), (void *) user_data
766
780
  :void, :pointer, :pointer, :pointer, callback([ :pointer, :pointer ], :void), :pointer
767
781
  ],
768
782
 
769
- :GEOSSTRtree_iterate_r => [
783
+ GEOSSTRtree_iterate_r: [
770
784
  # void, *handle, *tree, void query_callback((void *) item, (void *) user_data), (void *) user_data
771
785
  :void, :pointer, :pointer, callback([ :pointer, :pointer ], :void), :pointer
772
786
  ],
773
787
 
774
- :GEOSSTRtree_remove_r => [
788
+ GEOSSTRtree_remove_r: [
775
789
  # bool, *handle, *tree, *geom, (void *) item
776
790
  :char, :pointer, :pointer, :pointer, :pointer
777
791
  ],
778
792
 
779
- :GEOSSTRtree_destroy_r => [
793
+ GEOSSTRtree_destroy_r: [
780
794
  # void, *handle, *tree
781
795
  :void, :pointer, :pointer
782
796
  ],
783
797
 
784
- :GEOSSTRtree_nearest_generic_r => [
798
+ GEOSSTRtree_nearest_generic_r: [
785
799
  # *void, *handle, *tree, *item, *item_envelope, int distance_callback(*item_1, *item_2, *double, void *user_data), *user_data
786
800
  :pointer, :pointer, :pointer, :pointer, :pointer, callback([ :pointer, :pointer, :pointer, :pointer ], :int), :pointer
787
801
  ],
788
802
  #### /STRtree functions ####
789
803
 
790
804
  #### PreparedGeometry functions ####
791
- :GEOSPrepare_r => [
805
+ GEOSPrepare_r: [
792
806
  # *prepared, *handle, *geom
793
807
  :pointer, :pointer, :pointer
794
808
  ],
795
809
 
796
- :GEOSPreparedGeom_destroy_r => [
810
+ GEOSPreparedGeom_destroy_r: [
797
811
  # void, *handle, *geom
798
812
  :void, :pointer, :pointer
799
813
  ],
800
814
 
801
- :GEOSPreparedContains_r => [
815
+ GEOSPreparedContains_r: [
802
816
  # (2 on exception, 1 on true, 0 on false), *handle, *prepared, *geom
803
817
  :char, :pointer, :pointer, :pointer
804
818
  ],
805
819
 
806
- :GEOSPreparedContainsProperly_r => [
820
+ GEOSPreparedContainsProperly_r: [
807
821
  # (2 on exception, 1 on true, 0 on false), *handle, *prepared, *geom
808
822
  :char, :pointer, :pointer, :pointer
809
823
  ],
810
824
 
811
- :GEOSPreparedCoveredBy_r => [
825
+ GEOSPreparedCoveredBy_r: [
812
826
  # (2 on exception, 1 on true, 0 on false), *handle, *prepared, *geom
813
827
  :char, :pointer, :pointer, :pointer
814
828
  ],
815
829
 
816
- :GEOSPreparedCovers_r => [
830
+ GEOSPreparedCovers_r: [
817
831
  # (2 on exception, 1 on true, 0 on false), *handle, *prepared, *geom
818
832
  :char, :pointer, :pointer, :pointer
819
833
  ],
820
834
 
821
- :GEOSPreparedCrosses_r => [
835
+ GEOSPreparedCrosses_r: [
822
836
  # (2 on exception, 1 on true, 0 on false), *handle, *prepared, *geom
823
837
  :char, :pointer, :pointer, :pointer
824
838
  ],
825
839
 
826
- :GEOSPreparedDisjoint_r => [
840
+ GEOSPreparedDisjoint_r: [
827
841
  # (2 on exception, 1 on true, 0 on false), *handle, *prepared, *geom
828
842
  :char, :pointer, :pointer, :pointer
829
843
  ],
830
844
 
831
- :GEOSPreparedIntersects_r => [
845
+ GEOSPreparedIntersects_r: [
832
846
  # (2 on exception, 1 on true, 0 on false), *handle, *prepared, *geom
833
847
  :char, :pointer, :pointer, :pointer
834
848
  ],
835
849
 
836
- :GEOSPreparedOverlaps_r => [
850
+ GEOSPreparedOverlaps_r: [
837
851
  # (2 on exception, 1 on true, 0 on false), *handle, *prepared, *geom
838
852
  :char, :pointer, :pointer, :pointer
839
853
  ],
840
854
 
841
- :GEOSPreparedTouches_r => [
855
+ GEOSPreparedTouches_r: [
842
856
  # (2 on exception, 1 on true, 0 on false), *handle, *prepared, *geom
843
857
  :char, :pointer, :pointer, :pointer
844
858
  ],
845
859
 
846
- :GEOSPreparedWithin_r => [
860
+ GEOSPreparedWithin_r: [
847
861
  # (2 on exception, 1 on true, 0 on false), *handle, *prepared, *geom
848
862
  :char, :pointer, :pointer, :pointer
849
863
  ],
850
864
  #### /PreparedGeometry functions ####
851
865
 
852
866
  #### WktReader functions ####
853
- :GEOSWKTReader_create_r => [
867
+ GEOSWKTReader_create_r: [
854
868
  # *wktr, *handle
855
869
  :pointer, :pointer
856
870
  ],
857
871
 
858
- :GEOSWKTReader_read_r => [
872
+ GEOSWKTReader_read_r: [
859
873
  # *geom, *handle, *wktr, string
860
874
  :pointer, :pointer, :pointer, :string
861
875
  ],
862
876
 
863
- :GEOSWKTReader_destroy_r => [
877
+ GEOSWKTReader_destroy_r: [
864
878
  # void, *handle, *wktr
865
879
  :void, :pointer, :pointer
866
880
  ],
867
881
  #### /WktReader functions ###
868
882
 
869
883
  #### WktWriter functions ####
870
- :GEOSWKTWriter_create_r => [
884
+ GEOSWKTWriter_create_r: [
871
885
  # *wktw, *handle
872
886
  :pointer, :pointer
873
887
  ],
874
888
 
875
- :GEOSWKTWriter_write_r => [
889
+ GEOSWKTWriter_write_r: [
876
890
  # string, *handle, *wktw, *geom
877
891
  :string, :pointer, :pointer, :pointer
878
892
  ],
879
893
 
880
- :GEOSWKTWriter_destroy_r => [
894
+ GEOSWKTWriter_destroy_r: [
881
895
  # void, *handle, *wktw
882
896
  :void, :pointer, :pointer
883
897
  ],
884
898
 
885
- :GEOSWKTWriter_setTrim_r => [
899
+ GEOSWKTWriter_setTrim_r: [
886
900
  # void, *handle, *wktw, bool
887
901
  :void, :pointer, :pointer, :char
888
902
  ],
889
903
 
890
- :GEOSWKTWriter_setRoundingPrecision_r => [
904
+ GEOSWKTWriter_setRoundingPrecision_r: [
891
905
  # void, *handle, *wktw, precision
892
906
  :void, :pointer, :pointer, :int
893
907
  ],
894
908
 
895
- :GEOSWKTWriter_setOutputDimension_r => [
909
+ GEOSWKTWriter_setOutputDimension_r: [
896
910
  # void, *handle, *wktw, dimensions
897
911
  :void, :pointer, :pointer, :int
898
912
  ],
899
913
 
900
- :GEOSWKTWriter_getOutputDimension_r => [
914
+ GEOSWKTWriter_getOutputDimension_r: [
901
915
  # dimensions, *handle, *wktw
902
916
  :int, :pointer, :pointer
903
917
  ],
904
918
 
905
- :GEOSWKTWriter_setOld3D_r => [
919
+ GEOSWKTWriter_setOld3D_r: [
906
920
  # void, *handle, *wktw, bool
907
921
  :void, :pointer, :pointer, :int
908
922
  ],
909
923
  #### /WktWriter functions ####
910
924
 
911
925
  #### WkbReader functions ####
912
- :GEOSWKBReader_create_r => [
926
+ GEOSWKBReader_create_r: [
913
927
  # *wkbr, *handle
914
928
  :pointer, :pointer
915
929
  ],
916
930
 
917
- :GEOSWKBReader_destroy_r => [
931
+ GEOSWKBReader_destroy_r: [
918
932
  # void, *handle, *wkbr
919
933
  :void, :pointer, :pointer
920
934
  ],
921
935
 
922
- :GEOSWKBReader_read_r => [
936
+ GEOSWKBReader_read_r: [
923
937
  # *geom, *handle, *wkbr, (unsigned char *) string, size_t
924
938
  :pointer, :pointer, :pointer, :pointer, :size_t
925
939
  ],
926
940
 
927
- :GEOSWKBReader_readHEX_r => [
941
+ GEOSWKBReader_readHEX_r: [
928
942
  # *geom, *handle, *wkbr, string, size_t
929
943
  :pointer, :pointer, :pointer, :string, :size_t
930
944
  ],
931
945
  #### /WkbReader functions ####
932
946
 
933
947
  #### WkbWriter functions ####
934
- :GEOSWKBWriter_create_r => [
948
+ GEOSWKBWriter_create_r: [
935
949
  # *wkbw, *handle
936
950
  :pointer, :pointer
937
951
  ],
938
952
 
939
- :GEOSWKBWriter_destroy_r => [
953
+ GEOSWKBWriter_destroy_r: [
940
954
  # void, *handle, *wkbw
941
955
  :void, :pointer, :pointer
942
956
  ],
943
957
 
944
- :GEOSWKBWriter_write_r => [
958
+ GEOSWKBWriter_write_r: [
945
959
  # (unsigned char *) string, *handle, *wkbw, *geom, *size_t
946
960
  :pointer, :pointer, :pointer, :pointer, :pointer
947
961
  ],
948
962
 
949
- :GEOSWKBWriter_writeHEX_r => [
963
+ GEOSWKBWriter_writeHEX_r: [
950
964
  # (unsigned char *) string, *handle, *wkbw, *geom, *size_t
951
965
  :pointer, :pointer, :pointer, :pointer, :pointer
952
966
  ],
953
967
 
954
- :GEOSWKBWriter_setOutputDimension_r => [
968
+ GEOSWKBWriter_setOutputDimension_r: [
955
969
  # void, *handle, *wkbw, dimensions
956
970
  :void, :pointer, :pointer, :int
957
971
  ],
958
972
 
959
- :GEOSWKBWriter_getOutputDimension_r => [
973
+ GEOSWKBWriter_getOutputDimension_r: [
960
974
  # dimensions, *handle, *wkbw
961
975
  :int, :pointer, :pointer
962
976
  ],
963
977
 
964
- :GEOSWKBWriter_getByteOrder_r => [
978
+ GEOSWKBWriter_getByteOrder_r: [
965
979
  # byte_order, *handle, *wkbw
966
980
  :byte_order, :pointer, :pointer
967
981
  ],
968
982
 
969
- :GEOSWKBWriter_setByteOrder_r => [
983
+ GEOSWKBWriter_setByteOrder_r: [
970
984
  # void, *handle, *wkbw, byte_order
971
985
  :void, :pointer, :pointer, :byte_order
972
986
  ],
973
987
 
974
- :GEOSWKBWriter_getIncludeSRID_r => [
988
+ GEOSWKBWriter_getIncludeSRID_r: [
975
989
  # bool, *handle, *geom
976
990
  :char, :pointer, :pointer
977
991
  ],
978
992
 
979
- :GEOSWKBWriter_setIncludeSRID_r => [
993
+ GEOSWKBWriter_setIncludeSRID_r: [
980
994
  # void, *handle, *geom, bool
981
995
  :void, :pointer, :pointer, :char
982
996
  ],
983
997
  #### /WkbWriter functions ####
984
998
 
985
-
986
999
  #### Linearref functions ####
987
- :GEOSProject_r => [
1000
+ GEOSProject_r: [
988
1001
  # distance, *handle, *geom_a, *geom_b
989
1002
  :double, :pointer, :pointer, :pointer
990
1003
  ],
991
1004
 
992
- :GEOSProjectNormalized_r => [
1005
+ GEOSProjectNormalized_r: [
993
1006
  # distance, *handle, *geom_a, *geom_b
994
1007
  :double, :pointer, :pointer, :pointer
995
1008
  ],
996
1009
 
997
- :GEOSInterpolate_r => [
1010
+ GEOSInterpolate_r: [
998
1011
  # *geom, *handle, *geom, distance
999
1012
  :pointer, :pointer, :pointer, :double
1000
1013
  ],
1001
1014
 
1002
- :GEOSInterpolateNormalized_r => [
1015
+ GEOSInterpolateNormalized_r: [
1003
1016
  # *geom, *handle, *geom, distance
1004
1017
  :pointer, :pointer, :pointer, :double
1005
1018
  ],
1006
1019
  #### /Linearref functions ####
1007
1020
 
1008
1021
  #### BufferParams functions ####
1009
- :GEOSBufferParams_create_r => [
1022
+ GEOSBufferParams_create_r: [
1010
1023
  # GEOSBufferParams*, *handle
1011
1024
  :pointer, :pointer
1012
1025
  ],
1013
1026
 
1014
- :GEOSBufferParams_destroy_r => [
1027
+ GEOSBufferParams_destroy_r: [
1015
1028
  # void, *handle, *params
1016
1029
  :void, :pointer, :pointer
1017
1030
  ],
1018
1031
 
1019
- :GEOSBufferParams_setEndCapStyle_r => [
1032
+ GEOSBufferParams_setEndCapStyle_r: [
1020
1033
  # 0 on exception, *handle, *params, style
1021
1034
  :int, :pointer, :pointer, :buffer_cap_style
1022
1035
  ],
1023
1036
 
1024
- :GEOSBufferParams_setJoinStyle_r => [
1037
+ GEOSBufferParams_setJoinStyle_r: [
1025
1038
  # 0 on exception, *handle, *params, style
1026
1039
  :int, :pointer, :pointer, :buffer_join_style
1027
1040
  ],
1028
1041
 
1029
- :GEOSBufferParams_setMitreLimit_r => [
1042
+ GEOSBufferParams_setMitreLimit_r: [
1030
1043
  # 0 on exception, *handle, *params, mitre_limit
1031
1044
  :int, :pointer, :pointer, :double
1032
1045
  ],
1033
1046
 
1034
- :GEOSBufferParams_setQuadrantSegments_r => [
1047
+ GEOSBufferParams_setQuadrantSegments_r: [
1035
1048
  # 0 on exception, *handle, *params, quad_segs
1036
1049
  :int, :pointer, :pointer, :int
1037
1050
  ],
1038
1051
 
1039
- :GEOSBufferParams_setSingleSided_r => [
1052
+ GEOSBufferParams_setSingleSided_r: [
1040
1053
  # 0 on exception, *handle, *params, bool
1041
1054
  :int, :pointer, :pointer, :int
1042
1055
  ],
@@ -1046,12 +1059,12 @@ module Geos
1046
1059
  # -1 if reaching P takes a counter-clockwise (left) turn
1047
1060
  # 1 if reaching P takes a clockwise (right) turn
1048
1061
  # 0 if P is collinear with A-B
1049
- :GEOSOrientationIndex_r => [
1062
+ GEOSOrientationIndex_r: [
1050
1063
  # int, *handle, Ax, Ay, Bx, By, Px, Py
1051
1064
  :int, :pointer, :double, :double, :double, :double, :double, :double
1052
1065
  ]
1053
1066
  #### /Algorithms ####
1054
- }
1067
+ }.freeze
1055
1068
 
1056
1069
  begin
1057
1070
  ffi_lib(geos_library_path)
@@ -1059,7 +1072,7 @@ module Geos
1059
1072
  FFI_LAYOUT.each do |func, ary|
1060
1073
  ret = ary.shift
1061
1074
  begin
1062
- self.class_eval do
1075
+ class_eval do
1063
1076
  attach_function(func, ary, ret)
1064
1077
  end
1065
1078
  rescue FFI::NotFoundError
@@ -1069,9 +1082,8 @@ module Geos
1069
1082
 
1070
1083
  # Checks to see if we actually have the GEOS library loaded.
1071
1084
  FFIGeos.GEOSversion
1072
-
1073
1085
  rescue LoadError, NoMethodError
1074
- raise LoadError.new("Couldn't load the GEOS CAPI library.")
1086
+ raise LoadError, "Couldn't load the GEOS CAPI library."
1075
1087
  end
1076
1088
  end
1077
1089
 
@@ -1113,11 +1125,11 @@ module Geos
1113
1125
  end
1114
1126
 
1115
1127
  def reset_notice_handler
1116
- self.notice_handler = self.method(:default_notice_handler)
1128
+ self.notice_handler = method(:default_notice_handler)
1117
1129
  end
1118
1130
 
1119
1131
  def reset_error_handler
1120
- self.error_handler = self.method(:default_error_handler)
1132
+ self.error_handler = method(:default_error_handler)
1121
1133
  end
1122
1134
 
1123
1135
  # Deprecated initialization and teardown...
@@ -1125,8 +1137,8 @@ module Geos
1125
1137
  def initialize
1126
1138
  @ptr = FFI::AutoPointer.new(
1127
1139
  FFIGeos.initGEOS_r(
1128
- @notice_handler = self.method(:default_notice_handler),
1129
- @error_handler = self.method(:default_error_handler)
1140
+ @notice_handler = method(:default_notice_handler),
1141
+ @error_handler = method(:default_error_handler)
1130
1142
  ),
1131
1143
  self.class.method(:release)
1132
1144
  )
@@ -1146,12 +1158,13 @@ module Geos
1146
1158
  end
1147
1159
 
1148
1160
  private
1161
+
1149
1162
  def default_notice_handler(*args)
1150
1163
  # no-op
1151
1164
  end
1152
1165
 
1153
1166
  def default_error_handler(*args)
1154
- raise Geos::GEOSException.new(args[0] % args[1])
1167
+ raise Geos::GEOSException, args[0] % args[1]
1155
1168
  end
1156
1169
  end
1157
1170
 
@@ -1202,7 +1215,7 @@ module Geos
1202
1215
  elsif Geos::Constants::SRID_COPY_POLICIES.include?(policy)
1203
1216
  Thread.current[:ffi_geos_srid_copy_policy] = policy
1204
1217
  else
1205
- raise ArgumentError.new("Invalid SRID policy #{policy} (must be one of #{Geos::Constants::SRID_COPY_POLICIES})")
1218
+ raise ArgumentError, "Invalid SRID policy #{policy} (must be one of #{Geos::Constants::SRID_COPY_POLICIES})"
1206
1219
  end
1207
1220
  end
1208
1221
 
@@ -1216,7 +1229,7 @@ module Geos
1216
1229
  elsif Geos::Constants::SRID_COPY_POLICIES.include?(policy)
1217
1230
  @srid_copy_policy_default = policy
1218
1231
  else
1219
- raise ArgumentError.new("Invalid SRID policy #{policy} (must be one of #{Geos::Constants::SRID_COPY_POLICIES})")
1232
+ raise ArgumentError, "Invalid SRID policy #{policy} (must be one of #{Geos::Constants::SRID_COPY_POLICIES})"
1220
1233
  end
1221
1234
  end
1222
1235
 
@@ -1241,11 +1254,11 @@ module Geos
1241
1254
  create_empty_collection
1242
1255
  create_empty_linear_ring
1243
1256
  }.each do |m|
1244
- self.class_eval(<<-EOF, __FILE__, __LINE__ + 1)
1257
+ class_eval(<<-RUBY, __FILE__, __LINE__ + 1)
1245
1258
  def #{m}(*args)
1246
1259
  Geos::Utils.#{m}(*args)
1247
1260
  end
1248
- EOF
1261
+ RUBY
1249
1262
  end
1250
1263
  end
1251
1264
 
@@ -1296,10 +1309,10 @@ module Geos
1296
1309
 
1297
1310
  module Constants
1298
1311
  BUFFER_PARAM_DEFAULTS = {
1299
- :quad_segs => 8,
1300
- :endcap => :round,
1301
- :join => :round,
1302
- :mitre_limit => 5.0
1312
+ quad_segs: 8,
1313
+ endcap: :round,
1314
+ join: :round,
1315
+ mitre_limit: 5.0
1303
1316
  }.freeze
1304
1317
 
1305
1318
  SRID_COPY_POLICIES = [
@@ -1317,7 +1330,7 @@ module Geos
1317
1330
 
1318
1331
  class IndexBoundsError < Error
1319
1332
  def initialize(*)
1320
- super("Index out of bounds")
1333
+ super('Index out of bounds')
1321
1334
  end
1322
1335
  end
1323
1336
 
@@ -1330,6 +1343,9 @@ module Geos
1330
1343
  class ParseError < Error
1331
1344
  end
1332
1345
 
1346
+ class InvalidGeometryError < Error
1347
+ end
1348
+
1333
1349
  include GeomTypes
1334
1350
  include VersionConstants
1335
1351
  end