-
Notifications
You must be signed in to change notification settings - Fork 370
/
Copy pathgeos_c.h.in
4993 lines (4377 loc) · 158 KB
/
geos_c.h.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/************************************************************************
*
* C-Wrapper for GEOS library
*
* Copyright (C) 2010 2011 Sandro Santilli <[email protected]>
* Copyright (C) 2005 Refractions Research Inc.
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU Lesser General Public Licence as published
* by the Free Software Foundation.
* See the COPYING file for more information.
***********************************************************************/
/**
* \file geos_c.h
* \brief C API for the GEOS geometry algorithms library.
* \tableofcontents
*
* The C API is the preferred API to use when integration GEOS into
* you program/language/etc. While the C++ API is available, the ABI
* will not be stable between versions, and the API may also change.
* The GEOS team makes an effort to keep the C API stable, and to
* deprecate function signatures only over a long time period to allow
* transition time.
*
* Important programming notes:
*
* - Remember to call initGEOS() before any use of this library's
* functions, and call finishGEOS() when done.
* - Currently you have to explicitly GEOSGeom_destroy() all
* GEOSGeom objects to avoid memory leaks, and GEOSFree()
* all returned char * (unless const).
* - Functions ending with _r are thread safe (reentrant);
* see details in https://libgeos.org/development/rfcs/rfc03.
* To avoid accidental use of non-reentrant functions,
* define GEOS_USE_ONLY_R_API before including geos_c.h.
*
*/
#ifndef GEOS_C_H_INCLUDED
#define GEOS_C_H_INCLUDED
#ifndef __cplusplus
# include <stddef.h> /* for size_t definition */
#else
# include <cstddef>
using std::size_t;
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* ====================================================================== */
/* Version */
/* ====================================================================== */
/** \cond */
#ifndef GEOS_VERSION_MAJOR
#define GEOS_VERSION_MAJOR @VERSION_MAJOR@
#endif
#ifndef GEOS_VERSION_MINOR
#define GEOS_VERSION_MINOR @VERSION_MINOR@
#endif
#ifndef GEOS_VERSION_PATCH
#define GEOS_VERSION_PATCH @VERSION_PATCH@
#endif
#ifndef GEOS_VERSION
#define GEOS_VERSION "@VERSION@"
#endif
#ifndef GEOS_JTS_PORT
#define GEOS_JTS_PORT "@JTS_PORT@"
#endif
#define GEOS_CAPI_VERSION_MAJOR @CAPI_VERSION_MAJOR@
#define GEOS_CAPI_VERSION_MINOR @CAPI_VERSION_MINOR@
#define GEOS_CAPI_VERSION_PATCH @CAPI_VERSION_PATCH@
#define GEOS_CAPI_VERSION "@VERSION@-CAPI-@CAPI_VERSION@"
#define GEOS_CAPI_FIRST_INTERFACE GEOS_CAPI_VERSION_MAJOR
#define GEOS_CAPI_LAST_INTERFACE (GEOS_CAPI_VERSION_MAJOR+GEOS_CAPI_VERSION_MINOR)
/** \endcond */
#include <geos/export.h>
/**
* Type returned by GEOS_init_r(), for use in multi-threaded
* applications.
*
* There should be only one GEOSContextHandle_t per thread.
*/
typedef struct GEOSContextHandle_HS *GEOSContextHandle_t;
/**
* Callback function for passing GEOS error messages to parent process.
*
* Set the GEOSMessageHandler for error and notice messages in \ref initGEOS
* for single-threaded programs, or using \ref initGEOS_r for threaded
* programs
*
* \param fmt the message format template
*/
typedef void (*GEOSMessageHandler)(const char *fmt, ...);
/**
* A GEOS message handler function.
*
* \param message the message contents
* \param userdata the user data pointer that was passed to GEOS when
* registering this message handler.
*
* \see GEOSContext_setErrorMessageHandler
* \see GEOSContext_setNoticeMessageHandler
*/
typedef void (*GEOSMessageHandler_r)(const char *message, void *userdata);
/*
* When we're included by geos_c.cpp, these types are #defined to the
* C++ definitions via preprocessor. We don't touch them to allow the
* compiler to cross-check the declarations. However, for all "normal"
* C-API users, we need to define these types as "opaque" struct pointers, as
* those clients don't have access to the original C++ headers, by design.
*/
#ifndef GEOSGeometry
/**
* Geometry generic type. Geometry can be a point, linestring, polygon,
* multipoint, multilinestring, multipolygon, or geometrycollection.
* Geometry type can be read with \ref GEOSGeomTypeId. Most functions
* in GEOS either have GEOSGeometry* as a parameter or a return type.
* \see GEOSGeom_createPoint
* \see GEOSGeom_createLineString
* \see GEOSGeom_createPolygon
* \see GEOSGeom_createCollection
* \see GEOSGeom_destroy
*/
typedef struct GEOSGeom_t GEOSGeometry;
/**
* Prepared geometry type.
* \see GEOSPrepare()
* \see GEOSPreparedGeom_destroy()
*/
typedef struct GEOSPrepGeom_t GEOSPreparedGeometry;
/**
* Coordinate sequence.
* \see GEOSCoordSeq_create()
* \see GEOSCoordSeq_destroy()
*/
typedef struct GEOSCoordSeq_t GEOSCoordSequence;
/**
* STRTree index.
* \see GEOSSTRtree_create()
* \see GEOSSTRtree_destroy()
*/
typedef struct GEOSSTRtree_t GEOSSTRtree;
/**
* Parameter object for buffering.
* \see GEOSBufferParams_create()
* \see GEOSBufferParams_destroy()
*/
typedef struct GEOSBufParams_t GEOSBufferParams;
/**
* Parameter object for validity enforcement.
* \see GEOSMakeValidParams_create()
* \see GEOSMakeValidParams_destroy()
*/
typedef struct GEOSMakeValidParams_t GEOSMakeValidParams;
#endif
/** \cond */
/*
* These are compatibility definitions for source compatibility
* with GEOS 2.X clients relying on that type.
*/
typedef GEOSGeometry* GEOSGeom;
typedef GEOSCoordSequence* GEOSCoordSeq;
/** \endcond */
/**
* Geometry type number, used by functions returning or
* consuming geometry types.
*
* \see GEOSGeomType
* \see GEOSGeomTypeId
*/
enum GEOSGeomTypes {
/** Point */
GEOS_POINT,
/** Linestring */
GEOS_LINESTRING,
/** Linear ring, used within polygons */
GEOS_LINEARRING,
/** Polygon */
GEOS_POLYGON,
/** Multipoint, a homogeneous collection of points */
GEOS_MULTIPOINT,
/** Multilinestring, a homogeneous collection of linestrings */
GEOS_MULTILINESTRING,
/** Multipolygon, a homogeneous collection of polygons */
GEOS_MULTIPOLYGON,
/** Geometry collection, a heterogeneous collection of geometry */
GEOS_GEOMETRYCOLLECTION
};
/**
* Well-known binary byte orders used when
* writing to WKB.
*
* \see GEOSWKBWriter_setByteOrder
*/
enum GEOSWKBByteOrders {
/** Big Endian */
GEOS_WKB_XDR = 0,
/** Little Endian */
GEOS_WKB_NDR = 1
};
/**
* Well-known binary flavors to use
* when writing to WKB. ISO flavour is
* more standard. Extended flavour supports
* 3D and SRID embedding. GEOS reads both
* transparently.
*
* \see GEOSWKBWriter_setFlavor
*/
enum GEOSWKBFlavors {
/** Extended */
GEOS_WKB_EXTENDED = 1,
/** ISO */
GEOS_WKB_ISO = 2
};
/**
* Callback function for use in spatial index search calls. Pass into
* the query function and handle query results as the index
* returns them.
*
* \see GEOSSTRtree_query
*/
typedef void (*GEOSQueryCallback)(void *item, void *userdata);
/**
* Callback function for use in spatial index nearest neighbor calculations.
* Allows custom distance to be calculated between items in the
* index. Is passed two items, and sets the calculated distance
* between the items into the distance pointer. Extra data for the
* calculation can be passed via the userdata.
*
* \param item1 first of the pair of items to calculate distance between
* \param item2 second of the pair of items to calculate distance between
* \param distance the distance between the items here
* \param userdata extra data for the calculation
*
* \return zero if distance calculation succeeded, non-zero otherwise
*
* \see GEOSSTRtree_nearest_generic
* \see GEOSSTRtree_iterate
*/
typedef int (*GEOSDistanceCallback)(
const void* item1,
const void* item2,
double* distance,
void* userdata);
/**
* Callback function for use in GEOSGeom_transformXY.
* Allows custom function to be applied to x and y values for each coordinate
* in a geometry. Z values are unchanged by this function.
* Extra data for the calculation can be passed via the userdata.
*
* \param x coordinate value to be updated
* \param y coordinate value to be updated
* \param userdata extra data for the calculation
*
* \return 1 if calculation succeeded, 0 on failure
*/
typedef int (*GEOSTransformXYCallback)(
double* x,
double* y,
void* userdata);
/* ========== Interruption ========== */
/**
* Callback function for use in interruption. The callback will be invoked _before_ checking for
* interruption, so can be used to request it.
*
* \see GEOS_interruptRegisterCallback
* \see GEOS_interruptRequest
* \see GEOS_interruptCancel
*/
typedef void (GEOSInterruptCallback)(void);
/**
* Register a function to be called when processing is interrupted.
* \param cb Callback function to invoke
* \return the previously configured callback
* \see GEOSInterruptCallback
*/
extern GEOSInterruptCallback GEOS_DLL *GEOS_interruptRegisterCallback(
GEOSInterruptCallback* cb);
/**
* Request safe interruption of operations
*/
extern void GEOS_DLL GEOS_interruptRequest(void);
/**
* Cancel a pending interruption request
*/
extern void GEOS_DLL GEOS_interruptCancel(void);
/* ========== Initialization and Cleanup ========== */
/**
* Initialize a context for this thread. Pass this context into
* your other calls of `*_r` functions.
* \return a GEOS context for this thread
*/
extern GEOSContextHandle_t GEOS_DLL GEOS_init_r(void);
/**
* Free the memory associated with a \ref GEOSContextHandle_t
* when you are finished calling GEOS functions.
* \param handle to be freed
*/
extern void GEOS_DLL GEOS_finish_r(GEOSContextHandle_t handle);
/**
* Set the notice handler callback function for run-time notice messages.
* \param extHandle the context returned by \ref GEOS_init_r.
* \param nf the handler callback
* \return the previously configured message handler or NULL if no message handler was configured
*/
extern GEOSMessageHandler GEOS_DLL GEOSContext_setNoticeHandler_r(
GEOSContextHandle_t extHandle,
GEOSMessageHandler nf);
/** */
/**
* Set the notice handler callback function for run-time error messages.
* \param extHandle the GEOS context from \ref GEOS_init_r
* \param ef the handler callback
* \return the previously configured message handler or NULL if no message handler was configured
*/
extern GEOSMessageHandler GEOS_DLL GEOSContext_setErrorHandler_r(
GEOSContextHandle_t extHandle,
GEOSMessageHandler ef);
/**
* Sets a notice message handler on the given GEOS context.
* \param extHandle the GEOS context from \ref GEOS_init_r
* \param nf the message handler
* \param userData optional user data pointer that will be passed to the message handler
* \return the previously configured message handler or NULL if no message handler was configured
*/
extern GEOSMessageHandler_r GEOS_DLL GEOSContext_setNoticeMessageHandler_r(
GEOSContextHandle_t extHandle,
GEOSMessageHandler_r nf,
void *userData);
/**
* Sets an error message handler on the given GEOS context.
*
* \param extHandle the GEOS context
* \param ef the message handler
* \param userData optional user data pointer that will be passed to the message handler
*
* \return the previously configured message handler or NULL if no message handler was configured
*/
extern GEOSMessageHandler_r GEOS_DLL GEOSContext_setErrorMessageHandler_r(
GEOSContextHandle_t extHandle,
GEOSMessageHandler_r ef,
void *userData);
/* ========== Coordinate Sequence functions ========== */
/** \see GEOSCoordSeq_create */
extern GEOSCoordSequence GEOS_DLL *GEOSCoordSeq_create_r(
GEOSContextHandle_t handle,
unsigned int size,
unsigned int dims);
/** \see GEOSCoordSeq_copyFromBuffer */
extern GEOSCoordSequence GEOS_DLL *GEOSCoordSeq_copyFromBuffer_r(
GEOSContextHandle_t handle,
const double* buf,
unsigned int size,
int hasZ,
int hasM);
/** \see GEOSCoordSeq_copyFromArrays */
extern GEOSCoordSequence GEOS_DLL *GEOSCoordSeq_copyFromArrays_r(
GEOSContextHandle_t handle,
const double* x,
const double* y,
const double* z,
const double* m,
unsigned int size);
/** \see GEOSCoordSeq_copyToBuffer */
extern int GEOS_DLL GEOSCoordSeq_copyToBuffer_r(
GEOSContextHandle_t handle,
const GEOSCoordSequence* s,
double* buf,
int hasZ,
int hasM);
/** \see GEOSCoordSeq_copyToArrays */
extern int GEOS_DLL GEOSCoordSeq_copyToArrays_r(
GEOSContextHandle_t handle,
const GEOSCoordSequence* s,
double* x,
double* y,
double* z,
double* m);
/** \see GEOSCoordSeq_clone */
extern GEOSCoordSequence GEOS_DLL *GEOSCoordSeq_clone_r(
GEOSContextHandle_t handle,
const GEOSCoordSequence* s);
/** \see GEOSCoordSeq_destroy */
extern void GEOS_DLL GEOSCoordSeq_destroy_r(
GEOSContextHandle_t handle,
GEOSCoordSequence* s);
/** \see GEOSCoordSeq_setX */
extern int GEOS_DLL GEOSCoordSeq_setX_r(
GEOSContextHandle_t handle,
GEOSCoordSequence* s, unsigned int idx,
double val);
/** \see GEOSCoordSeq_setY */
extern int GEOS_DLL GEOSCoordSeq_setY_r(
GEOSContextHandle_t handle,
GEOSCoordSequence* s, unsigned int idx,
double val);
/** \see GEOSCoordSeq_setZ */
extern int GEOS_DLL GEOSCoordSeq_setZ_r(
GEOSContextHandle_t handle,
GEOSCoordSequence* s, unsigned int idx,
double val);
/** \see GEOSCoordSeq_setXY */
extern int GEOS_DLL GEOSCoordSeq_setXY_r(
GEOSContextHandle_t handle,
GEOSCoordSequence* s, unsigned int idx,
double x, double y);
/** \see GEOSCoordSeq_setXYZ */
extern int GEOS_DLL GEOSCoordSeq_setXYZ_r(
GEOSContextHandle_t handle,
GEOSCoordSequence* s, unsigned int idx,
double x, double y, double z);
/** \see GEOSCoordSeq_setOrdinate */
extern int GEOS_DLL GEOSCoordSeq_setOrdinate_r(
GEOSContextHandle_t handle,
GEOSCoordSequence* s,
unsigned int idx,
unsigned int dim, double val);
/** \see GEOSCoordSeq_getX */
extern int GEOS_DLL GEOSCoordSeq_getX_r(
GEOSContextHandle_t handle,
const GEOSCoordSequence* s,
unsigned int idx, double *val);
/** \see GEOSCoordSeq_getY */
extern int GEOS_DLL GEOSCoordSeq_getY_r(
GEOSContextHandle_t handle,
const GEOSCoordSequence* s,
unsigned int idx, double *val);
/** \see GEOSCoordSeq_getZ */
extern int GEOS_DLL GEOSCoordSeq_getZ_r(
GEOSContextHandle_t handle,
const GEOSCoordSequence* s,
unsigned int idx, double *val);
/** \see GEOSCoordSeq_getXY */
extern int GEOS_DLL GEOSCoordSeq_getXY_r(
GEOSContextHandle_t handle,
const GEOSCoordSequence* s,
unsigned int idx,
double *x, double *y);
/** \see GEOSCoordSeq_getXYZ */
extern int GEOS_DLL GEOSCoordSeq_getXYZ_r(
GEOSContextHandle_t handle,
const GEOSCoordSequence* s,
unsigned int idx,
double *x, double *y, double *z);
/** \see GEOSCoordSeq_getOrdinate */
extern int GEOS_DLL GEOSCoordSeq_getOrdinate_r(
GEOSContextHandle_t handle,
const GEOSCoordSequence* s,
unsigned int idx,
unsigned int dim, double *val);
/** \see GEOSCoordSeq_getSize */
extern int GEOS_DLL GEOSCoordSeq_getSize_r(
GEOSContextHandle_t handle,
const GEOSCoordSequence* s,
unsigned int *size);
/** \see GEOSCoordSeq_getDimensions */
extern int GEOS_DLL GEOSCoordSeq_getDimensions_r(
GEOSContextHandle_t handle,
const GEOSCoordSequence* s,
unsigned int *dims);
/** \see GEOSCoordSeq_isCCW */
extern int GEOS_DLL GEOSCoordSeq_isCCW_r(
GEOSContextHandle_t handle,
const GEOSCoordSequence* s,
char* is_ccw);
/* ========= Linear referencing functions ========= */
/** \see GEOSProject */
extern double GEOS_DLL GEOSProject_r(
GEOSContextHandle_t handle,
const GEOSGeometry *line,
const GEOSGeometry *point);
/** \see GEOSInterpolate */
extern GEOSGeometry GEOS_DLL *GEOSInterpolate_r(
GEOSContextHandle_t handle,
const GEOSGeometry *line,
double d);
/** \see GEOSProjectNormalized */
extern double GEOS_DLL GEOSProjectNormalized_r(
GEOSContextHandle_t handle,
const GEOSGeometry *g,
const GEOSGeometry *p);
/** \see GEOSInterpolateNormalized */
extern GEOSGeometry GEOS_DLL *GEOSInterpolateNormalized_r(
GEOSContextHandle_t handle,
const GEOSGeometry *g,
double d);
/* ========== Buffer related functions ========== */
/** \see GEOSBuffer */
extern GEOSGeometry GEOS_DLL *GEOSBuffer_r(
GEOSContextHandle_t handle,
const GEOSGeometry* g,
double width, int quadsegs);
/**
* Cap styles control the ends of buffered lines.
* \see GEOSBuffer
*/
enum GEOSBufCapStyles {
/** End is rounded, with end point of original line in the centre of the round cap. */
GEOSBUF_CAP_ROUND = 1,
/** End is flat, with end point of original line at the end of the buffer */
GEOSBUF_CAP_FLAT = 2,
/** End is flat, with end point of original line in the middle of a square enclosing that point */
GEOSBUF_CAP_SQUARE = 3
};
/**
* Join styles control the buffer shape at bends in a line.
* \see GEOSBuffer
*/
enum GEOSBufJoinStyles {
/**
* Join is rounded, essentially each line is terminated
* in a round cap. Form round corner.
*/
GEOSBUF_JOIN_ROUND = 1,
/**
* Join is flat, with line between buffer edges,
* through the join point. Forms flat corner.
*/
GEOSBUF_JOIN_MITRE = 2,
/**
* Join is the point at which the two buffer edges intersect.
* Forms sharp corner.
*/
GEOSBUF_JOIN_BEVEL = 3
};
/** \see GEOSBufferParams_create */
extern GEOSBufferParams GEOS_DLL *GEOSBufferParams_create_r(
GEOSContextHandle_t handle);
/** \see GEOSBufferParams_destroy */
extern void GEOS_DLL GEOSBufferParams_destroy_r(
GEOSContextHandle_t handle,
GEOSBufferParams* parms);
/** \see GEOSBufferParams_setEndCapStyle */
extern int GEOS_DLL GEOSBufferParams_setEndCapStyle_r(
GEOSContextHandle_t handle,
GEOSBufferParams* p,
int style);
/** \see GEOSBufferParams_setJoinStyle */
extern int GEOS_DLL GEOSBufferParams_setJoinStyle_r(
GEOSContextHandle_t handle,
GEOSBufferParams* p,
int joinStyle);
/** \see GEOSBufferParams_setMitreLimit */
extern int GEOS_DLL GEOSBufferParams_setMitreLimit_r(
GEOSContextHandle_t handle,
GEOSBufferParams* p,
double mitreLimit);
/** \see GEOSBufferParams_setQuadrantSegments */
extern int GEOS_DLL GEOSBufferParams_setQuadrantSegments_r(
GEOSContextHandle_t handle,
GEOSBufferParams* p,
int quadSegs);
/** \see GEOSBufferParams_setSingleSided */
extern int GEOS_DLL GEOSBufferParams_setSingleSided_r(
GEOSContextHandle_t handle,
GEOSBufferParams* p,
int singleSided);
/** \see GEOSBufferWithParams */
extern GEOSGeometry GEOS_DLL *GEOSBufferWithParams_r(
GEOSContextHandle_t handle,
const GEOSGeometry* g,
const GEOSBufferParams* p,
double width);
/** \see GEOSBufferWithStyle */
extern GEOSGeometry GEOS_DLL *GEOSBufferWithStyle_r(
GEOSContextHandle_t handle,
const GEOSGeometry* g,
double width, int quadsegs, int endCapStyle,
int joinStyle, double mitreLimit);
/** \see GEOSDensify */
extern GEOSGeometry GEOS_DLL *GEOSDensify_r(
GEOSContextHandle_t handle,
const GEOSGeometry* g,
double tolerance);
/** \see GEOSOffsetCurve */
extern GEOSGeometry GEOS_DLL *GEOSOffsetCurve_r(
GEOSContextHandle_t handle,
const GEOSGeometry* g, double width, int quadsegs,
int joinStyle, double mitreLimit);
/* ========= Geometry Constructors ========= */
/** \see GEOSGeom_createPoint */
extern GEOSGeometry GEOS_DLL *GEOSGeom_createPoint_r(
GEOSContextHandle_t handle,
GEOSCoordSequence* s);
/** \see GEOSGeom_createPointFromXY */
extern GEOSGeometry GEOS_DLL *GEOSGeom_createPointFromXY_r(
GEOSContextHandle_t handle,
double x, double y);
/** \see GEOSGeom_createEmptyPoint */
extern GEOSGeometry GEOS_DLL *GEOSGeom_createEmptyPoint_r(
GEOSContextHandle_t handle);
/** \see GEOSGeom_createLinearRing */
extern GEOSGeometry GEOS_DLL *GEOSGeom_createLinearRing_r(
GEOSContextHandle_t handle,
GEOSCoordSequence* s);
/** \see GEOSGeom_createLineString */
extern GEOSGeometry GEOS_DLL *GEOSGeom_createLineString_r(
GEOSContextHandle_t handle,
GEOSCoordSequence* s);
/** \see GEOSGeom_createEmptyLineString */
extern GEOSGeometry GEOS_DLL *GEOSGeom_createEmptyLineString_r(
GEOSContextHandle_t handle);
/** \see GEOSGeom_createEmptyPolygon */
extern GEOSGeometry GEOS_DLL *GEOSGeom_createEmptyPolygon_r(
GEOSContextHandle_t handle);
/** \see GEOSGeom_createPolygon */
extern GEOSGeometry GEOS_DLL *GEOSGeom_createPolygon_r(
GEOSContextHandle_t handle,
GEOSGeometry* shell,
GEOSGeometry** holes,
unsigned int nholes);
/** \see GEOSGeom_createCollection */
extern GEOSGeometry GEOS_DLL *GEOSGeom_createCollection_r(
GEOSContextHandle_t handle,
int type,
GEOSGeometry* *geoms,
unsigned int ngeoms);
/** \see GEOSGeom_createEmptyCollection */
extern GEOSGeometry GEOS_DLL *GEOSGeom_createEmptyCollection_r(
GEOSContextHandle_t handle, int type);
/** \see GEOSGeom_createRectangle */
extern GEOSGeometry GEOS_DLL *GEOSGeom_createRectangle_r(
GEOSContextHandle_t handle,
double xmin, double ymin,
double xmax, double ymax);
/** \see GEOSGeom_clone */
extern GEOSGeometry GEOS_DLL *GEOSGeom_clone_r(
GEOSContextHandle_t handle,
const GEOSGeometry* g);
/* ========= Memory management ========= */
/** \see GEOSGeom_destroy */
extern void GEOS_DLL GEOSGeom_destroy_r(
GEOSContextHandle_t handle,
GEOSGeometry* g);
/* ========= Topology Operations ========= */
/** \see GEOSEnvelope */
extern GEOSGeometry GEOS_DLL *GEOSEnvelope_r(
GEOSContextHandle_t handle,
const GEOSGeometry* g);
/** \see GEOSIntersection */
extern GEOSGeometry GEOS_DLL *GEOSIntersection_r(
GEOSContextHandle_t handle,
const GEOSGeometry* g1,
const GEOSGeometry* g2);
/** \see GEOSIntersectionPrec */
extern GEOSGeometry GEOS_DLL *GEOSIntersectionPrec_r(
GEOSContextHandle_t handle,
const GEOSGeometry* g1,
const GEOSGeometry* g2,
double gridSize);
/** \see GEOSConvexHull */
extern GEOSGeometry GEOS_DLL *GEOSConvexHull_r(
GEOSContextHandle_t handle,
const GEOSGeometry* g);
/** \see GEOSConcaveHull */
extern GEOSGeometry GEOS_DLL *GEOSConcaveHull_r(
GEOSContextHandle_t handle,
const GEOSGeometry* g,
double ratio,
unsigned int allowHoles);
/** \see GEOSMinimumRotatedRectangle */
extern GEOSGeometry GEOS_DLL *GEOSMinimumRotatedRectangle_r(
GEOSContextHandle_t handle,
const GEOSGeometry* g);
/** \see GEOSMaximumInscribedCircle */
extern GEOSGeometry GEOS_DLL *GEOSMaximumInscribedCircle_r(
GEOSContextHandle_t handle,
const GEOSGeometry* g,
double tolerance);
/** \see GEOSLargestEmptyCircle */
extern GEOSGeometry GEOS_DLL *GEOSLargestEmptyCircle_r(
GEOSContextHandle_t handle,
const GEOSGeometry* g,
const GEOSGeometry* boundary,
double tolerance);
/** \see GEOSMinimumWidth */
extern GEOSGeometry GEOS_DLL *GEOSMinimumWidth_r(
GEOSContextHandle_t handle,
const GEOSGeometry* g);
/** \see GEOSMinimumClearanceLine */
extern GEOSGeometry GEOS_DLL *GEOSMinimumClearanceLine_r(
GEOSContextHandle_t handle,
const GEOSGeometry* g);
/** \see GEOSMinimumClearance */
extern int GEOS_DLL GEOSMinimumClearance_r(
GEOSContextHandle_t handle,
const GEOSGeometry* g,
double* distance);
/** \see GEOSDifference */
extern GEOSGeometry GEOS_DLL *GEOSDifference_r(
GEOSContextHandle_t handle,
const GEOSGeometry* g1,
const GEOSGeometry* g2);
/** \see GEOSDifferencePrec */
extern GEOSGeometry GEOS_DLL *GEOSDifferencePrec_r(
GEOSContextHandle_t handle,
const GEOSGeometry* g1,
const GEOSGeometry* g2,
double gridSize);
/** \see GEOSSymDifference */
extern GEOSGeometry GEOS_DLL *GEOSSymDifference_r(
GEOSContextHandle_t handle,
const GEOSGeometry* g1,
const GEOSGeometry* g2);
/** \see GEOSSymDifferencePrec */
extern GEOSGeometry GEOS_DLL *GEOSSymDifferencePrec_r(
GEOSContextHandle_t handle,
const GEOSGeometry* g1,
const GEOSGeometry* g2,
double gridSize);
/** \see GEOSBoundary */
extern GEOSGeometry GEOS_DLL *GEOSBoundary_r(
GEOSContextHandle_t handle,
const GEOSGeometry* g);
/** \see GEOSUnion */
extern GEOSGeometry GEOS_DLL *GEOSUnion_r(
GEOSContextHandle_t handle,
const GEOSGeometry* g1,
const GEOSGeometry* g2);
/** \see GEOSUnionPrec */
extern GEOSGeometry GEOS_DLL *GEOSUnionPrec_r(
GEOSContextHandle_t handle,
const GEOSGeometry* g1,
const GEOSGeometry* g2,
double gridSize);
/** \see GEOSUnaryUnion */
extern GEOSGeometry GEOS_DLL *GEOSUnaryUnion_r(
GEOSContextHandle_t handle,
const GEOSGeometry* g);
/** \see GEOSUnaryUnionPrec */
extern GEOSGeometry GEOS_DLL *GEOSUnaryUnionPrec_r(
GEOSContextHandle_t handle,
const GEOSGeometry* g,
double gridSize);
/** \see GEOSCoverageUnion */
extern GEOSGeometry GEOS_DLL *GEOSCoverageUnion_r(
GEOSContextHandle_t handle,
const GEOSGeometry* g);
/** \see GEOSPointOnSurface */
extern GEOSGeometry GEOS_DLL *GEOSPointOnSurface_r(
GEOSContextHandle_t handle,
const GEOSGeometry* g);
/** \see GEOSGetCentroid */
extern GEOSGeometry GEOS_DLL *GEOSGetCentroid_r(
GEOSContextHandle_t handle,
const GEOSGeometry* g);
/** \see GEOSMinimumBoundingCircle */
extern GEOSGeometry GEOS_DLL *GEOSMinimumBoundingCircle_r(
GEOSContextHandle_t handle,
const GEOSGeometry* g,
double* radius,
GEOSGeometry** center);
/** \see GEOSNode */
extern GEOSGeometry GEOS_DLL *GEOSNode_r(
GEOSContextHandle_t handle,
const GEOSGeometry* g);
/** \see GEOSClipByRect */
extern GEOSGeometry GEOS_DLL *GEOSClipByRect_r(
GEOSContextHandle_t handle,
const GEOSGeometry* g,
double xmin, double ymin,
double xmax, double ymax);
/** \see GEOSPolygonize */
extern GEOSGeometry GEOS_DLL *GEOSPolygonize_r(
GEOSContextHandle_t handle,
const GEOSGeometry *const geoms[],
unsigned int ngeoms);
/** \see GEOSPolygonize_valid */
extern GEOSGeometry GEOS_DLL *GEOSPolygonize_valid_r(
GEOSContextHandle_t handle,
const GEOSGeometry *const geoms[],
unsigned int ngems);
/** \see GEOSPolygonizer_getCutEdges */
extern GEOSGeometry GEOS_DLL *GEOSPolygonizer_getCutEdges_r(
GEOSContextHandle_t handle,
const GEOSGeometry * const geoms[],
unsigned int ngeoms);
/** \see GEOSPolygonize_full */
extern GEOSGeometry GEOS_DLL *GEOSPolygonize_full_r(
GEOSContextHandle_t handle,
const GEOSGeometry* input,
GEOSGeometry** cuts,
GEOSGeometry** dangles,
GEOSGeometry** invalidRings);
/** \see GEOSBuildArea */
extern GEOSGeometry GEOS_DLL *GEOSBuildArea_r(
GEOSContextHandle_t handle,
const GEOSGeometry* g);
/** \see GEOSLineMerge */
extern GEOSGeometry GEOS_DLL *GEOSLineMerge_r(
GEOSContextHandle_t handle,
const GEOSGeometry* g);
/** \see GEOSReverse */
extern GEOSGeometry GEOS_DLL *GEOSReverse_r(
GEOSContextHandle_t handle,
const GEOSGeometry* g);
/** \see GEOSSimplify */
extern GEOSGeometry GEOS_DLL *GEOSSimplify_r(
GEOSContextHandle_t handle,
const GEOSGeometry* g,
double tolerance);
/** \see GEOSTopologyPreserveSimplify */
extern GEOSGeometry GEOS_DLL *GEOSTopologyPreserveSimplify_r(
GEOSContextHandle_t handle,
const GEOSGeometry* g, double tolerance);
/** \see GEOSGeom_extractUniquePoints */
extern GEOSGeometry GEOS_DLL *GEOSGeom_extractUniquePoints_r(
GEOSContextHandle_t handle,
const GEOSGeometry* g);
/** \see GEOSSharedPaths */
extern GEOSGeometry GEOS_DLL *GEOSSharedPaths_r(
GEOSContextHandle_t handle,
const GEOSGeometry* g1,
const GEOSGeometry* g2);
/** \see GEOSSnap */
extern GEOSGeometry GEOS_DLL *GEOSSnap_r(
GEOSContextHandle_t handle,
const GEOSGeometry* g1,
const GEOSGeometry* g2,
double tolerance);
/** \see GEOSDelaunayTriangulation */
extern GEOSGeometry GEOS_DLL * GEOSDelaunayTriangulation_r(
GEOSContextHandle_t handle,
const GEOSGeometry *g,
double tolerance,
int onlyEdges);
/** \see GEOSConstrainedDelaunayTriangulation */
extern GEOSGeometry GEOS_DLL * GEOSConstrainedDelaunayTriangulation_r(
GEOSContextHandle_t handle,
const GEOSGeometry *g);
/** \see GEOSVoronoiDiagram */
extern GEOSGeometry GEOS_DLL * GEOSVoronoiDiagram_r(
GEOSContextHandle_t extHandle,
const GEOSGeometry *g,
const GEOSGeometry *env,
double tolerance,
int onlyEdges);
/** \see GEOSSegmentIntersection */
extern int GEOS_DLL GEOSSegmentIntersection_r(
GEOSContextHandle_t extHandle,
double ax0, double ay0,
double ax1, double ay1,
double bx0, double by0,
double bx1, double by1,
double* cx, double* cy);
/* ========= Binary predicates ========= */