Coverage Report

Created: 2025-08-03 06:56

/src/geos/capi/geos_c.cpp
Line
Count
Source (jump to first uncovered line)
1
/************************************************************************
2
 *
3
 *
4
 * C-Wrapper for GEOS library
5
 *
6
 * Copyright (C) 2010 2011 Sandro Santilli <strk@kbt.io>
7
 * Copyright (C) 2005-2006 Refractions Research Inc.
8
 *
9
 * This is free software; you can redistribute and/or modify it under
10
 * the terms of the GNU Lesser General Public Licence as published
11
 * by the Free Software Foundation.
12
 * See the COPYING file for more information.
13
 *
14
 * Author: Sandro Santilli <strk@kbt.io>
15
 *
16
 ***********************************************************************/
17
18
#include <geos/geom/prep/PreparedGeometryFactory.h>
19
#include <geos/index/strtree/TemplateSTRtree.h>
20
#include <geos/io/WKTReader.h>
21
#include <geos/io/WKBReader.h>
22
#include <geos/io/WKTWriter.h>
23
#include <geos/io/WKBWriter.h>
24
#include <geos/io/GeoJSONReader.h>
25
#include <geos/io/GeoJSONWriter.h>
26
#include <geos/operation/buffer/BufferParameters.h>
27
#include <geos/operation/cluster/Clusters.h>
28
#include <geos/util/Interrupt.h>
29
30
#include <stdexcept>
31
#include <new>
32
33
#ifdef _MSC_VER
34
#pragma warning(disable : 4099)
35
#endif
36
37
// Some extra magic to make type declarations in geos_c.h work -
38
// for cross-checking of types in header.
39
// NOTE: the below defines or struct definition must be kept in exact
40
// sync between geos_c.cpp and geos_ts_c.cpp to avoid C++ One Definition Rule
41
// violations.
42
#define GEOSGeometry geos::geom::Geometry
43
#define GEOSPreparedGeometry geos::geom::prep::PreparedGeometry
44
#define GEOSClusterInfo geos::operation::cluster::Clusters
45
#define GEOSCoordSequence geos::geom::CoordinateSequence
46
#define GEOSBufferParams geos::operation::buffer::BufferParameters
47
#define GEOSSTRtree geos::index::strtree::TemplateSTRtree<void*>
48
#define GEOSWKTReader geos::io::WKTReader
49
#define GEOSWKTWriter geos::io::WKTWriter
50
#define GEOSWKBReader geos::io::WKBReader
51
#define GEOSWKBWriter geos::io::WKBWriter
52
#define GEOSGeoJSONReader geos::io::GeoJSONReader
53
#define GEOSGeoJSONWriter geos::io::GeoJSONWriter
54
55
// Implementation struct for the GEOSCoverageCleanParams object
56
typedef struct {
57
    double snappingDistance;
58
    int    overlapMergeStrategy;
59
    double gapMaximumWidth;
60
} GEOSCoverageCleanParams;
61
62
// Implementation struct for the GEOSMakeValidParams object
63
typedef struct {
64
    int method;
65
    int keepCollapsed;
66
} GEOSMakeValidParams;
67
68
69
#include "geos_c.h"
70
71
/// Define this if you want operations triggering Exceptions to
72
/// be printed (will use the NOTIFY channel - only implemented for GEOSUnion so far)
73
///
74
#undef VERBOSE_EXCEPTIONS
75
76
#include <geos/export.h>
77
78
/*
79
#if defined(_MSC_VER)
80
#  define GEOS_DLL     __declspec(dllexport)
81
#else
82
#  define GEOS_DLL
83
#endif
84
*/
85
86
// import the most frequently used definitions globally
87
using geos::geom::Geometry;
88
using geos::geom::LineString;
89
using geos::geom::Polygon;
90
using geos::geom::CoordinateSequence;
91
using geos::geom::GeometryFactory;
92
93
using geos::io::WKTReader;
94
using geos::io::WKTWriter;
95
using geos::io::WKBReader;
96
using geos::io::WKBWriter;
97
using geos::io::GeoJSONReader;
98
using geos::io::GeoJSONWriter;
99
100
101
typedef std::unique_ptr<Geometry> GeomPtr;
102
103
//## GLOBALS ################################################
104
105
// NOTE: SRID will have to be changed after geometry creation
106
GEOSContextHandle_t handle = NULL;
107
108
extern "C" {
109
110
    void
111
    initGEOS(GEOSMessageHandler nf, GEOSMessageHandler ef)
112
1
    {
113
1
        if(! handle) {
114
1
            handle = initGEOS_r(nf, ef);
115
1
        }
116
0
        else {
117
0
            GEOSContext_setNoticeHandler_r(handle, nf);
118
0
            GEOSContext_setErrorHandler_r(handle, ef);
119
0
        }
120
121
1
        geos::util::Interrupt::cancel();
122
1
    }
123
124
    void
125
    finishGEOS()
126
0
    {
127
0
        if(handle != NULL) {
128
0
            finishGEOS_r(handle);
129
0
            handle = NULL;
130
0
        }
131
0
    }
132
133
    GEOSInterruptCallback*
134
    GEOS_interruptRegisterCallback(GEOSInterruptCallback* cb)
135
0
    {
136
0
        return geos::util::Interrupt::registerCallback(cb);
137
0
    }
138
139
    void
140
    GEOS_interruptRequest()
141
0
    {
142
0
        geos::util::Interrupt::request();
143
0
    }
144
145
    void
146
    GEOS_interruptCancel()
147
0
    {
148
0
        geos::util::Interrupt::cancel();
149
0
    }
150
151
    void
152
    GEOSFree(void* buffer)
153
0
    {
154
0
        GEOSFree_r(handle, buffer);
155
0
    }
156
157
    /****************************************************************
158
    ** relate()-related functions
159
    ** return 0 = false, 1 = true, 2 = error occurred
160
    **
161
    */
162
    char
163
    GEOSDisjoint(const Geometry* g1, const Geometry* g2)
164
0
    {
165
0
        return GEOSDisjoint_r(handle, g1, g2);
166
0
    }
167
168
    char
169
    GEOSTouches(const Geometry* g1, const Geometry* g2)
170
0
    {
171
0
        return GEOSTouches_r(handle, g1, g2);
172
0
    }
173
174
    char
175
    GEOSIntersects(const Geometry* g1, const Geometry* g2)
176
0
    {
177
0
        return GEOSIntersects_r(handle, g1, g2);
178
0
    }
179
180
    char
181
    GEOSCrosses(const Geometry* g1, const Geometry* g2)
182
0
    {
183
0
        return GEOSCrosses_r(handle, g1, g2);
184
0
    }
185
186
    char
187
    GEOSWithin(const Geometry* g1, const Geometry* g2)
188
0
    {
189
0
        return GEOSWithin_r(handle, g1, g2);
190
0
    }
191
192
// call g1->contains(g2)
193
// returns 0 = false
194
//         1 = true
195
//         2 = error was trapped
196
    char
197
    GEOSContains(const Geometry* g1, const Geometry* g2)
198
0
    {
199
0
        return GEOSContains_r(handle, g1, g2);
200
0
    }
201
202
    char
203
    GEOSOverlaps(const Geometry* g1, const Geometry* g2)
204
0
    {
205
0
        return GEOSOverlaps_r(handle, g1, g2);
206
0
    }
207
208
    char
209
    GEOSCovers(const Geometry* g1, const Geometry* g2)
210
0
    {
211
0
        return GEOSCovers_r(handle, g1, g2);
212
0
    }
213
214
    char
215
    GEOSCoveredBy(const Geometry* g1, const Geometry* g2)
216
0
    {
217
0
        return GEOSCoveredBy_r(handle, g1, g2);
218
0
    }
219
220
221
//-------------------------------------------------------------------
222
// low-level relate functions
223
//------------------------------------------------------------------
224
225
    char
226
    GEOSRelatePattern(const Geometry* g1, const Geometry* g2, const char* imPattern)
227
0
    {
228
0
        return GEOSRelatePattern_r(handle, g1, g2, imPattern);
229
0
    }
230
231
    char
232
    GEOSRelatePatternMatch(const char* intMatrix, const char* imPattern)
233
0
    {
234
0
        return GEOSRelatePatternMatch_r(handle, intMatrix, imPattern);
235
0
    }
236
237
    char*
238
    GEOSRelate(const Geometry* g1, const Geometry* g2)
239
0
    {
240
0
        return GEOSRelate_r(handle, g1, g2);
241
0
    }
242
243
    char*
244
    GEOSRelateBoundaryNodeRule(const Geometry* g1, const Geometry* g2, int bnr)
245
0
    {
246
0
        return GEOSRelateBoundaryNodeRule_r(handle, g1, g2, bnr);
247
0
    }
248
249
250
//-----------------------------------------------------------------
251
// isValid
252
//-----------------------------------------------------------------
253
254
255
    char
256
    GEOSisValid(const Geometry* g)
257
0
    {
258
0
        return GEOSisValid_r(handle, g);
259
0
    }
260
261
    char*
262
    GEOSisValidReason(const Geometry* g)
263
0
    {
264
0
        return GEOSisValidReason_r(handle, g);
265
0
    }
266
267
    char
268
    GEOSisValidDetail(const Geometry* g, int flags,
269
                      char** reason, Geometry** location)
270
0
    {
271
0
        return GEOSisValidDetail_r(handle, g, flags, reason, location);
272
0
    }
273
274
//-----------------------------------------------------------------
275
// general purpose
276
//-----------------------------------------------------------------
277
278
    char
279
    GEOSEquals(const Geometry* g1, const Geometry* g2)
280
0
    {
281
0
        return GEOSEquals_r(handle, g1, g2);
282
0
    }
283
284
    char
285
    GEOSEqualsExact(const Geometry* g1, const Geometry* g2, double tolerance)
286
0
    {
287
0
        return GEOSEqualsExact_r(handle, g1, g2, tolerance);
288
0
    }
289
290
    char
291
    GEOSEqualsIdentical(const Geometry* g1, const Geometry* g2)
292
0
    {
293
0
        return GEOSEqualsIdentical_r(handle, g1, g2);
294
0
    }
295
296
    int
297
    GEOSDistance(const Geometry* g1, const Geometry* g2, double* dist)
298
0
    {
299
0
        return GEOSDistance_r(handle, g1, g2, dist);
300
0
    }
301
302
    char
303
    GEOSDistanceWithin(const Geometry* g1, const Geometry* g2, double dist)
304
0
    {
305
0
        return GEOSDistanceWithin_r(handle, g1, g2, dist);
306
0
    }
307
308
    int
309
    GEOSDistanceIndexed(const Geometry* g1, const Geometry* g2, double* dist)
310
0
    {
311
0
        return GEOSDistanceIndexed_r(handle, g1, g2, dist);
312
0
    }
313
314
    int
315
    GEOSHausdorffDistance(const Geometry* g1, const Geometry* g2, double* dist)
316
0
    {
317
0
        return GEOSHausdorffDistance_r(handle, g1, g2, dist);
318
0
    }
319
320
    int
321
    GEOSHausdorffDistanceDensify(const Geometry* g1, const Geometry* g2, double densifyFrac, double* dist)
322
0
    {
323
0
        return GEOSHausdorffDistanceDensify_r(handle, g1, g2, densifyFrac, dist);
324
0
    }
325
326
    int
327
    GEOSFrechetDistance(const Geometry* g1, const Geometry* g2, double* dist)
328
0
    {
329
0
        return GEOSFrechetDistance_r(handle, g1, g2, dist);
330
0
    }
331
332
    int
333
    GEOSFrechetDistanceDensify(const Geometry* g1, const Geometry* g2, double densifyFrac, double* dist)
334
0
    {
335
0
        return GEOSFrechetDistanceDensify_r(handle, g1, g2, densifyFrac, dist);
336
0
    }
337
338
    int
339
    GEOSArea(const Geometry* g, double* area)
340
0
    {
341
0
        return GEOSArea_r(handle, g, area);
342
0
    }
343
344
    int
345
    GEOSLength(const Geometry* g, double* length)
346
0
    {
347
0
        return GEOSLength_r(handle, g, length);
348
0
    }
349
350
    CoordinateSequence*
351
    GEOSNearestPoints(const Geometry* g1, const Geometry* g2)
352
0
    {
353
0
        return GEOSNearestPoints_r(handle, g1, g2);
354
0
    }
355
356
    GEOSClusterInfo*
357
    GEOSClusterDBSCAN(const GEOSGeometry* g, double eps, unsigned minPoints)
358
0
    {
359
0
        return GEOSClusterDBSCAN_r(handle, g, eps, minPoints);
360
0
    }
361
362
    GEOSClusterInfo*
363
    GEOSClusterGeometryDistance(const GEOSGeometry* g, double d)
364
0
    {
365
0
        return GEOSClusterGeometryDistance_r(handle, g, d);
366
0
    }
367
368
    GEOSClusterInfo*
369
    GEOSClusterGeometryIntersects(const GEOSGeometry* g)
370
0
    {
371
0
        return GEOSClusterGeometryIntersects_r(handle, g);
372
0
    }
373
374
    GEOSClusterInfo*
375
    GEOSClusterEnvelopeDistance(const GEOSGeometry* g, double d)
376
0
    {
377
0
        return GEOSClusterEnvelopeDistance_r(handle, g, d);
378
0
    }
379
380
    GEOSClusterInfo*
381
    GEOSClusterEnvelopeIntersects(const GEOSGeometry* g)
382
0
    {
383
0
        return GEOSClusterEnvelopeIntersects_r(handle, g);
384
0
    }
385
386
    std::size_t GEOSClusterInfo_getNumClusters(const GEOSClusterInfo* clusters)
387
0
    {
388
0
        return GEOSClusterInfo_getNumClusters_r(handle, clusters);
389
0
    }
390
391
    std::size_t GEOSClusterInfo_getClusterSize(const GEOSClusterInfo* clusters, size_t i)
392
0
    {
393
0
        return GEOSClusterInfo_getClusterSize_r(handle, clusters, i);
394
0
    }
395
396
    const std::size_t* GEOSClusterInfo_getInputsForClusterN(const GEOSClusterInfo* clusters, size_t i)
397
0
    {
398
0
        return GEOSClusterInfo_getInputsForClusterN_r(handle, clusters, i);
399
0
    }
400
401
    std::size_t* GEOSClusterInfo_getClustersForInputs(const GEOSClusterInfo* clusters)
402
0
    {
403
0
        return GEOSClusterInfo_getClustersForInputs_r(handle, clusters);
404
0
    }
405
406
    void GEOSClusterInfo_destroy(GEOSClusterInfo* info)
407
0
    {
408
0
        GEOSClusterInfo_destroy_r(handle, info);
409
0
    }
410
411
    Geometry*
412
    GEOSGeomFromWKT(const char* wkt)
413
9.83k
    {
414
9.83k
        return GEOSGeomFromWKT_r(handle, wkt);
415
9.83k
    }
416
417
    char*
418
    GEOSGeomToWKT(const Geometry* g)
419
8.80k
    {
420
8.80k
        return GEOSGeomToWKT_r(handle, g);
421
8.80k
    }
422
423
// Remember to free the result!
424
    unsigned char*
425
    GEOSGeomToWKB_buf(const Geometry* g, std::size_t* size)
426
8.14k
    {
427
8.14k
        return GEOSGeomToWKB_buf_r(handle, g, size);
428
8.14k
    }
429
430
    Geometry*
431
    GEOSGeomFromWKB_buf(const unsigned char* wkb, std::size_t size)
432
8.80k
    {
433
8.80k
        return GEOSGeomFromWKB_buf_r(handle, wkb, size);
434
8.80k
    }
435
436
    /* Read/write wkb hex values.  Returned geometries are
437
       owned by the caller.*/
438
    unsigned char*
439
    GEOSGeomToHEX_buf(const Geometry* g, std::size_t* size)
440
0
    {
441
0
        return GEOSGeomToHEX_buf_r(handle, g, size);
442
0
    }
443
444
    Geometry*
445
    GEOSGeomFromHEX_buf(const unsigned char* hex, std::size_t size)
446
0
    {
447
0
        return GEOSGeomFromHEX_buf_r(handle, hex, size);
448
0
    }
449
450
    char
451
    GEOSisEmpty(const Geometry* g)
452
0
    {
453
0
        return GEOSisEmpty_r(handle, g);
454
0
    }
455
456
    char
457
    GEOSisSimple(const Geometry* g)
458
0
    {
459
0
        return GEOSisSimple_r(handle, g);
460
0
    }
461
462
    char
463
    GEOSisRing(const Geometry* g)
464
0
    {
465
0
        return GEOSisRing_r(handle, g);
466
0
    }
467
468
469
470
//free the result of this
471
    char*
472
    GEOSGeomType(const Geometry* g)
473
0
    {
474
0
        return GEOSGeomType_r(handle, g);
475
0
    }
476
477
// Return postgis geometry type index
478
    int
479
    GEOSGeomTypeId(const Geometry* g)
480
0
    {
481
0
        return GEOSGeomTypeId_r(handle, g);
482
0
    }
483
484
485
486
487
//-------------------------------------------------------------------
488
// GEOS functions that return geometries
489
//-------------------------------------------------------------------
490
491
    Geometry*
492
    GEOSEnvelope(const Geometry* g)
493
0
    {
494
0
        return GEOSEnvelope_r(handle, g);
495
0
    }
496
497
    Geometry*
498
    GEOSIntersection(const Geometry* g1, const Geometry* g2)
499
8.14k
    {
500
8.14k
        return GEOSIntersection_r(handle, g1, g2);
501
8.14k
    }
502
503
    Geometry*
504
    GEOSIntersectionPrec(const Geometry* g1, const Geometry* g2, double gridSize)
505
0
    {
506
0
        return GEOSIntersectionPrec_r(handle, g1, g2, gridSize);
507
0
    }
508
509
    Geometry*
510
    GEOSBuffer(const Geometry* g, double width, int quadrantsegments)
511
0
    {
512
0
        return GEOSBuffer_r(handle, g, width, quadrantsegments);
513
0
    }
514
515
    Geometry*
516
    GEOSBufferWithStyle(const Geometry* g, double width, int quadsegs,
517
                        int endCapStyle, int joinStyle, double mitreLimit)
518
0
    {
519
0
        return GEOSBufferWithStyle_r(handle, g, width, quadsegs, endCapStyle,
520
0
                                     joinStyle, mitreLimit);
521
0
    }
522
523
    Geometry*
524
    GEOSDensify(const Geometry* g, double tolerance)
525
0
    {
526
0
        return GEOSDensify_r(handle, g, tolerance);
527
0
    }
528
529
530
    Geometry*
531
    GEOSSingleSidedBuffer(const Geometry* g, double width, int quadsegs,
532
                          int joinStyle, double mitreLimit, int leftSide)
533
0
    {
534
0
        return GEOSSingleSidedBuffer_r(handle, g, width, quadsegs,
535
0
                                       joinStyle, mitreLimit, leftSide);
536
0
    }
537
538
    Geometry*
539
    GEOSOffsetCurve(const Geometry* g, double width, int quadsegs,
540
                    int joinStyle, double mitreLimit)
541
0
    {
542
0
        return GEOSOffsetCurve_r(handle, g, width, quadsegs,
543
0
                                 joinStyle, mitreLimit);
544
0
    }
545
546
    Geometry*
547
    GEOSConvexHull(const Geometry* g)
548
0
    {
549
0
        return GEOSConvexHull_r(handle, g);
550
0
    }
551
552
    Geometry*
553
    GEOSConcaveHull(const Geometry* g,
554
                    double ratio,
555
                    unsigned int allowHoles)
556
557
0
    {
558
0
        return GEOSConcaveHull_r(handle, g, ratio, allowHoles);
559
0
    }
560
561
    Geometry*
562
    GEOSConcaveHullByLength(const Geometry* g,
563
                    double length,
564
                    unsigned int allowHoles)
565
566
0
    {
567
0
        return GEOSConcaveHullByLength_r(handle, g, length, allowHoles);
568
0
    }
569
570
    Geometry*
571
    GEOSPolygonHullSimplify(const Geometry* g,
572
                            unsigned int isOuter,
573
                            double vertexNumFraction)
574
0
    {
575
0
        return GEOSPolygonHullSimplify_r(handle, g, isOuter, vertexNumFraction);
576
0
    }
577
578
    Geometry*
579
    GEOSPolygonHullSimplifyMode(const Geometry* g,
580
                            unsigned int isOuter,
581
                            unsigned int parameterMode,
582
                            double parameter)
583
0
    {
584
0
        return GEOSPolygonHullSimplifyMode_r(handle, g, isOuter, parameterMode, parameter);
585
0
    }
586
587
    Geometry*
588
    GEOSConcaveHullOfPolygons(const Geometry* g,
589
        double lengthRatio,
590
        unsigned int isTight,
591
        unsigned int isHolesAllowed)
592
0
    {
593
0
        return GEOSConcaveHullOfPolygons_r(handle,
594
0
            g, lengthRatio, isTight, isHolesAllowed);
595
0
    }
596
597
    Geometry*
598
    GEOSMinimumRotatedRectangle(const Geometry* g)
599
0
    {
600
0
        return GEOSMinimumRotatedRectangle_r(handle, g);
601
0
    }
602
603
    Geometry*
604
    GEOSMaximumInscribedCircle(const Geometry* g, double tolerance)
605
0
    {
606
0
        return GEOSMaximumInscribedCircle_r(handle, g, tolerance);
607
0
    }
608
609
    Geometry*
610
    GEOSLargestEmptyCircle(const Geometry* g, const Geometry* boundary, double tolerance)
611
0
    {
612
0
        return GEOSLargestEmptyCircle_r(handle, g, boundary, tolerance);
613
0
    }
614
615
    Geometry*
616
    GEOSMinimumWidth(const Geometry* g)
617
0
    {
618
0
        return GEOSMinimumWidth_r(handle, g);
619
0
    }
620
621
    Geometry*
622
    GEOSMinimumClearanceLine(const Geometry* g)
623
0
    {
624
0
        return GEOSMinimumClearanceLine_r(handle, g);
625
0
    }
626
627
    int
628
    GEOSMinimumClearance(const Geometry* g, double* d)
629
0
    {
630
0
        return GEOSMinimumClearance_r(handle, g, d);
631
0
    }
632
633
    Geometry*
634
    GEOSDifference(const Geometry* g1, const Geometry* g2)
635
8.14k
    {
636
8.14k
        return GEOSDifference_r(handle, g1, g2);
637
8.14k
    }
638
639
    Geometry*
640
    GEOSDifferencePrec(const Geometry* g1, const Geometry* g2, double gridSize)
641
0
    {
642
0
        return GEOSDifferencePrec_r(handle, g1, g2, gridSize);
643
0
    }
644
645
    Geometry*
646
    GEOSBoundary(const Geometry* g)
647
0
    {
648
0
        return GEOSBoundary_r(handle, g);
649
0
    }
650
651
    Geometry*
652
    GEOSSymDifference(const Geometry* g1, const Geometry* g2)
653
0
    {
654
0
        return GEOSSymDifference_r(handle, g1, g2);
655
0
    }
656
657
    Geometry*
658
    GEOSSymDifferencePrec(const Geometry* g1, const Geometry* g2, double gridSize)
659
0
    {
660
0
        return GEOSSymDifferencePrec_r(handle, g1, g2, gridSize);
661
0
    }
662
663
    Geometry*
664
    GEOSUnion(const Geometry* g1, const Geometry* g2)
665
8.14k
    {
666
8.14k
        return GEOSUnion_r(handle, g1, g2);
667
8.14k
    }
668
669
    Geometry*
670
    GEOSUnionPrec(const Geometry* g1, const Geometry* g2, double gridSize)
671
0
    {
672
0
        return GEOSUnionPrec_r(handle, g1, g2, gridSize);
673
0
    }
674
675
    Geometry*
676
    GEOSUnaryUnion(const Geometry* g)
677
0
    {
678
0
        return GEOSUnaryUnion_r(handle, g);
679
0
    }
680
681
    Geometry*
682
    GEOSUnaryUnionPrec(const Geometry* g, double gridSize)
683
0
    {
684
0
        return GEOSUnaryUnionPrec_r(handle, g, gridSize);
685
0
    }
686
687
    Geometry*
688
    GEOSCoverageUnion(const Geometry* g)
689
0
    {
690
0
        return GEOSCoverageUnion_r(handle, g);
691
0
    }
692
693
    Geometry*
694
    GEOSDisjointSubsetUnion(const Geometry* g)
695
0
    {
696
0
        return GEOSDisjointSubsetUnion_r(handle, g);
697
0
    }
698
699
    Geometry*
700
    GEOSNode(const Geometry* g)
701
0
    {
702
0
        return GEOSNode_r(handle, g);
703
0
    }
704
705
    Geometry*
706
    GEOSUnionCascaded(const Geometry* g)
707
0
    {
708
0
        return GEOSUnionCascaded_r(handle, g);
709
0
    }
710
711
    Geometry*
712
    GEOSPointOnSurface(const Geometry* g)
713
0
    {
714
0
        return GEOSPointOnSurface_r(handle, g);
715
0
    }
716
717
718
    Geometry*
719
    GEOSClipByRect(const Geometry* g, double xmin, double ymin, double xmax, double ymax)
720
0
    {
721
0
        return GEOSClipByRect_r(handle, g, xmin, ymin, xmax, ymax);
722
0
    }
723
724
725
    Geometry*
726
0
    GEOSGeom_transformXY(const GEOSGeometry* g, GEOSTransformXYCallback callback, void* userdata) {
727
0
        return GEOSGeom_transformXY_r(handle, g, callback, userdata);
728
0
    }
729
730
731
    Geometry*
732
0
    GEOSGeom_transformXYZ(const GEOSGeometry* g, GEOSTransformXYZCallback callback, void* userdata) {
733
0
        return GEOSGeom_transformXYZ_r(handle, g, callback, userdata);
734
0
    }
735
736
737
//-------------------------------------------------------------------
738
// memory management functions
739
//------------------------------------------------------------------
740
741
742
    void
743
    GEOSGeom_destroy(Geometry* a)
744
41.3k
    {
745
41.3k
        return GEOSGeom_destroy_r(handle, a);
746
41.3k
    }
747
748
749
    int
750
    GEOSGetNumCoordinates(const Geometry* g)
751
0
    {
752
0
        return GEOSGetNumCoordinates_r(handle, g);
753
0
    }
754
755
    /*
756
     * Return -1 on exception, 0 otherwise.
757
     * Converts Geometry to normal form (or canonical form).
758
     */
759
    int
760
    GEOSNormalize(Geometry* g)
761
0
    {
762
0
        return GEOSNormalize_r(handle, g);
763
0
    }
764
765
    int
766
    GEOSOrientPolygons(Geometry* g, int exteriorCW)
767
0
    {
768
0
        return GEOSOrientPolygons_r(handle, g, exteriorCW);
769
0
    }
770
771
    int
772
    GEOSGetNumInteriorRings(const Geometry* g)
773
0
    {
774
0
        return GEOSGetNumInteriorRings_r(handle, g);
775
0
    }
776
777
778
// returns -1 on error and 1 for non-multi geometries
779
    int
780
    GEOSGetNumGeometries(const Geometry* g)
781
0
    {
782
0
        return GEOSGetNumGeometries_r(handle, g);
783
0
    }
784
785
786
    /*
787
     * Call only on GEOMETRYCOLLECTION or MULTI*.
788
     * Return a pointer to the internal Geometry.
789
     */
790
    const Geometry*
791
    GEOSGetGeometryN(const Geometry* g, int n)
792
0
    {
793
0
        return GEOSGetGeometryN_r(handle, g, n);
794
0
    }
795
796
    /*
797
     * Call only on LINESTRING
798
     * Returns NULL on exception
799
     */
800
    Geometry*
801
    GEOSGeomGetPointN(const Geometry* g, int n)
802
0
    {
803
0
        return GEOSGeomGetPointN_r(handle, g, n);
804
0
    }
805
806
    /*
807
     * Call only on LINESTRING
808
     */
809
    Geometry*
810
    GEOSGeomGetStartPoint(const Geometry* g)
811
0
    {
812
0
        return GEOSGeomGetStartPoint_r(handle, g);
813
0
    }
814
815
    /*
816
     * Call only on LINESTRING
817
     */
818
    Geometry*
819
    GEOSGeomGetEndPoint(const Geometry* g)
820
0
    {
821
0
        return GEOSGeomGetEndPoint_r(handle, g);
822
0
    }
823
824
    /*
825
     * Call only on LINESTRING
826
     * return 2 on exception, 1 on true, 0 on false
827
     */
828
    char
829
    GEOSisClosed(const Geometry* g)
830
0
    {
831
0
        return GEOSisClosed_r(handle, g);
832
0
    }
833
834
    /*
835
     * Call only on LINESTRING
836
     * returns 0 on exception, otherwise 1
837
     */
838
    int
839
    GEOSGeomGetLength(const Geometry* g, double* length)
840
0
    {
841
0
        return GEOSGeomGetLength_r(handle, g, length);
842
0
    }
843
844
    /*
845
     * Call only on LINESTRING
846
     * returns -1 on exception
847
     */
848
    int
849
    GEOSGeomGetNumPoints(const Geometry* g)
850
0
    {
851
0
        return GEOSGeomGetNumPoints_r(handle, g);
852
0
    }
853
854
    /*
855
     * For POINT
856
     * returns 0 on exception, otherwise 1
857
     */
858
    int
859
    GEOSGeomGetX(const Geometry* g, double* x)
860
0
    {
861
0
        return GEOSGeomGetX_r(handle, g, x);
862
0
    }
863
864
    /*
865
     * For POINT
866
     * returns 0 on exception, otherwise 1
867
     */
868
    int
869
    GEOSGeomGetY(const Geometry* g, double* y)
870
0
    {
871
0
        return GEOSGeomGetY_r(handle, g, y);
872
0
    }
873
874
    /*
875
     * For POINT
876
     * returns 0 on exception, otherwise 1
877
     */
878
    int
879
    GEOSGeomGetZ(const Geometry* g1, double* z)
880
0
    {
881
0
        return GEOSGeomGetZ_r(handle, g1, z);
882
0
    }
883
884
    /*
885
     * For POINT
886
     * returns 0 on exception, otherwise 1
887
     */
888
    int
889
    GEOSGeomGetM(const Geometry* g1, double* m)
890
0
    {
891
0
        return GEOSGeomGetM_r(handle, g1, m);
892
0
    }
893
894
    /*
895
     * Call only on polygon
896
     * Return a copy of the internal Geometry.
897
     */
898
    const Geometry*
899
    GEOSGetExteriorRing(const Geometry* g)
900
0
    {
901
0
        return GEOSGetExteriorRing_r(handle, g);
902
0
    }
903
904
    /*
905
     * Call only on polygon
906
     * Return a pointer to internal storage, do not destroy it.
907
     */
908
    const Geometry*
909
    GEOSGetInteriorRingN(const Geometry* g, int n)
910
0
    {
911
0
        return GEOSGetInteriorRingN_r(handle, g, n);
912
0
    }
913
914
    Geometry*
915
    GEOSGetCentroid(const Geometry* g)
916
0
    {
917
0
        return GEOSGetCentroid_r(handle, g);
918
0
    }
919
920
    int
921
    GEOSHilbertCode(const GEOSGeometry *geom, const GEOSGeometry* extent,
922
                unsigned int level, unsigned int *code)
923
0
    {
924
0
        return GEOSHilbertCode_r(handle, geom, extent, level, code);
925
0
    }
926
927
    Geometry*
928
    GEOSMinimumBoundingCircle(const Geometry* g, double* radius, Geometry** center)
929
0
    {
930
0
        return GEOSMinimumBoundingCircle_r(handle, g, radius, center);
931
0
    }
932
933
    Geometry*
934
    GEOSGeom_createCollection(int type, Geometry** geoms, unsigned int ngeoms)
935
0
    {
936
0
        return GEOSGeom_createCollection_r(handle, type, geoms, ngeoms);
937
0
    }
938
939
    Geometry**
940
    GEOSGeom_releaseCollection(Geometry* collection, unsigned int * ngeoms)
941
0
    {
942
0
        return GEOSGeom_releaseCollection_r(handle, collection, ngeoms);
943
0
    }
944
945
    Geometry*
946
    GEOSPolygonize(const Geometry* const* g, unsigned int ngeoms)
947
0
    {
948
0
        return GEOSPolygonize_r(handle, g, ngeoms);
949
0
    }
950
951
    Geometry*
952
    GEOSPolygonize_valid(const Geometry* const* g, unsigned int ngeoms)
953
0
    {
954
0
        return GEOSPolygonize_valid_r(handle, g, ngeoms);
955
0
    }
956
957
    Geometry*
958
    GEOSPolygonizer_getCutEdges(const Geometry* const* g, unsigned int ngeoms)
959
0
    {
960
0
        return GEOSPolygonizer_getCutEdges_r(handle, g, ngeoms);
961
0
    }
962
963
    GEOSGeometry*
964
    GEOSPolygonize_full(const GEOSGeometry* input,
965
                        GEOSGeometry** cuts, GEOSGeometry** dangles, GEOSGeometry** invalid)
966
0
    {
967
0
        return GEOSPolygonize_full_r(handle, input, cuts, dangles, invalid);
968
0
    }
969
970
    Geometry*
971
    GEOSBuildArea(const Geometry* g)
972
0
    {
973
0
        return GEOSBuildArea_r(handle, g);
974
0
    }
975
976
    Geometry*
977
    GEOSMakeValid(const Geometry* g)
978
0
    {
979
0
        return GEOSMakeValid_r(handle, g);
980
0
    }
981
982
    GEOSMakeValidParams*
983
    GEOSMakeValidParams_create()
984
0
    {
985
0
        return GEOSMakeValidParams_create_r(handle);
986
0
    }
987
988
    void
989
    GEOSMakeValidParams_destroy(GEOSMakeValidParams* parms)
990
0
    {
991
0
        return GEOSMakeValidParams_destroy_r(handle, parms);
992
0
    }
993
994
    int
995
    GEOSMakeValidParams_setMethod(
996
        GEOSMakeValidParams* p,
997
        GEOSMakeValidMethods method)
998
0
    {
999
0
        return GEOSMakeValidParams_setMethod_r(handle, p, method);
1000
0
    }
1001
1002
    int
1003
    GEOSMakeValidParams_setKeepCollapsed(
1004
        GEOSMakeValidParams* p,
1005
        int keepCollapsed)
1006
0
    {
1007
0
        return GEOSMakeValidParams_setKeepCollapsed_r(handle, p, keepCollapsed);
1008
0
    }
1009
1010
    Geometry*
1011
    GEOSMakeValidWithParams(
1012
        const Geometry* g,
1013
        const GEOSMakeValidParams* params)
1014
0
    {
1015
0
        return GEOSMakeValidWithParams_r(handle, g, params);
1016
0
    }
1017
1018
    GEOSCoverageCleanParams*
1019
    GEOSCoverageCleanParams_create()
1020
0
    {
1021
0
        return GEOSCoverageCleanParams_create_r(handle);
1022
0
    }
1023
1024
    void
1025
    GEOSCoverageCleanParams_destroy(
1026
        GEOSCoverageCleanParams* params)
1027
0
    {
1028
0
        return GEOSCoverageCleanParams_destroy_r(handle, params);
1029
0
    }
1030
1031
    int
1032
    GEOSCoverageCleanParams_setSnappingDistance(
1033
        GEOSCoverageCleanParams* params, double snappingDistance)
1034
0
    {
1035
0
        return GEOSCoverageCleanParams_setSnappingDistance_r(
1036
0
            handle, params, snappingDistance);
1037
0
    }
1038
1039
    int
1040
    GEOSCoverageCleanParams_setGapMaximumWidth(
1041
        GEOSCoverageCleanParams* params, double gapMaximumWidth)
1042
0
    {
1043
0
        return GEOSCoverageCleanParams_setGapMaximumWidth_r(
1044
0
            handle, params, gapMaximumWidth);
1045
0
    }
1046
1047
    int
1048
    GEOSCoverageCleanParams_setOverlapMergeStrategy(
1049
        GEOSCoverageCleanParams* params, int overlapMergeStrategy)
1050
0
    {
1051
0
        return GEOSCoverageCleanParams_setOverlapMergeStrategy_r(
1052
0
            handle, params, overlapMergeStrategy);
1053
0
    }
1054
1055
    GEOSGeometry *
1056
    GEOSCoverageCleanWithParams(
1057
        const GEOSGeometry* input,
1058
        const GEOSCoverageCleanParams* params)
1059
0
    {
1060
0
        return GEOSCoverageCleanWithParams_r(
1061
0
            handle, input, params);
1062
0
    }
1063
1064
    GEOSGeometry *
1065
    GEOSCoverageClean(
1066
        const GEOSGeometry * input)
1067
0
    {
1068
0
        return GEOSCoverageClean_r(
1069
0
            handle, input);
1070
0
    }
1071
1072
    Geometry*
1073
    GEOSRemoveRepeatedPoints(
1074
        const Geometry* g,
1075
        double tolerance)
1076
0
    {
1077
0
        return GEOSRemoveRepeatedPoints_r(handle, g, tolerance);
1078
0
    }
1079
1080
    Geometry*
1081
    GEOSLineMerge(const Geometry* g)
1082
0
    {
1083
0
        return GEOSLineMerge_r(handle, g);
1084
0
    }
1085
1086
    Geometry*
1087
    GEOSLineMergeDirected(const Geometry* g)
1088
0
    {
1089
0
        return GEOSLineMergeDirected_r(handle, g);
1090
0
    }
1091
1092
    Geometry*
1093
    GEOSLineSubstring(const Geometry* g, double start_fraction, double end_fraction)
1094
0
    {
1095
0
        return GEOSLineSubstring_r(handle, g, start_fraction, end_fraction);
1096
0
    }
1097
1098
    Geometry*
1099
    GEOSReverse(const Geometry* g)
1100
0
    {
1101
0
        return GEOSReverse_r(handle, g);
1102
0
    }
1103
1104
    int
1105
    GEOSGetSRID(const Geometry* g)
1106
0
    {
1107
0
        return GEOSGetSRID_r(handle, g);
1108
0
    }
1109
1110
    void
1111
    GEOSSetSRID(Geometry* g, int srid)
1112
0
    {
1113
0
        return GEOSSetSRID_r(handle, g, srid);
1114
0
    }
1115
1116
    void*
1117
    GEOSGeom_getUserData(const Geometry* g)
1118
0
    {
1119
0
        return GEOSGeom_getUserData_r(handle, g);
1120
0
    }
1121
1122
    void
1123
    GEOSGeom_setUserData(Geometry* g, void* userData)
1124
0
    {
1125
0
        return GEOSGeom_setUserData_r(handle, g, userData);
1126
0
    }
1127
1128
    char
1129
    GEOSHasZ(const Geometry* g)
1130
0
    {
1131
0
        return GEOSHasZ_r(handle, g);
1132
0
    }
1133
1134
    char
1135
    GEOSHasM(const Geometry* g)
1136
0
    {
1137
0
        return GEOSHasM_r(handle, g);
1138
0
    }
1139
1140
    int
1141
    GEOS_getWKBOutputDims()
1142
0
    {
1143
0
        return GEOS_getWKBOutputDims_r(handle);
1144
0
    }
1145
1146
    int
1147
    GEOS_setWKBOutputDims(int newdims)
1148
0
    {
1149
0
        return GEOS_setWKBOutputDims_r(handle, newdims);
1150
0
    }
1151
1152
    int
1153
    GEOS_getWKBByteOrder()
1154
0
    {
1155
0
        return GEOS_getWKBByteOrder_r(handle);
1156
0
    }
1157
1158
    int
1159
    GEOS_setWKBByteOrder(int byteOrder)
1160
0
    {
1161
0
        return GEOS_setWKBByteOrder_r(handle, byteOrder);
1162
0
    }
1163
1164
    CoordinateSequence*
1165
    GEOSCoordSeq_create(unsigned int size, unsigned int dims)
1166
0
    {
1167
0
        return GEOSCoordSeq_create_r(handle, size, dims);
1168
0
    }
1169
1170
    CoordinateSequence*
1171
    GEOSCoordSeq_createWithDimensions(unsigned int size, int hasZ, int hasM)
1172
0
    {
1173
0
        return GEOSCoordSeq_createWithDimensions_r(handle, size, hasZ, hasM);
1174
0
    }
1175
1176
    CoordinateSequence*
1177
    GEOSCoordSeq_copyFromBuffer(const double* buf, unsigned int size, int hasZ, int hasM)
1178
0
    {
1179
0
        return GEOSCoordSeq_copyFromBuffer_r(handle, buf, size, hasZ, hasM);
1180
0
    }
1181
1182
    int
1183
    GEOSCoordSeq_copyToBuffer(const CoordinateSequence* s, double* buf, int hasZ, int hasM)
1184
0
    {
1185
0
        return GEOSCoordSeq_copyToBuffer_r(handle, s, buf, hasZ, hasM);
1186
0
    }
1187
1188
    CoordinateSequence*
1189
    GEOSCoordSeq_copyFromArrays(const double* x, const double* y, const double* z, const double* m, unsigned int size)
1190
0
    {
1191
0
        return GEOSCoordSeq_copyFromArrays_r(handle, x, y, z, m, size);
1192
0
    }
1193
1194
    int
1195
    GEOSCoordSeq_copyToArrays(const CoordinateSequence* s, double* x, double* y, double* z, double* m)
1196
0
    {
1197
0
        return GEOSCoordSeq_copyToArrays_r(handle, s, x, y, z, m);
1198
0
    }
1199
1200
    char
1201
    GEOSCoordSeq_hasZ(CoordinateSequence* s)
1202
0
    {
1203
0
        return GEOSCoordSeq_hasZ_r(handle, s);
1204
0
    }
1205
1206
    char
1207
    GEOSCoordSeq_hasM(CoordinateSequence* s)
1208
0
    {
1209
0
        return GEOSCoordSeq_hasM_r(handle, s);
1210
0
    }
1211
1212
    int
1213
    GEOSCoordSeq_setOrdinate(CoordinateSequence* s, unsigned int idx, unsigned int dim, double val)
1214
0
    {
1215
0
        return GEOSCoordSeq_setOrdinate_r(handle, s, idx, dim, val);
1216
0
    }
1217
1218
    int
1219
    GEOSCoordSeq_setX(CoordinateSequence* s, unsigned int idx, double val)
1220
0
    {
1221
0
        return GEOSCoordSeq_setOrdinate(s, idx, CoordinateSequence::X, val);
1222
0
    }
1223
1224
    int
1225
    GEOSCoordSeq_setY(CoordinateSequence* s, unsigned int idx, double val)
1226
0
    {
1227
0
        return GEOSCoordSeq_setOrdinate(s, idx, CoordinateSequence::Y, val);
1228
0
    }
1229
1230
    int
1231
    GEOSCoordSeq_setZ(CoordinateSequence* s, unsigned int idx, double val)
1232
0
    {
1233
0
        return GEOSCoordSeq_setOrdinate(s, idx, CoordinateSequence::Z, val);
1234
0
    }
1235
1236
    int
1237
    GEOSCoordSeq_setM(CoordinateSequence* s, unsigned int idx, double val)
1238
0
    {
1239
0
        return GEOSCoordSeq_setOrdinate(s, idx, CoordinateSequence::M, val);
1240
0
    }
1241
1242
    int
1243
    GEOSCoordSeq_setXY(CoordinateSequence* s, unsigned int idx, double x, double y)
1244
0
    {
1245
0
        return GEOSCoordSeq_setXY_r(handle, s, idx, x, y);
1246
0
    }
1247
1248
    int
1249
    GEOSCoordSeq_setXYZ(CoordinateSequence* s, unsigned int idx, double x, double y, double z)
1250
0
    {
1251
0
        return GEOSCoordSeq_setXYZ_r(handle, s, idx, x, y, z);
1252
0
    }
1253
1254
    CoordinateSequence*
1255
    GEOSCoordSeq_clone(const CoordinateSequence* s)
1256
0
    {
1257
0
        return GEOSCoordSeq_clone_r(handle, s);
1258
0
    }
1259
1260
    int
1261
    GEOSCoordSeq_getOrdinate(const CoordinateSequence* s, unsigned int idx, unsigned int dim, double* val)
1262
0
    {
1263
0
        return GEOSCoordSeq_getOrdinate_r(handle, s, idx, dim, val);
1264
0
    }
1265
1266
    int
1267
    GEOSCoordSeq_getX(const CoordinateSequence* s, unsigned int idx, double* val)
1268
0
    {
1269
0
        return GEOSCoordSeq_getOrdinate(s, idx, CoordinateSequence::X, val);
1270
0
    }
1271
1272
    int
1273
    GEOSCoordSeq_getY(const CoordinateSequence* s, unsigned int idx, double* val)
1274
0
    {
1275
0
        return GEOSCoordSeq_getOrdinate(s, idx, CoordinateSequence::Y, val);
1276
0
    }
1277
1278
    int
1279
    GEOSCoordSeq_getZ(const CoordinateSequence* s, unsigned int idx, double* val)
1280
0
    {
1281
0
        return GEOSCoordSeq_getOrdinate(s, idx, CoordinateSequence::Z, val);
1282
0
    }
1283
1284
    int
1285
    GEOSCoordSeq_getM(const CoordinateSequence* s, unsigned int idx, double* val)
1286
0
    {
1287
0
        return GEOSCoordSeq_getOrdinate(s, idx, CoordinateSequence::M, val);
1288
0
    }
1289
1290
    int
1291
    GEOSCoordSeq_getXY(const CoordinateSequence* s, unsigned int idx, double* x, double* y)
1292
0
    {
1293
0
        return GEOSCoordSeq_getXY_r(handle, s, idx, x, y);
1294
0
    }
1295
1296
    int
1297
    GEOSCoordSeq_getXYZ(const CoordinateSequence* s, unsigned int idx, double* x, double* y, double* z)
1298
0
    {
1299
0
        return GEOSCoordSeq_getXYZ_r(handle, s, idx, x, y, z);
1300
0
    }
1301
1302
    int
1303
    GEOSCoordSeq_getSize(const CoordinateSequence* s, unsigned int* size)
1304
0
    {
1305
0
        return GEOSCoordSeq_getSize_r(handle, s, size);
1306
0
    }
1307
1308
    int
1309
    GEOSCoordSeq_getDimensions(const CoordinateSequence* s, unsigned int* dims)
1310
0
    {
1311
0
        return GEOSCoordSeq_getDimensions_r(handle, s, dims);
1312
0
    }
1313
1314
    int
1315
    GEOSCoordSeq_isCCW(const CoordinateSequence* s, char* is_ccw)
1316
0
    {
1317
0
        return GEOSCoordSeq_isCCW_r(handle, s, is_ccw);
1318
0
    }
1319
1320
    void
1321
    GEOSCoordSeq_destroy(CoordinateSequence* s)
1322
0
    {
1323
0
        return GEOSCoordSeq_destroy_r(handle, s);
1324
0
    }
1325
1326
    const CoordinateSequence*
1327
    GEOSGeom_getCoordSeq(const Geometry* g)
1328
0
    {
1329
0
        return GEOSGeom_getCoordSeq_r(handle, g);
1330
0
    }
1331
1332
    Geometry*
1333
    GEOSGeom_createPoint(CoordinateSequence* cs)
1334
0
    {
1335
0
        return GEOSGeom_createPoint_r(handle, cs);
1336
0
    }
1337
1338
    Geometry*
1339
    GEOSGeom_createPointFromXY(double x, double y)
1340
0
    {
1341
0
        return GEOSGeom_createPointFromXY_r(handle, x, y);
1342
0
    }
1343
1344
    Geometry*
1345
    GEOSGeom_createLinearRing(CoordinateSequence* cs)
1346
0
    {
1347
0
        return GEOSGeom_createLinearRing_r(handle, cs);
1348
0
    }
1349
1350
    Geometry*
1351
    GEOSGeom_createLineString(CoordinateSequence* cs)
1352
0
    {
1353
0
        return GEOSGeom_createLineString_r(handle, cs);
1354
0
    }
1355
1356
    Geometry*
1357
    GEOSGeom_createPolygon(Geometry* shell, Geometry** holes, unsigned int nholes)
1358
0
    {
1359
0
        return GEOSGeom_createPolygon_r(handle, shell, holes, nholes);
1360
0
    }
1361
1362
    Geometry*
1363
    GEOSGeom_createCircularString(CoordinateSequence* cs)
1364
0
    {
1365
0
        return GEOSGeom_createCircularString_r(handle, cs);
1366
0
    }
1367
1368
    Geometry*
1369
    GEOSGeom_createCompoundCurve(Geometry** curves, unsigned int ngeoms)
1370
0
    {
1371
0
        return GEOSGeom_createCompoundCurve_r(handle, curves, ngeoms);
1372
0
    }
1373
1374
    Geometry*
1375
    GEOSGeom_createCurvePolygon(Geometry* shell, Geometry** holes, unsigned int nholes)
1376
0
    {
1377
0
        return GEOSGeom_createCurvePolygon_r(handle, shell, holes, nholes);
1378
0
    }
1379
1380
    Geometry*
1381
    GEOSGeom_clone(const Geometry* g)
1382
0
    {
1383
0
        return GEOSGeom_clone_r(handle, g);
1384
0
    }
1385
1386
    GEOSGeometry*
1387
    GEOSGeom_setPrecision(const GEOSGeometry* g, double gridSize, int flags)
1388
0
    {
1389
0
        return GEOSGeom_setPrecision_r(handle, g, gridSize, flags);
1390
0
    }
1391
1392
    double
1393
    GEOSGeom_getPrecision(const GEOSGeometry* g)
1394
0
    {
1395
0
        return GEOSGeom_getPrecision_r(handle, g);
1396
0
    }
1397
1398
    int
1399
    GEOSGeom_getDimensions(const Geometry* g)
1400
0
    {
1401
0
        return GEOSGeom_getDimensions_r(handle, g);
1402
0
    }
1403
1404
    int
1405
    GEOSGeom_getCoordinateDimension(const Geometry* g)
1406
0
    {
1407
0
        return GEOSGeom_getCoordinateDimension_r(handle, g);
1408
0
    }
1409
1410
    int GEOS_DLL GEOSGeom_getXMin(const GEOSGeometry* g, double* value)
1411
0
    {
1412
0
        return GEOSGeom_getXMin_r(handle, g, value);
1413
0
    }
1414
1415
    int GEOS_DLL GEOSGeom_getYMin(const GEOSGeometry* g, double* value)
1416
0
    {
1417
0
        return GEOSGeom_getYMin_r(handle, g, value);
1418
0
    }
1419
1420
    int GEOS_DLL GEOSGeom_getXMax(const GEOSGeometry* g, double* value)
1421
0
    {
1422
0
        return GEOSGeom_getXMax_r(handle, g, value);
1423
0
    }
1424
1425
    int GEOS_DLL GEOSGeom_getYMax(const GEOSGeometry* g, double* value)
1426
0
    {
1427
0
        return GEOSGeom_getYMax_r(handle, g, value);
1428
0
    }
1429
1430
    int GEOS_DLL GEOSGeom_getExtent(const GEOSGeometry* g, double* xmin, double* ymin, double* xmax, double* ymax)
1431
0
    {
1432
0
        return GEOSGeom_getExtent_r(handle, g, xmin, ymin, xmax, ymax);
1433
0
    }
1434
1435
    Geometry*
1436
    GEOSSimplify(const Geometry* g, double tolerance)
1437
0
    {
1438
0
        return GEOSSimplify_r(handle, g, tolerance);
1439
0
    }
1440
1441
    Geometry*
1442
    GEOSTopologyPreserveSimplify(const Geometry* g, double tolerance)
1443
0
    {
1444
0
        return GEOSTopologyPreserveSimplify_r(handle, g, tolerance);
1445
0
    }
1446
1447
1448
    /* WKT Reader */
1449
    WKTReader*
1450
    GEOSWKTReader_create()
1451
0
    {
1452
0
        return GEOSWKTReader_create_r(handle);
1453
0
    }
1454
1455
    void
1456
    GEOSWKTReader_destroy(WKTReader* reader)
1457
0
    {
1458
0
        GEOSWKTReader_destroy_r(handle, reader);
1459
0
    }
1460
1461
    void
1462
    GEOSWKTReader_setFixStructure(WKTReader* reader, char doFix)
1463
0
    {
1464
0
        GEOSWKTReader_setFixStructure_r(handle, reader, doFix);
1465
0
    }
1466
1467
    Geometry*
1468
    GEOSWKTReader_read(WKTReader* reader, const char* wkt)
1469
0
    {
1470
0
        return GEOSWKTReader_read_r(handle, reader, wkt);
1471
0
    }
1472
1473
    /* WKT Writer */
1474
    WKTWriter*
1475
    GEOSWKTWriter_create()
1476
0
    {
1477
0
        return GEOSWKTWriter_create_r(handle);
1478
0
    }
1479
1480
    void
1481
    GEOSWKTWriter_destroy(WKTWriter* Writer)
1482
0
    {
1483
0
        GEOSWKTWriter_destroy_r(handle, Writer);
1484
0
    }
1485
1486
    char*
1487
    GEOSWKTWriter_write(WKTWriter* writer, const Geometry* geom)
1488
0
    {
1489
0
        return GEOSWKTWriter_write_r(handle, writer, geom);
1490
0
    }
1491
1492
    void
1493
    GEOSWKTWriter_setTrim(WKTWriter* writer, char trim)
1494
0
    {
1495
0
        GEOSWKTWriter_setTrim_r(handle, writer, trim);
1496
0
    }
1497
1498
    void
1499
    GEOSWKTWriter_setRoundingPrecision(WKTWriter* writer, int precision)
1500
0
    {
1501
0
        return GEOSWKTWriter_setRoundingPrecision_r(handle, writer, precision);
1502
0
    }
1503
1504
    void
1505
    GEOSWKTWriter_setOutputDimension(WKTWriter* writer, int dim)
1506
0
    {
1507
0
        GEOSWKTWriter_setOutputDimension_r(handle, writer, dim);
1508
0
    }
1509
1510
    int
1511
    GEOSWKTWriter_getOutputDimension(WKTWriter* writer)
1512
0
    {
1513
0
        return GEOSWKTWriter_getOutputDimension_r(handle, writer);
1514
0
    }
1515
1516
    void
1517
    GEOSWKTWriter_setOld3D(WKTWriter* writer, int useOld3D)
1518
0
    {
1519
0
        GEOSWKTWriter_setOld3D_r(handle, writer, useOld3D);
1520
0
    }
1521
1522
    /* WKB Reader */
1523
    WKBReader*
1524
    GEOSWKBReader_create()
1525
0
    {
1526
0
        return GEOSWKBReader_create_r(handle);
1527
0
    }
1528
1529
    void
1530
    GEOSWKBReader_destroy(WKBReader* reader)
1531
0
    {
1532
0
        GEOSWKBReader_destroy_r(handle, reader);
1533
0
    }
1534
1535
    void
1536
    GEOSWKBReader_setFixStructure(WKBReader* reader, char doFix)
1537
0
    {
1538
0
        GEOSWKBReader_setFixStructure_r(handle, reader, doFix);
1539
0
    }
1540
1541
    Geometry*
1542
    GEOSWKBReader_read(WKBReader* reader, const unsigned char* wkb, std::size_t size)
1543
0
    {
1544
0
        return GEOSWKBReader_read_r(handle, reader, wkb, size);
1545
0
    }
1546
1547
    Geometry*
1548
    GEOSWKBReader_readHEX(WKBReader* reader, const unsigned char* hex, std::size_t size)
1549
0
    {
1550
0
        return GEOSWKBReader_readHEX_r(handle, reader, hex, size);
1551
0
    }
1552
1553
    /* WKB Writer */
1554
    WKBWriter*
1555
    GEOSWKBWriter_create()
1556
0
    {
1557
0
        return GEOSWKBWriter_create_r(handle);
1558
0
    }
1559
1560
    void
1561
    GEOSWKBWriter_destroy(WKBWriter* Writer)
1562
0
    {
1563
0
        GEOSWKBWriter_destroy_r(handle, Writer);
1564
0
    }
1565
1566
1567
    /* The caller owns the result */
1568
    unsigned char*
1569
    GEOSWKBWriter_write(WKBWriter* writer, const Geometry* geom, std::size_t* size)
1570
0
    {
1571
0
        return GEOSWKBWriter_write_r(handle, writer, geom, size);
1572
0
    }
1573
1574
    /* The caller owns the result */
1575
    unsigned char*
1576
    GEOSWKBWriter_writeHEX(WKBWriter* writer, const Geometry* geom, std::size_t* size)
1577
0
    {
1578
0
        return GEOSWKBWriter_writeHEX_r(handle, writer, geom, size);
1579
0
    }
1580
1581
    int
1582
    GEOSWKBWriter_getOutputDimension(const GEOSWKBWriter* writer)
1583
0
    {
1584
0
        return GEOSWKBWriter_getOutputDimension_r(handle, writer);
1585
0
    }
1586
1587
    void
1588
    GEOSWKBWriter_setOutputDimension(GEOSWKBWriter* writer, int newDimension)
1589
0
    {
1590
0
        GEOSWKBWriter_setOutputDimension_r(handle, writer, newDimension);
1591
0
    }
1592
1593
    int
1594
    GEOSWKBWriter_getByteOrder(const GEOSWKBWriter* writer)
1595
0
    {
1596
0
        return GEOSWKBWriter_getByteOrder_r(handle, writer);
1597
0
    }
1598
1599
    void
1600
    GEOSWKBWriter_setByteOrder(GEOSWKBWriter* writer, int newByteOrder)
1601
0
    {
1602
0
        GEOSWKBWriter_setByteOrder_r(handle, writer, newByteOrder);
1603
0
    }
1604
1605
    int
1606
    GEOSWKBWriter_getFlavor(const GEOSWKBWriter* writer)
1607
0
    {
1608
0
        return GEOSWKBWriter_getFlavor_r(handle, writer);
1609
0
    }
1610
1611
    void
1612
    GEOSWKBWriter_setFlavor(GEOSWKBWriter* writer, int newFlavor)
1613
0
    {
1614
0
        GEOSWKBWriter_setFlavor_r(handle, writer, newFlavor);
1615
0
    }
1616
1617
    char
1618
    GEOSWKBWriter_getIncludeSRID(const GEOSWKBWriter* writer)
1619
0
    {
1620
0
        return GEOSWKBWriter_getIncludeSRID_r(handle, writer);
1621
0
    }
1622
1623
    void
1624
    GEOSWKBWriter_setIncludeSRID(GEOSWKBWriter* writer, const char newIncludeSRID)
1625
0
    {
1626
0
        GEOSWKBWriter_setIncludeSRID_r(handle, writer, newIncludeSRID);
1627
0
    }
1628
1629
    int
1630
0
    GEOS_printDouble(double d, unsigned int precision, char *result) {
1631
0
        return WKTWriter::writeTrimmedNumber(d, precision, result);
1632
0
    }
1633
1634
    /* GeoJSON Reader */
1635
    GeoJSONReader*
1636
    GEOSGeoJSONReader_create()
1637
0
    {
1638
0
        return GEOSGeoJSONReader_create_r(handle);
1639
0
    }
1640
1641
    void
1642
    GEOSGeoJSONReader_destroy(GeoJSONReader* reader)
1643
0
    {
1644
0
        GEOSGeoJSONReader_destroy_r(handle, reader);
1645
0
    }
1646
1647
    Geometry*
1648
    GEOSGeoJSONReader_readGeometry(GeoJSONReader* reader, const char* geojson)
1649
0
    {
1650
0
        return GEOSGeoJSONReader_readGeometry_r(handle, reader, geojson);
1651
0
    }
1652
1653
    /* GeoJSON Writer */
1654
    GeoJSONWriter*
1655
    GEOSGeoJSONWriter_create()
1656
0
    {
1657
0
        return GEOSGeoJSONWriter_create_r(handle);
1658
0
    }
1659
1660
    void
1661
    GEOSGeoJSONWriter_destroy(GEOSGeoJSONWriter* writer)
1662
0
    {
1663
0
        GEOSGeoJSONWriter_destroy_r(handle, writer);
1664
0
    }
1665
1666
    char*
1667
    GEOSGeoJSONWriter_writeGeometry(GEOSGeoJSONWriter* writer, const GEOSGeometry* g, int indent)
1668
0
    {
1669
0
        return GEOSGeoJSONWriter_writeGeometry_r(handle, writer, g, indent);
1670
0
    }
1671
1672
    void
1673
    GEOSGeoJSONWriter_setOutputDimension(GeoJSONWriter* writer, int dim)
1674
0
    {
1675
0
        GEOSGeoJSONWriter_setOutputDimension_r(handle, writer, dim);
1676
0
    }
1677
1678
    int
1679
    GEOSGeoJSONWriter_getOutputDimension(GeoJSONWriter* writer)
1680
0
    {
1681
0
        return GEOSGeoJSONWriter_getOutputDimension_r(handle, writer);
1682
0
    }
1683
1684
1685
//-----------------------------------------------------------------
1686
// Prepared Geometry
1687
//-----------------------------------------------------------------
1688
1689
    const geos::geom::prep::PreparedGeometry*
1690
    GEOSPrepare(const Geometry* g)
1691
0
    {
1692
0
        return GEOSPrepare_r(handle, g);
1693
0
    }
1694
1695
    void
1696
    GEOSPreparedGeom_destroy(const geos::geom::prep::PreparedGeometry* a)
1697
0
    {
1698
0
        GEOSPreparedGeom_destroy_r(handle, a);
1699
0
    }
1700
1701
    char
1702
    GEOSPreparedContains(const geos::geom::prep::PreparedGeometry* pg1, const Geometry* g2)
1703
0
    {
1704
0
        return GEOSPreparedContains_r(handle, pg1, g2);
1705
0
    }
1706
1707
    char
1708
    GEOSPreparedContainsXY(const geos::geom::prep::PreparedGeometry* pg1, double x, double y)
1709
0
    {
1710
0
        return GEOSPreparedContainsXY_r(handle, pg1, x, y);
1711
0
    }
1712
1713
    char
1714
    GEOSPreparedContainsProperly(const geos::geom::prep::PreparedGeometry* pg1, const Geometry* g2)
1715
0
    {
1716
0
        return GEOSPreparedContainsProperly_r(handle, pg1, g2);
1717
0
    }
1718
1719
    char
1720
    GEOSPreparedCoveredBy(const geos::geom::prep::PreparedGeometry* pg1, const Geometry* g2)
1721
0
    {
1722
0
        return GEOSPreparedCoveredBy_r(handle, pg1, g2);
1723
0
    }
1724
1725
    char
1726
    GEOSPreparedCovers(const geos::geom::prep::PreparedGeometry* pg1, const Geometry* g2)
1727
0
    {
1728
0
        return GEOSPreparedCovers_r(handle, pg1, g2);
1729
0
    }
1730
1731
    char
1732
    GEOSPreparedCrosses(const geos::geom::prep::PreparedGeometry* pg1, const Geometry* g2)
1733
0
    {
1734
0
        return GEOSPreparedCrosses_r(handle, pg1, g2);
1735
0
    }
1736
1737
    char
1738
    GEOSPreparedDisjoint(const geos::geom::prep::PreparedGeometry* pg1, const Geometry* g2)
1739
0
    {
1740
0
        return GEOSPreparedDisjoint_r(handle, pg1, g2);
1741
0
    }
1742
1743
    char
1744
    GEOSPreparedIntersects(const geos::geom::prep::PreparedGeometry* pg1, const Geometry* g2)
1745
0
    {
1746
0
        return GEOSPreparedIntersects_r(handle, pg1, g2);
1747
0
    }
1748
1749
    char
1750
    GEOSPreparedIntersectsXY(const geos::geom::prep::PreparedGeometry* pg1, double x, double y)
1751
0
    {
1752
0
        return GEOSPreparedIntersectsXY_r(handle, pg1, x, y);
1753
0
    }
1754
1755
    char
1756
    GEOSPreparedOverlaps(const geos::geom::prep::PreparedGeometry* pg1, const Geometry* g2)
1757
0
    {
1758
0
        return GEOSPreparedOverlaps_r(handle, pg1, g2);
1759
0
    }
1760
1761
    char
1762
    GEOSPreparedTouches(const geos::geom::prep::PreparedGeometry* pg1, const Geometry* g2)
1763
0
    {
1764
0
        return GEOSPreparedTouches_r(handle, pg1, g2);
1765
0
    }
1766
1767
    char
1768
    GEOSPreparedWithin(const geos::geom::prep::PreparedGeometry* pg1, const Geometry* g2)
1769
0
    {
1770
0
        return GEOSPreparedWithin_r(handle, pg1, g2);
1771
0
    }
1772
1773
    char *
1774
    GEOSPreparedRelate(const geos::geom::prep::PreparedGeometry* pg1, const Geometry* g2)
1775
0
    {
1776
0
        return GEOSPreparedRelate_r(handle, pg1, g2);
1777
0
    }
1778
1779
    char
1780
    GEOSPreparedRelatePattern(const geos::geom::prep::PreparedGeometry* pg1, const Geometry* g2, const char* imPattern)
1781
0
    {
1782
0
        return GEOSPreparedRelatePattern_r(handle, pg1, g2, imPattern);
1783
0
    }
1784
1785
    CoordinateSequence*
1786
    GEOSPreparedNearestPoints(const geos::geom::prep::PreparedGeometry* g1, const Geometry* g2)
1787
0
    {
1788
0
        return GEOSPreparedNearestPoints_r(handle, g1, g2);
1789
0
    }
1790
1791
    int
1792
    GEOSPreparedDistance(const geos::geom::prep::PreparedGeometry* g1, const Geometry* g2, double *dist)
1793
0
    {
1794
0
        return GEOSPreparedDistance_r(handle, g1, g2, dist);
1795
0
    }
1796
1797
    char
1798
    GEOSPreparedDistanceWithin(const geos::geom::prep::PreparedGeometry* g1, const Geometry* g2, double dist)
1799
0
    {
1800
0
        return GEOSPreparedDistanceWithin_r(handle, g1, g2, dist);
1801
0
    }
1802
1803
    GEOSSTRtree*
1804
    GEOSSTRtree_create(std::size_t nodeCapacity)
1805
0
    {
1806
0
        return GEOSSTRtree_create_r(handle, nodeCapacity);
1807
0
    }
1808
1809
    int
1810
    GEOSSTRtree_build(GEOSSTRtree* tree)
1811
0
    {
1812
0
        return GEOSSTRtree_build_r(handle, tree);
1813
0
    }
1814
1815
    void
1816
    GEOSSTRtree_insert(GEOSSTRtree* tree,
1817
                       const geos::geom::Geometry* g,
1818
                       void* item)
1819
0
    {
1820
0
        GEOSSTRtree_insert_r(handle, tree, g, item);
1821
0
    }
1822
1823
    void
1824
    GEOSSTRtree_query(GEOSSTRtree* tree,
1825
                      const geos::geom::Geometry* g,
1826
                      GEOSQueryCallback cb,
1827
                      void* userdata)
1828
0
    {
1829
0
        GEOSSTRtree_query_r(handle, tree, g, cb, userdata);
1830
0
    }
1831
1832
    const GEOSGeometry*
1833
    GEOSSTRtree_nearest(GEOSSTRtree* tree,
1834
                        const geos::geom::Geometry* g)
1835
0
    {
1836
0
        return GEOSSTRtree_nearest_r(handle, tree, g);
1837
0
    }
1838
1839
    const void* GEOSSTRtree_nearest_generic(GEOSSTRtree* tree,
1840
                                            const void* item,
1841
                                            const GEOSGeometry* itemEnvelope,
1842
                                            GEOSDistanceCallback distancefn,
1843
                                            void* userdata)
1844
0
    {
1845
0
        return GEOSSTRtree_nearest_generic_r(handle, tree, item, itemEnvelope, distancefn, userdata);
1846
0
    }
1847
1848
    void
1849
    GEOSSTRtree_iterate(GEOSSTRtree* tree,
1850
                        GEOSQueryCallback callback,
1851
                        void* userdata)
1852
0
    {
1853
0
        GEOSSTRtree_iterate_r(handle, tree, callback, userdata);
1854
0
    }
1855
1856
    char
1857
    GEOSSTRtree_remove(GEOSSTRtree* tree,
1858
                       const geos::geom::Geometry* g,
1859
                       void* item)
1860
0
    {
1861
0
        return GEOSSTRtree_remove_r(handle, tree, g, item);
1862
0
    }
1863
1864
    void
1865
    GEOSSTRtree_destroy(GEOSSTRtree* tree)
1866
0
    {
1867
0
        GEOSSTRtree_destroy_r(handle, tree);
1868
0
    }
1869
1870
    double
1871
    GEOSProject(const geos::geom::Geometry* g,
1872
                const geos::geom::Geometry* p)
1873
0
    {
1874
0
        return GEOSProject_r(handle, g, p);
1875
0
    }
1876
1877
    geos::geom::Geometry*
1878
    GEOSInterpolate(const geos::geom::Geometry* g,
1879
                    double d)
1880
0
    {
1881
0
        return GEOSInterpolate_r(handle, g, d);
1882
0
    }
1883
1884
    double
1885
    GEOSProjectNormalized(const geos::geom::Geometry* g,
1886
                          const geos::geom::Geometry* p)
1887
0
    {
1888
0
        return GEOSProjectNormalized_r(handle, g, p);
1889
0
    }
1890
1891
    geos::geom::Geometry*
1892
    GEOSInterpolateNormalized(const geos::geom::Geometry* g,
1893
                              double d)
1894
0
    {
1895
0
        return GEOSInterpolateNormalized_r(handle, g, d);
1896
0
    }
1897
1898
    geos::geom::Geometry*
1899
    GEOSGeom_extractUniquePoints(const geos::geom::Geometry* g)
1900
0
    {
1901
0
        return GEOSGeom_extractUniquePoints_r(handle, g);
1902
0
    }
1903
1904
    geos::geom::Geometry*
1905
    GEOSGeom_createEmptyCollection(int type)
1906
0
    {
1907
0
        return GEOSGeom_createEmptyCollection_r(handle, type);
1908
0
    }
1909
1910
    geos::geom::Geometry*
1911
    GEOSGeom_createEmptyPoint()
1912
0
    {
1913
0
        return GEOSGeom_createEmptyPoint_r(handle);
1914
0
    }
1915
1916
    geos::geom::Geometry*
1917
    GEOSGeom_createEmptyLineString()
1918
0
    {
1919
0
        return GEOSGeom_createEmptyLineString_r(handle);
1920
0
    }
1921
1922
    geos::geom::Geometry*
1923
    GEOSGeom_createEmptyPolygon()
1924
0
    {
1925
0
        return GEOSGeom_createEmptyPolygon_r(handle);
1926
0
    }
1927
1928
    geos::geom::Geometry*
1929
    GEOSGeom_createEmptyCircularString()
1930
0
    {
1931
0
        return GEOSGeom_createEmptyCircularString_r(handle);
1932
0
    }
1933
1934
    geos::geom::Geometry*
1935
    GEOSGeom_createEmptyCompoundCurve()
1936
0
    {
1937
0
        return GEOSGeom_createEmptyCompoundCurve_r(handle);
1938
0
    }
1939
1940
    geos::geom::Geometry*
1941
    GEOSGeom_createEmptyCurvePolygon()
1942
0
    {
1943
0
        return GEOSGeom_createEmptyCurvePolygon_r(handle);
1944
0
    }
1945
1946
    geos::geom::Geometry*
1947
    GEOSGeom_createRectangle(double xmin, double ymin, double xmax,
1948
                            double ymax)
1949
0
    {
1950
0
        return GEOSGeom_createRectangle_r(handle, xmin, ymin, xmax, ymax);
1951
0
    }
1952
1953
    int
1954
    GEOSOrientationIndex(double Ax, double Ay, double Bx, double By,
1955
                         double Px, double Py)
1956
0
    {
1957
0
        return GEOSOrientationIndex_r(handle, Ax, Ay, Bx, By, Px, Py);
1958
0
    }
1959
1960
    GEOSGeometry*
1961
    GEOSSharedPaths(const GEOSGeometry* g1, const GEOSGeometry* g2)
1962
0
    {
1963
0
        return GEOSSharedPaths_r(handle, g1, g2);
1964
0
    }
1965
1966
    GEOSGeometry*
1967
    GEOSSnap(const GEOSGeometry* g1, const GEOSGeometry* g2, double tolerance)
1968
0
    {
1969
0
        return GEOSSnap_r(handle, g1, g2, tolerance);
1970
0
    }
1971
1972
    GEOSBufferParams*
1973
    GEOSBufferParams_create()
1974
0
    {
1975
0
        return GEOSBufferParams_create_r(handle);
1976
0
    }
1977
1978
    void
1979
    GEOSBufferParams_destroy(GEOSBufferParams* p)
1980
0
    {
1981
0
        return GEOSBufferParams_destroy_r(handle, p);
1982
0
    }
1983
1984
    int
1985
    GEOSBufferParams_setEndCapStyle(GEOSBufferParams* p, int style)
1986
0
    {
1987
0
        return GEOSBufferParams_setEndCapStyle_r(handle, p, style);
1988
0
    }
1989
1990
    int
1991
    GEOSBufferParams_setJoinStyle(GEOSBufferParams* p, int joinStyle)
1992
0
    {
1993
0
        return GEOSBufferParams_setJoinStyle_r(handle, p, joinStyle);
1994
0
    }
1995
1996
    int
1997
    GEOSBufferParams_setMitreLimit(GEOSBufferParams* p, double l)
1998
0
    {
1999
0
        return GEOSBufferParams_setMitreLimit_r(handle, p, l);
2000
0
    }
2001
2002
    int
2003
    GEOSBufferParams_setQuadrantSegments(GEOSBufferParams* p, int joinStyle)
2004
0
    {
2005
0
        return GEOSBufferParams_setQuadrantSegments_r(handle, p, joinStyle);
2006
0
    }
2007
2008
    int
2009
    GEOSBufferParams_setSingleSided(GEOSBufferParams* p, int singleSided)
2010
0
    {
2011
0
        return GEOSBufferParams_setSingleSided_r(handle, p, singleSided);
2012
0
    }
2013
2014
    Geometry*
2015
    GEOSBufferWithParams(const Geometry* g, const GEOSBufferParams* p, double w)
2016
0
    {
2017
0
        return GEOSBufferWithParams_r(handle, g, p, w);
2018
0
    }
2019
2020
    Geometry*
2021
    GEOSDelaunayTriangulation(const Geometry* g, double tolerance, int onlyEdges)
2022
0
    {
2023
0
        return GEOSDelaunayTriangulation_r(handle, g, tolerance, onlyEdges);
2024
0
    }
2025
2026
    Geometry*
2027
    GEOSConstrainedDelaunayTriangulation(const Geometry* g)
2028
0
    {
2029
0
        return GEOSConstrainedDelaunayTriangulation_r(handle, g);
2030
0
    }
2031
2032
    Geometry*
2033
    GEOSVoronoiDiagram(const Geometry* g, const Geometry* env, double tolerance, int flags)
2034
0
    {
2035
0
        return GEOSVoronoiDiagram_r(handle, g, env, tolerance, flags);
2036
0
    }
2037
2038
    int
2039
    GEOSSegmentIntersection(double ax0, double ay0, double ax1, double ay1,
2040
                            double bx0, double by0, double bx1, double by1,
2041
                            double* cx, double* cy)
2042
0
    {
2043
0
        return GEOSSegmentIntersection_r(handle,
2044
0
                                         ax0, ay0, ax1, ay1,
2045
0
                                         bx0, by0, bx1, by1,
2046
0
                                         cx, cy);
2047
0
    }
2048
2049
    int
2050
    GEOSCoverageIsValid(
2051
        const Geometry* input,
2052
        double gapWidth,
2053
        Geometry** invalidEdges)
2054
0
    {
2055
0
        return GEOSCoverageIsValid_r(handle, input, gapWidth, invalidEdges);
2056
0
    }
2057
2058
    Geometry*
2059
    GEOSCoverageSimplifyVW(const Geometry* input, double tolerance, int preserveBoundary)
2060
0
    {
2061
0
        return GEOSCoverageSimplifyVW_r(handle, input, tolerance, preserveBoundary);
2062
0
    }
2063
2064
2065
} /* extern "C" */