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