1 /************************************************************************
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>
30 #pragma warning(disable : 4099)
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
45 /// Define this if you want operations triggering Exceptions to
46 /// be printed (will use the NOTIFY channel - only implemented for GEOSUnion so far)
48 #undef VERBOSE_EXCEPTIONS
50 #include <geos/export.h>
54 # define GEOS_DLL __declspec(dllexport)
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
;
89 initGEOS (GEOSMessageHandler nf
, GEOSMessageHandler ef
)
93 handle
= initGEOS_r( nf
, ef
);
97 GEOSContext_setNoticeHandler_r(handle
, nf
);
98 GEOSContext_setErrorHandler_r(handle
, ef
);
105 if (handle
!= NULL
) {
106 finishGEOS_r( handle
);
112 GEOSFree (void* buffer
)
114 GEOSFree_r( handle
, buffer
);
117 /****************************************************************
118 ** relate()-related functions
119 ** return 0 = false, 1 = true, 2 = error occured
123 GEOSDisjoint(const Geometry
*g1
, const Geometry
*g2
)
125 return GEOSDisjoint_r( handle
, g1
, g2
);
129 GEOSTouches(const Geometry
*g1
, const Geometry
*g2
)
131 return GEOSTouches_r( handle
, g1
, g2
);
135 GEOSIntersects(const Geometry
*g1
, const Geometry
*g2
)
137 return GEOSIntersects_r( handle
, g1
, g2
);
141 GEOSCrosses(const Geometry
*g1
, const Geometry
*g2
)
143 return GEOSCrosses_r( handle
, g1
, g2
);
147 GEOSWithin(const Geometry
*g1
, const Geometry
*g2
)
149 return GEOSWithin_r( handle
, g1
, g2
);
152 // call g1->contains(g2)
155 // 2 = error was trapped
157 GEOSContains(const Geometry
*g1
, const Geometry
*g2
)
159 return GEOSContains_r( handle
, g1
, g2
);
163 GEOSOverlaps(const Geometry
*g1
, const Geometry
*g2
)
165 return GEOSOverlaps_r( handle
, g1
, g2
);
169 //-------------------------------------------------------------------
170 // low-level relate functions
171 //------------------------------------------------------------------
174 GEOSRelatePattern(const Geometry
*g1
, const Geometry
*g2
, const char *pat
)
176 return GEOSRelatePattern_r( handle
, g1
, g2
, pat
);
180 GEOSRelate(const Geometry
*g1
, const Geometry
*g2
)
182 return GEOSRelate_r( handle
, g1
, g2
);
187 //-----------------------------------------------------------------
189 //-----------------------------------------------------------------
193 GEOSisValid(const Geometry
*g1
)
195 return GEOSisValid_r( handle
, g1
);
199 GEOSisValidReason(const Geometry
*g1
)
201 return GEOSisValidReason_r( handle
, g1
);
205 GEOSisValidDetail(const Geometry
*g
,
206 char** reason
, const Geometry
** location
)
208 return GEOSisValidDetail_r( handle
, g
, reason
, location
);
211 //-----------------------------------------------------------------
213 //-----------------------------------------------------------------
216 GEOSEquals(const Geometry
*g1
, const Geometry
*g2
)
218 return GEOSEquals_r( handle
, g1
, g2
);
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
);
258 GEOSGeomFromWKT(const char *wkt
)
260 return GEOSGeomFromWKT_r( handle
, wkt
);
264 GEOSGeomToWKT(const Geometry
*g1
)
266 return GEOSGeomToWKT_r( handle
, g1
);
269 // Remember to free the result!
271 GEOSGeomToWKB_buf(const Geometry
*g
, size_t *size
)
273 return GEOSGeomToWKB_buf_r( handle
, g
, size
);
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.*/
285 GEOSGeomToHEX_buf(const Geometry
*g
, size_t *size
)
287 return GEOSGeomToHEX_buf_r( handle
, g
, size
);
291 GEOSGeomFromHEX_buf(const unsigned char *hex
, size_t size
)
293 return GEOSGeomFromHEX_buf_r( handle
, hex
, size
);
297 GEOSisEmpty(const Geometry
*g1
)
299 return GEOSisEmpty_r( handle
, g1
);
303 GEOSisSimple(const Geometry
*g1
)
305 return GEOSisSimple_r( handle
, g1
);
309 GEOSisRing(const Geometry
*g
)
311 return GEOSisRing_r( handle
, g
);
316 //free the result of this
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 //-------------------------------------------------------------------
338 GEOSEnvelope(const Geometry
*g1
)
340 return GEOSEnvelope_r( handle
, g1
);
344 GEOSIntersection(const Geometry
*g1
, const Geometry
*g2
)
346 return GEOSIntersection_r( handle
, g1
, g2
);
350 GEOSBuffer(const Geometry
*g1
, double width
, int quadrantsegments
)
352 return GEOSBuffer_r( handle
, g1
, width
, quadrantsegments
);
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
);
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
);
372 GEOSConvexHull(const Geometry
*g1
)
374 return GEOSConvexHull_r( handle
, g1
);
378 GEOSDifference(const Geometry
*g1
, const Geometry
*g2
)
380 return GEOSDifference_r( handle
, g1
, g2
);
384 GEOSBoundary(const Geometry
*g1
)
386 return GEOSBoundary_r( handle
, g1
);
390 GEOSSymDifference(const Geometry
*g1
, const Geometry
*g2
)
392 return GEOSSymDifference_r( handle
, g1
, g2
);
396 GEOSUnion(const Geometry
*g1
, const Geometry
*g2
)
398 return GEOSUnion_r( handle
, g1
, g2
);
402 GEOSUnionCascaded(const Geometry
*g1
)
404 return GEOSUnionCascaded_r( handle
, g1
);
408 GEOSPointOnSurface(const Geometry
*g1
)
410 return GEOSPointOnSurface_r( handle
, g1
);
417 //-------------------------------------------------------------------
418 // memory management functions
419 //------------------------------------------------------------------
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.
465 GEOSGetGeometryN(const Geometry
*g1
, int n
)
467 return GEOSGetGeometryN_r( handle
, g1
, n
);
471 * Call only on LINESTRING
472 * Returns NULL on exception
475 GEOSGeomGetPointN(const Geometry
*g1
, int n
)
477 return GEOSGeomGetPointN_r(handle
, g1
, n
);
481 * Call only on LINESTRING
484 GEOSGeomGetStartPoint(const Geometry
*g1
)
486 return GEOSGeomGetStartPoint_r(handle
, g1
);
490 * Call only on LINESTRING
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
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
);
530 * returns 0 on exception, otherwise 1
533 GEOSGeomGetX(const Geometry
*g1
, double *x
)
535 return GEOSGeomGetX_r(handle
, g1
, x
);
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.
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.
563 GEOSGetInteriorRingN(const Geometry
*g1
, int n
)
565 return GEOSGetInteriorRingN_r( handle
, g1
, n
);
569 GEOSGetCentroid(const Geometry
*g
)
571 return GEOSGetCentroid_r( handle
, g
);
575 GEOSGeom_createCollection(int type
, Geometry
**geoms
, unsigned int ngeoms
)
577 return GEOSGeom_createCollection_r( handle
, type
, geoms
, ngeoms
);
581 GEOSPolygonize(const Geometry
* const * g
, unsigned int ngeoms
)
583 return GEOSPolygonize_r( handle
, g
, ngeoms
);
587 GEOSPolygonizer_getCutEdges(const Geometry
* const * g
, unsigned int ngeoms
)
589 return GEOSPolygonizer_getCutEdges_r( handle
, g
, ngeoms
);
593 GEOSPolygonize_full(const GEOSGeometry
* input
,
594 GEOSGeometry
** cuts
, GEOSGeometry
** dangles
, GEOSGeometry
** invalid
)
596 return GEOSPolygonize_full_r(handle
, input
, cuts
, dangles
, invalid
);
600 GEOSLineMerge(const Geometry
*g
)
602 return GEOSLineMerge_r( handle
, g
);
606 GEOSGetSRID(const Geometry
*g
)
608 return GEOSGetSRID_r( handle
, g
);
612 GEOSSetSRID(Geometry
*g
, int srid
)
614 return GEOSSetSRID_r( handle
, g
, srid
);
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
);
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
);
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
);
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
);
733 GEOSGeom_createPoint(CoordinateSequence
*cs
)
735 return GEOSGeom_createPoint_r( handle
, cs
);
739 GEOSGeom_createLinearRing(CoordinateSequence
*cs
)
741 return GEOSGeom_createLinearRing_r( handle
, cs
);
745 GEOSGeom_createLineString(CoordinateSequence
*cs
)
747 return GEOSGeom_createLineString_r( handle
, cs
);
751 GEOSGeom_createPolygon(Geometry
*shell
, Geometry
**holes
, unsigned int nholes
)
753 return GEOSGeom_createPolygon_r( handle
, shell
, holes
, nholes
);
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
);
775 GEOSSimplify(const Geometry
*g1
, double tolerance
)
777 return GEOSSimplify_r( handle
, g1
, tolerance
);
781 GEOSTopologyPreserveSimplify(const Geometry
*g1
, double tolerance
)
783 return GEOSTopologyPreserveSimplify_r( handle
, g1
, tolerance
);
789 GEOSWKTReader_create()
791 return GEOSWKTReader_create_r( handle
);
795 GEOSWKTReader_destroy(WKTReader
*reader
)
797 GEOSWKTReader_destroy_r( handle
, reader
);
802 GEOSWKTReader_read(WKTReader
*reader
, const char *wkt
)
804 return GEOSWKTReader_read_r( handle
, reader
, wkt
);
809 GEOSWKTWriter_create()
811 return GEOSWKTWriter_create_r( handle
);
815 GEOSWKTWriter_destroy(WKTWriter
*Writer
)
817 GEOSWKTWriter_destroy_r( handle
, Writer
);
821 GEOSWKTWriter_write(WKTWriter
*writer
, const Geometry
*geom
)
823 return GEOSWKTWriter_write_r( handle
, writer
, geom
);
827 GEOSWKTWriter_setTrim(WKTWriter
*writer
, char trim
)
829 GEOSWKTWriter_setTrim_r(handle
, writer
, trim
);
833 GEOSWKTWriter_setRoundingPrecision(WKTWriter
*writer
, int precision
)
835 return GEOSWKTWriter_setRoundingPrecision_r(handle
, writer
, precision
);
839 GEOSWKTWriter_setOutputDimension(WKTWriter
*writer
, int dim
)
841 GEOSWKTWriter_setOutputDimension_r(handle
, writer
, dim
);
845 GEOSWKTWriter_setOld3D(WKTWriter
*writer
, int useOld3D
)
847 GEOSWKTWriter_setOld3D_r(handle
, writer
, useOld3D
);
852 GEOSWKBReader_create()
854 return GEOSWKBReader_create_r( handle
);
858 GEOSWKBReader_destroy(WKBReader
*reader
)
860 GEOSWKBReader_destroy_r( handle
, reader
);
865 GEOSWKBReader_read(WKBReader
*reader
, const unsigned char *wkb
, size_t size
)
867 return GEOSWKBReader_read_r( handle
, reader
, wkb
, size
);
871 GEOSWKBReader_readHEX(WKBReader
*reader
, const unsigned char *hex
, size_t size
)
873 return GEOSWKBReader_readHEX_r( handle
, reader
, hex
, size
);
878 GEOSWKBWriter_create()
880 return GEOSWKBWriter_create_r( handle
);
884 GEOSWKBWriter_destroy(WKBWriter
*Writer
)
886 GEOSWKBWriter_destroy_r( handle
, Writer
);
890 /* The caller owns the result */
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 */
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
);
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
);
923 GEOSWKBWriter_setByteOrder(GEOSWKBWriter
* writer
, int newByteOrder
)
925 GEOSWKBWriter_setByteOrder_r( handle
, writer
, newByteOrder
);
929 GEOSWKBWriter_getIncludeSRID(const GEOSWKBWriter
* writer
)
931 return GEOSWKBWriter_getIncludeSRID_r( handle
, writer
);
935 GEOSWKBWriter_setIncludeSRID(GEOSWKBWriter
* writer
, const char newIncludeSRID
)
937 GEOSWKBWriter_setIncludeSRID_r( handle
, writer
, newIncludeSRID
);
941 //-----------------------------------------------------------------
943 //-----------------------------------------------------------------
945 const geos::geom::prep::PreparedGeometry
*
946 GEOSPrepare(const Geometry
*g
)
948 return GEOSPrepare_r( handle
, g
);
952 GEOSPreparedGeom_destroy(const geos::geom::prep::PreparedGeometry
*a
)
954 GEOSPreparedGeom_destroy_r( handle
, a
);
958 GEOSPreparedContains(const geos::geom::prep::PreparedGeometry
*pg1
, const Geometry
*g2
)
960 return GEOSPreparedContains_r( handle
, pg1
, g2
);
964 GEOSPreparedContainsProperly(const geos::geom::prep::PreparedGeometry
*pg1
, const Geometry
*g2
)
966 return GEOSPreparedContainsProperly_r( handle
, pg1
, g2
);
970 GEOSPreparedCovers(const geos::geom::prep::PreparedGeometry
*pg1
, const Geometry
*g2
)
972 return GEOSPreparedCovers_r( handle
, pg1
, g2
);
976 GEOSPreparedIntersects(const geos::geom::prep::PreparedGeometry
*pg1
, const Geometry
*g2
)
978 return GEOSPreparedIntersects_r( handle
, pg1
, g2
);
982 GEOSSTRtree_create (size_t nodeCapacity
)
984 return GEOSSTRtree_create_r( handle
, nodeCapacity
);
988 GEOSSTRtree_insert (geos::index::strtree::STRtree
*tree
,
989 const geos::geom::Geometry
*g
,
992 GEOSSTRtree_insert_r( handle
, tree
, g
, item
);
996 GEOSSTRtree_query (geos::index::strtree::STRtree
*tree
,
997 const geos::geom::Geometry
*g
,
998 GEOSQueryCallback cb
,
1001 GEOSSTRtree_query_r( handle
, tree
, g
, cb
, userdata
);
1005 GEOSSTRtree_iterate(geos::index::strtree::STRtree
*tree
,
1006 GEOSQueryCallback callback
,
1009 GEOSSTRtree_iterate_r( handle
, tree
, callback
, userdata
);
1013 GEOSSTRtree_remove (geos::index::strtree::STRtree
*tree
,
1014 const geos::geom::Geometry
*g
,
1017 return GEOSSTRtree_remove_r( handle
, tree
, g
, item
);
1021 GEOSSTRtree_destroy (geos::index::strtree::STRtree
*tree
)
1023 GEOSSTRtree_destroy_r( handle
, tree
);
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
,
1037 return GEOSInterpolate_r(handle
, g
, d
);
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
,
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
);