Test numGeometries
[geos.git] / capi / geos_c.cpp
blob9b337e19d802e1bf61369387d9ca540d70725302
1 /************************************************************************
3 * $Id$
5 * C-Wrapper for GEOS library
7 * Copyright (C) 2005-2006 Refractions Research Inc.
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.
14 * Author: Sandro Santilli <strk@refractions.net>
16 ***********************************************************************/
18 #include <geos/geom/prep/PreparedGeometryFactory.h>
19 #include <geos/index/strtree/STRtree.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/CLocalizer.h>
25 #include <geos/operation/overlay/OverlayOp.h>
26 #include <geos/operation/union/CascadedPolygonUnion.h>
27 #include <geos/algorithm/distance/DiscreteHausdorffDistance.h>
29 #ifdef _MSC_VER
30 #pragma warning(disable : 4099)
31 #endif
33 // Some extra magic to make type declarations in geos_c.h work - for cross-checking of types in header.
34 #define GEOSGeometry geos::geom::Geometry
35 #define GEOSPreparedGeometry geos::geom::prep::PreparedGeometry
36 #define GEOSCoordSequence geos::geom::CoordinateSequence
37 #define GEOSSTRtree geos::index::strtree::STRtree
38 #define GEOSWKTReader_t geos::io::WKTReader
39 #define GEOSWKTWriter_t geos::io::WKTWriter
40 #define GEOSWKBReader_t geos::io::WKBReader
41 #define GEOSWKBWriter_t geos::io::WKBWriter
43 #include "geos_c.h"
45 /// Define this if you want operations triggering Exceptions to
46 /// be printed (will use the NOTIFY channel - only implemented for GEOSUnion so far)
47 ///
48 #undef VERBOSE_EXCEPTIONS
50 #include <geos/export.h>
53 #if defined(_MSC_VER)
54 # define GEOS_DLL __declspec(dllexport)
55 #else
56 # define GEOS_DLL
57 #endif
60 // import the most frequently used definitions globally
61 using geos::geom::Geometry;
62 using geos::geom::LineString;
63 using geos::geom::Polygon;
64 using geos::geom::CoordinateSequence;
65 using geos::geom::GeometryFactory;
67 using geos::io::WKTReader;
68 using geos::io::WKTWriter;
69 using geos::io::WKBReader;
70 using geos::io::WKBWriter;
71 using geos::io::CLocalizer;
73 using geos::index::strtree::STRtree;
75 using geos::operation::overlay::OverlayOp;
76 using geos::operation::overlay::overlayOp;
77 using geos::operation::geounion::CascadedPolygonUnion;
79 typedef std::auto_ptr<Geometry> GeomAutoPtr;
81 //## GLOBALS ################################################
83 // NOTE: SRID will have to be changed after geometry creation
84 GEOSContextHandle_t handle = NULL;
86 extern "C" {
88 void
89 initGEOS (GEOSMessageHandler nf, GEOSMessageHandler ef)
91 if ( ! handle )
93 handle = initGEOS_r( nf, ef );
95 else
97 GEOSContext_setNoticeHandler_r(handle, nf);
98 GEOSContext_setErrorHandler_r(handle, ef);
102 void
103 finishGEOS ()
105 if (handle != NULL) {
106 finishGEOS_r( handle );
107 handle = NULL;
111 void
112 GEOSFree (void* buffer)
114 GEOSFree_r( handle, buffer );
117 /****************************************************************
118 ** relate()-related functions
119 ** return 0 = false, 1 = true, 2 = error occured
122 char
123 GEOSDisjoint(const Geometry *g1, const Geometry *g2)
125 return GEOSDisjoint_r( handle, g1, g2 );
128 char
129 GEOSTouches(const Geometry *g1, const Geometry *g2)
131 return GEOSTouches_r( handle, g1, g2 );
134 char
135 GEOSIntersects(const Geometry *g1, const Geometry *g2)
137 return GEOSIntersects_r( handle, g1, g2 );
140 char
141 GEOSCrosses(const Geometry *g1, const Geometry *g2)
143 return GEOSCrosses_r( handle, g1, g2 );
146 char
147 GEOSWithin(const Geometry *g1, const Geometry *g2)
149 return GEOSWithin_r( handle, g1, g2 );
152 // call g1->contains(g2)
153 // returns 0 = false
154 // 1 = true
155 // 2 = error was trapped
156 char
157 GEOSContains(const Geometry *g1, const Geometry *g2)
159 return GEOSContains_r( handle, g1, g2 );
162 char
163 GEOSOverlaps(const Geometry *g1, const Geometry *g2)
165 return GEOSOverlaps_r( handle, g1, g2 );
169 //-------------------------------------------------------------------
170 // low-level relate functions
171 //------------------------------------------------------------------
173 char
174 GEOSRelatePattern(const Geometry *g1, const Geometry *g2, const char *pat)
176 return GEOSRelatePattern_r( handle, g1, g2, pat );
179 char *
180 GEOSRelate(const Geometry *g1, const Geometry *g2)
182 return GEOSRelate_r( handle, g1, g2 );
187 //-----------------------------------------------------------------
188 // isValid
189 //-----------------------------------------------------------------
192 char
193 GEOSisValid(const Geometry *g1)
195 return GEOSisValid_r( handle, g1 );
198 char *
199 GEOSisValidReason(const Geometry *g1)
201 return GEOSisValidReason_r( handle, g1 );
204 char
205 GEOSisValidDetail(const Geometry *g,
206 char** reason, const Geometry ** location)
208 return GEOSisValidDetail_r( handle, g, reason, location );
211 //-----------------------------------------------------------------
212 // general purpose
213 //-----------------------------------------------------------------
215 char
216 GEOSEquals(const Geometry *g1, const Geometry *g2)
218 return GEOSEquals_r( handle, g1, g2 );
221 char
222 GEOSEqualsExact(const Geometry *g1, const Geometry *g2, double tolerance)
224 return GEOSEqualsExact_r( handle, g1, g2, tolerance );
228 GEOSDistance(const Geometry *g1, const Geometry *g2, double *dist)
230 return GEOSDistance_r( handle, g1, g2, dist );
234 GEOSHausdorffDistance(const Geometry *g1, const Geometry *g2, double *dist)
236 return GEOSHausdorffDistance_r( handle, g1, g2, dist );
240 GEOSHausdorffDistanceDensify(const Geometry *g1, const Geometry *g2, double densifyFrac, double *dist)
242 return GEOSHausdorffDistanceDensify_r( handle, g1, g2, densifyFrac, dist );
246 GEOSArea(const Geometry *g, double *area)
248 return GEOSArea_r( handle, g, area );
252 GEOSLength(const Geometry *g, double *length)
254 return GEOSLength_r( handle, g, length );
257 Geometry *
258 GEOSGeomFromWKT(const char *wkt)
260 return GEOSGeomFromWKT_r( handle, wkt );
263 char *
264 GEOSGeomToWKT(const Geometry *g1)
266 return GEOSGeomToWKT_r( handle, g1 );
269 // Remember to free the result!
270 unsigned char *
271 GEOSGeomToWKB_buf(const Geometry *g, size_t *size)
273 return GEOSGeomToWKB_buf_r( handle, g, size );
276 Geometry *
277 GEOSGeomFromWKB_buf(const unsigned char *wkb, size_t size)
279 return GEOSGeomFromWKB_buf_r( handle, wkb, size );
282 /* Read/write wkb hex values. Returned geometries are
283 owned by the caller.*/
284 unsigned char *
285 GEOSGeomToHEX_buf(const Geometry *g, size_t *size)
287 return GEOSGeomToHEX_buf_r( handle, g, size );
290 Geometry *
291 GEOSGeomFromHEX_buf(const unsigned char *hex, size_t size)
293 return GEOSGeomFromHEX_buf_r( handle, hex, size );
296 char
297 GEOSisEmpty(const Geometry *g1)
299 return GEOSisEmpty_r( handle, g1 );
302 char
303 GEOSisSimple(const Geometry *g1)
305 return GEOSisSimple_r( handle, g1 );
308 char
309 GEOSisRing(const Geometry *g)
311 return GEOSisRing_r( handle, g );
316 //free the result of this
317 char *
318 GEOSGeomType(const Geometry *g1)
320 return GEOSGeomType_r( handle, g1 );
323 // Return postgis geometry type index
325 GEOSGeomTypeId(const Geometry *g1)
327 return GEOSGeomTypeId_r( handle, g1 );
333 //-------------------------------------------------------------------
334 // GEOS functions that return geometries
335 //-------------------------------------------------------------------
337 Geometry *
338 GEOSEnvelope(const Geometry *g1)
340 return GEOSEnvelope_r( handle, g1 );
343 Geometry *
344 GEOSIntersection(const Geometry *g1, const Geometry *g2)
346 return GEOSIntersection_r( handle, g1, g2 );
349 Geometry *
350 GEOSBuffer(const Geometry *g1, double width, int quadrantsegments)
352 return GEOSBuffer_r( handle, g1, width, quadrantsegments );
355 Geometry *
356 GEOSBufferWithStyle(const Geometry *g1, double width, int quadsegs,
357 int endCapStyle, int joinStyle, double mitreLimit)
359 return GEOSBufferWithStyle_r( handle, g1, width, quadsegs, endCapStyle,
360 joinStyle, mitreLimit );
363 Geometry *
364 GEOSSingleSidedBuffer(const Geometry *g1, double width, int quadsegs,
365 int joinStyle, double mitreLimit, int leftSide)
367 return GEOSSingleSidedBuffer_r( handle, g1, width, quadsegs,
368 joinStyle, mitreLimit, leftSide );
371 Geometry *
372 GEOSConvexHull(const Geometry *g1)
374 return GEOSConvexHull_r( handle, g1 );
377 Geometry *
378 GEOSDifference(const Geometry *g1, const Geometry *g2)
380 return GEOSDifference_r( handle, g1, g2 );
383 Geometry *
384 GEOSBoundary(const Geometry *g1)
386 return GEOSBoundary_r( handle, g1 );
389 Geometry *
390 GEOSSymDifference(const Geometry *g1, const Geometry *g2)
392 return GEOSSymDifference_r( handle, g1, g2 );
395 Geometry *
396 GEOSUnion(const Geometry *g1, const Geometry *g2)
398 return GEOSUnion_r( handle, g1, g2 );
401 Geometry *
402 GEOSUnionCascaded(const Geometry *g1)
404 return GEOSUnionCascaded_r( handle, g1 );
407 Geometry *
408 GEOSPointOnSurface(const Geometry *g1)
410 return GEOSPointOnSurface_r( handle, g1 );
417 //-------------------------------------------------------------------
418 // memory management functions
419 //------------------------------------------------------------------
422 void
423 GEOSGeom_destroy(Geometry *a)
425 return GEOSGeom_destroy_r( handle, a );
430 GEOSGetNumCoordinates(const Geometry *g1)
432 return GEOSGetNumCoordinates_r( handle, g1 );
436 * Return -1 on exception, 0 otherwise.
437 * Converts Geometry to normal form (or canonical form).
440 GEOSNormalize(Geometry *g1)
442 return GEOSNormalize_r( handle, g1 );
446 GEOSGetNumInteriorRings(const Geometry *g1)
448 return GEOSGetNumInteriorRings_r( handle, g1 );
452 // returns -1 on error and 1 for non-multi geometries
454 GEOSGetNumGeometries(const Geometry *g1)
456 return GEOSGetNumGeometries_r( handle, g1 );
461 * Call only on GEOMETRYCOLLECTION or MULTI*.
462 * Return a pointer to the internal Geometry.
464 const Geometry *
465 GEOSGetGeometryN(const Geometry *g1, int n)
467 return GEOSGetGeometryN_r( handle, g1, n );
471 * Call only on LINESTRING
472 * Returns NULL on exception
474 Geometry *
475 GEOSGeomGetPointN(const Geometry *g1, int n)
477 return GEOSGeomGetPointN_r(handle, g1, n);
481 * Call only on LINESTRING
483 Geometry *
484 GEOSGeomGetStartPoint(const Geometry *g1)
486 return GEOSGeomGetStartPoint_r(handle, g1);
490 * Call only on LINESTRING
492 Geometry *
493 GEOSGeomGetEndPoint(const Geometry *g1)
495 return GEOSGeomGetEndPoint_r(handle, g1);
499 * Call only on LINESTRING
500 * return 2 on exception, 1 on true, 0 on false
502 char
503 GEOSisClosed(const Geometry *g1)
505 return GEOSisClosed_r(handle, g1);
509 * Call only on LINESTRING
510 * returns 0 on exception, otherwise 1
513 GEOSGeomGetLength(const Geometry *g1, double *length)
515 return GEOSGeomGetLength_r(handle, g1, length);
519 * Call only on LINESTRING
520 * returns -1 on exception
523 GEOSGeomGetNumPoints(const Geometry *g1)
525 return GEOSGeomGetNumPoints_r(handle, g1);
529 * For POINT
530 * returns 0 on exception, otherwise 1
533 GEOSGeomGetX(const Geometry *g1, double *x)
535 return GEOSGeomGetX_r(handle, g1, x);
539 * For POINT
540 * returns 0 on exception, otherwise 1
543 GEOSGeomGetY(const Geometry *g1, double *y)
545 return GEOSGeomGetY_r(handle, g1, y);
549 * Call only on polygon
550 * Return a copy of the internal Geometry.
552 const Geometry *
553 GEOSGetExteriorRing(const Geometry *g1)
555 return GEOSGetExteriorRing_r( handle, g1 );
559 * Call only on polygon
560 * Return a pointer to internal storage, do not destroy it.
562 const Geometry *
563 GEOSGetInteriorRingN(const Geometry *g1, int n)
565 return GEOSGetInteriorRingN_r( handle, g1, n );
568 Geometry *
569 GEOSGetCentroid(const Geometry *g)
571 return GEOSGetCentroid_r( handle, g );
574 Geometry *
575 GEOSGeom_createCollection(int type, Geometry **geoms, unsigned int ngeoms)
577 return GEOSGeom_createCollection_r( handle, type, geoms, ngeoms );
580 Geometry *
581 GEOSPolygonize(const Geometry * const * g, unsigned int ngeoms)
583 return GEOSPolygonize_r( handle, g, ngeoms );
586 Geometry *
587 GEOSPolygonizer_getCutEdges(const Geometry * const * g, unsigned int ngeoms)
589 return GEOSPolygonizer_getCutEdges_r( handle, g, ngeoms );
592 GEOSGeometry *
593 GEOSPolygonize_full(const GEOSGeometry* input,
594 GEOSGeometry** cuts, GEOSGeometry** dangles, GEOSGeometry** invalid)
596 return GEOSPolygonize_full_r(handle, input, cuts, dangles, invalid );
599 Geometry *
600 GEOSLineMerge(const Geometry *g)
602 return GEOSLineMerge_r( handle, g );
606 GEOSGetSRID(const Geometry *g)
608 return GEOSGetSRID_r( handle, g );
611 void
612 GEOSSetSRID(Geometry *g, int srid)
614 return GEOSSetSRID_r( handle, g, srid );
617 char
618 GEOSHasZ(const Geometry *g)
620 return GEOSHasZ_r( handle, g );
624 GEOS_getWKBOutputDims()
626 return GEOS_getWKBOutputDims_r( handle );
630 GEOS_setWKBOutputDims(int newdims)
632 return GEOS_setWKBOutputDims_r( handle, newdims );
636 GEOS_getWKBByteOrder()
638 return GEOS_getWKBByteOrder_r( handle );
642 GEOS_setWKBByteOrder(int byteOrder)
644 return GEOS_setWKBByteOrder_r( handle, byteOrder );
648 CoordinateSequence *
649 GEOSCoordSeq_create(unsigned int size, unsigned int dims)
651 return GEOSCoordSeq_create_r( handle, size, dims );
655 GEOSCoordSeq_setOrdinate(CoordinateSequence *s, unsigned int idx, unsigned int dim, double val)
657 return GEOSCoordSeq_setOrdinate_r( handle, s, idx, dim, val );
661 GEOSCoordSeq_setX(CoordinateSequence *s, unsigned int idx, double val)
663 return GEOSCoordSeq_setOrdinate(s, idx, 0, val);
667 GEOSCoordSeq_setY(CoordinateSequence *s, unsigned int idx, double val)
669 return GEOSCoordSeq_setOrdinate(s, idx, 1, val);
673 GEOSCoordSeq_setZ(CoordinateSequence *s, unsigned int idx, double val)
675 return GEOSCoordSeq_setOrdinate(s, idx, 2, val);
678 CoordinateSequence *
679 GEOSCoordSeq_clone(const CoordinateSequence *s)
681 return GEOSCoordSeq_clone_r( handle, s );
685 GEOSCoordSeq_getOrdinate(const CoordinateSequence *s, unsigned int idx, unsigned int dim, double *val)
687 return GEOSCoordSeq_getOrdinate_r( handle, s, idx, dim, val );
691 GEOSCoordSeq_getX(const CoordinateSequence *s, unsigned int idx, double *val)
693 return GEOSCoordSeq_getOrdinate(s, idx, 0, val);
697 GEOSCoordSeq_getY(const CoordinateSequence *s, unsigned int idx, double *val)
699 return GEOSCoordSeq_getOrdinate(s, idx, 1, val);
703 GEOSCoordSeq_getZ(const CoordinateSequence *s, unsigned int idx, double *val)
705 return GEOSCoordSeq_getOrdinate(s, idx, 2, val);
709 GEOSCoordSeq_getSize(const CoordinateSequence *s, unsigned int *size)
711 return GEOSCoordSeq_getSize_r( handle, s, size );
715 GEOSCoordSeq_getDimensions(const CoordinateSequence *s, unsigned int *dims)
717 return GEOSCoordSeq_getDimensions_r( handle, s, dims );
720 void
721 GEOSCoordSeq_destroy(CoordinateSequence *s)
723 return GEOSCoordSeq_destroy_r( handle, s );
726 const CoordinateSequence *
727 GEOSGeom_getCoordSeq(const Geometry *g)
729 return GEOSGeom_getCoordSeq_r( handle, g );
732 Geometry *
733 GEOSGeom_createPoint(CoordinateSequence *cs)
735 return GEOSGeom_createPoint_r( handle, cs );
738 Geometry *
739 GEOSGeom_createLinearRing(CoordinateSequence *cs)
741 return GEOSGeom_createLinearRing_r( handle, cs );
744 Geometry *
745 GEOSGeom_createLineString(CoordinateSequence *cs)
747 return GEOSGeom_createLineString_r( handle, cs );
750 Geometry *
751 GEOSGeom_createPolygon(Geometry *shell, Geometry **holes, unsigned int nholes)
753 return GEOSGeom_createPolygon_r( handle, shell, holes, nholes );
756 Geometry *
757 GEOSGeom_clone(const Geometry *g)
759 return GEOSGeom_clone_r( handle, g );
763 GEOSGeom_getDimensions(const Geometry *g)
765 return GEOSGeom_getDimensions_r( handle, g );
769 GEOSGeom_getCoordinateDimension(const Geometry *g)
771 return GEOSGeom_getCoordinateDimension_r( handle, g );
774 Geometry *
775 GEOSSimplify(const Geometry *g1, double tolerance)
777 return GEOSSimplify_r( handle, g1, tolerance );
780 Geometry *
781 GEOSTopologyPreserveSimplify(const Geometry *g1, double tolerance)
783 return GEOSTopologyPreserveSimplify_r( handle, g1, tolerance );
787 /* WKT Reader */
788 WKTReader *
789 GEOSWKTReader_create()
791 return GEOSWKTReader_create_r( handle );
794 void
795 GEOSWKTReader_destroy(WKTReader *reader)
797 GEOSWKTReader_destroy_r( handle, reader );
801 Geometry*
802 GEOSWKTReader_read(WKTReader *reader, const char *wkt)
804 return GEOSWKTReader_read_r( handle, reader, wkt );
807 /* WKT Writer */
808 WKTWriter *
809 GEOSWKTWriter_create()
811 return GEOSWKTWriter_create_r( handle );
814 void
815 GEOSWKTWriter_destroy(WKTWriter *Writer)
817 GEOSWKTWriter_destroy_r( handle, Writer );
820 char*
821 GEOSWKTWriter_write(WKTWriter *writer, const Geometry *geom)
823 return GEOSWKTWriter_write_r( handle, writer, geom );
826 void
827 GEOSWKTWriter_setTrim(WKTWriter *writer, char trim)
829 GEOSWKTWriter_setTrim_r(handle, writer, trim);
832 void
833 GEOSWKTWriter_setRoundingPrecision(WKTWriter *writer, int precision)
835 return GEOSWKTWriter_setRoundingPrecision_r(handle, writer, precision);
838 void
839 GEOSWKTWriter_setOutputDimension(WKTWriter *writer, int dim)
841 GEOSWKTWriter_setOutputDimension_r(handle, writer, dim);
844 void
845 GEOSWKTWriter_setOld3D(WKTWriter *writer, int useOld3D)
847 GEOSWKTWriter_setOld3D_r(handle, writer, useOld3D);
850 /* WKB Reader */
851 WKBReader *
852 GEOSWKBReader_create()
854 return GEOSWKBReader_create_r( handle );
857 void
858 GEOSWKBReader_destroy(WKBReader *reader)
860 GEOSWKBReader_destroy_r( handle, reader );
864 Geometry*
865 GEOSWKBReader_read(WKBReader *reader, const unsigned char *wkb, size_t size)
867 return GEOSWKBReader_read_r( handle, reader, wkb, size );
870 Geometry*
871 GEOSWKBReader_readHEX(WKBReader *reader, const unsigned char *hex, size_t size)
873 return GEOSWKBReader_readHEX_r( handle, reader, hex, size );
876 /* WKB Writer */
877 WKBWriter *
878 GEOSWKBWriter_create()
880 return GEOSWKBWriter_create_r( handle );
883 void
884 GEOSWKBWriter_destroy(WKBWriter *Writer)
886 GEOSWKBWriter_destroy_r( handle, Writer );
890 /* The caller owns the result */
891 unsigned char*
892 GEOSWKBWriter_write(WKBWriter *writer, const Geometry *geom, size_t *size)
894 return GEOSWKBWriter_write_r( handle, writer, geom, size );
897 /* The caller owns the result */
898 unsigned char*
899 GEOSWKBWriter_writeHEX(WKBWriter *writer, const Geometry *geom, size_t *size)
901 return GEOSWKBWriter_writeHEX_r( handle, writer, geom, size );
905 GEOSWKBWriter_getOutputDimension(const GEOSWKBWriter* writer)
907 return GEOSWKBWriter_getOutputDimension_r( handle, writer );
910 void
911 GEOSWKBWriter_setOutputDimension(GEOSWKBWriter* writer, int newDimension)
913 GEOSWKBWriter_setOutputDimension_r( handle, writer, newDimension );
917 GEOSWKBWriter_getByteOrder(const GEOSWKBWriter* writer)
919 return GEOSWKBWriter_getByteOrder_r( handle, writer );
922 void
923 GEOSWKBWriter_setByteOrder(GEOSWKBWriter* writer, int newByteOrder)
925 GEOSWKBWriter_setByteOrder_r( handle, writer, newByteOrder );
928 char
929 GEOSWKBWriter_getIncludeSRID(const GEOSWKBWriter* writer)
931 return GEOSWKBWriter_getIncludeSRID_r( handle, writer );
934 void
935 GEOSWKBWriter_setIncludeSRID(GEOSWKBWriter* writer, const char newIncludeSRID)
937 GEOSWKBWriter_setIncludeSRID_r( handle, writer, newIncludeSRID );
941 //-----------------------------------------------------------------
942 // Prepared Geometry
943 //-----------------------------------------------------------------
945 const geos::geom::prep::PreparedGeometry*
946 GEOSPrepare(const Geometry *g)
948 return GEOSPrepare_r( handle, g );
951 void
952 GEOSPreparedGeom_destroy(const geos::geom::prep::PreparedGeometry *a)
954 GEOSPreparedGeom_destroy_r( handle, a );
957 char
958 GEOSPreparedContains(const geos::geom::prep::PreparedGeometry *pg1, const Geometry *g2)
960 return GEOSPreparedContains_r( handle, pg1, g2 );
963 char
964 GEOSPreparedContainsProperly(const geos::geom::prep::PreparedGeometry *pg1, const Geometry *g2)
966 return GEOSPreparedContainsProperly_r( handle, pg1, g2 );
969 char
970 GEOSPreparedCovers(const geos::geom::prep::PreparedGeometry *pg1, const Geometry *g2)
972 return GEOSPreparedCovers_r( handle, pg1, g2 );
975 char
976 GEOSPreparedIntersects(const geos::geom::prep::PreparedGeometry *pg1, const Geometry *g2)
978 return GEOSPreparedIntersects_r( handle, pg1, g2 );
981 STRtree *
982 GEOSSTRtree_create (size_t nodeCapacity)
984 return GEOSSTRtree_create_r( handle, nodeCapacity );
987 void
988 GEOSSTRtree_insert (geos::index::strtree::STRtree *tree,
989 const geos::geom::Geometry *g,
990 void *item)
992 GEOSSTRtree_insert_r( handle, tree, g, item );
995 void
996 GEOSSTRtree_query (geos::index::strtree::STRtree *tree,
997 const geos::geom::Geometry *g,
998 GEOSQueryCallback cb,
999 void *userdata)
1001 GEOSSTRtree_query_r( handle, tree, g, cb, userdata );
1004 void
1005 GEOSSTRtree_iterate(geos::index::strtree::STRtree *tree,
1006 GEOSQueryCallback callback,
1007 void *userdata)
1009 GEOSSTRtree_iterate_r( handle, tree, callback, userdata );
1012 char
1013 GEOSSTRtree_remove (geos::index::strtree::STRtree *tree,
1014 const geos::geom::Geometry *g,
1015 void *item)
1017 return GEOSSTRtree_remove_r( handle, tree, g, item );
1020 void
1021 GEOSSTRtree_destroy (geos::index::strtree::STRtree *tree)
1023 GEOSSTRtree_destroy_r( handle, tree );
1026 double
1027 GEOSProject (const geos::geom::Geometry *g,
1028 const geos::geom::Geometry *p)
1030 return GEOSProject_r (handle, g, p);
1033 geos::geom::Geometry *
1034 GEOSInterpolate (const geos::geom::Geometry *g,
1035 double d)
1037 return GEOSInterpolate_r(handle, g, d);
1040 double
1041 GEOSProjectNormalized (const geos::geom::Geometry *g,
1042 const geos::geom::Geometry *p)
1044 return GEOSProjectNormalized_r (handle, g, p);
1047 geos::geom::Geometry *
1048 GEOSInterpolateNormalized (const geos::geom::Geometry *g,
1049 double d)
1051 return GEOSInterpolateNormalized_r(handle, g, d);
1054 geos::geom::Geometry *
1055 GEOSGeom_extractUniquePoints (const geos::geom::Geometry *g)
1057 return GEOSGeom_extractUniquePoints_r(handle, g);
1060 geos::geom::Geometry *
1061 GEOSGeom_createEmptyCollection(int type)
1063 return GEOSGeom_createEmptyCollection_r(handle, type);
1066 geos::geom::Geometry *
1067 GEOSGeom_createEmptyPoint()
1069 return GEOSGeom_createEmptyPoint_r(handle);
1072 geos::geom::Geometry *
1073 GEOSGeom_createEmptyLineString()
1075 return GEOSGeom_createEmptyLineString_r(handle);
1078 geos::geom::Geometry *
1079 GEOSGeom_createEmptyPolygon()
1081 return GEOSGeom_createEmptyPolygon_r(handle);
1085 GEOSOrientationIndex(double Ax, double Ay, double Bx, double By,
1086 double Px, double Py)
1088 return GEOSOrientationIndex_r(handle, Ax, Ay, Bx, By, Px, Py);
1091 } /* extern "C" */