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