GEOS: geos_c.h Source File

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List

# geos_c.h

    00001 /************************************************************************
    00002  *
    00003  * $Id: geos_c.h.in 2975 2010-04-17 21:55:53Z strk $
    00004  *
    00005  * C-Wrapper for GEOS library
    00006  *
    00007  * Copyright (C) 2005 Refractions Research Inc.
    00008  *
    00009  * This is free software; you can redistribute and/or modify it under
    00010  * the terms of the GNU Lesser General Public Licence as published
    00011  * by the Free Software Foundation.
    00012  * See the COPYING file for more information.
    00013  *
    00014  * Author: Sandro Santilli <strk@refractions.net>
    00015  *
    00016  ***********************************************************************
    00017  *
    00018  * GENERAL NOTES:
    00019  *
    00020  *      - Remember to call initGEOS() before any use of this library's
    00021  *        functions, and call finishGEOS() when done.
    00022  *
    00023  *      - Currently you have to explicitly GEOSGeom_destroy() all
    00024  *        GEOSGeom objects to avoid memory leaks, and to GEOSFree()
    00025  *        all returned char * (unless const).
    00026  *
    00027  ***********************************************************************/
    00028
    00029 #ifndef GEOS_C_H_INCLUDED
    00030 #define GEOS_C_H_INCLUDED
    00031
    00032 #ifndef __cplusplus
    00033 # include <stddef.h> /* for size_t definition */
    00034 #else
    00035 # include <cstddef>
    00036 using std::size_t;
    00037 #endif
    00038
    00039 #ifdef __cplusplus
    00040 extern "C" {
    00041 #endif
    00042
    00043 /************************************************************************
    00044  *
    00045  * Version
    00046  *
    00047  ***********************************************************************/
    00048
    00049 /*
    00050  * Following 'ifdef' hack fixes problem with generating geos_c.h on Windows,
    00051  * when building with Visual C++ compiler.
    00052  *
    00053  */
    00054 #if defined(_MSC_VER)
    00055 #include <geos/version.h>
    00056 #define GEOS_CAPI_VERSION_MAJOR 1
    00057 #define GEOS_CAPI_VERSION_MINOR 6
    00058 #define GEOS_CAPI_VERSION_PATCH 2
    00059 #define GEOS_CAPI_VERSION "3.2.2-CAPI-1.6.2"
    00060 #else
    00061 #ifndef GEOS_VERSION_MAJOR
    00062 #define GEOS_VERSION_MAJOR 3
    00063 #endif
    00064 #ifndef GEOS_VERSION_MINOR
    00065 #define GEOS_VERSION_MINOR 2
    00066 #endif
    00067 #ifndef GEOS_VERSION_PATCH
    00068 #define GEOS_VERSION_PATCH 2
    00069 #endif
    00070 #ifndef GEOS_VERSION
    00071 #define GEOS_VERSION "3.2.2"
    00072 #endif
    00073 #ifndef GEOS_JTS_PORT
    00074 #define GEOS_JTS_PORT "1.10.0"
    00075 #endif
    00076
    00077 #define GEOS_CAPI_VERSION_MAJOR 1
    00078 #define GEOS_CAPI_VERSION_MINOR 6
    00079 #define GEOS_CAPI_VERSION_PATCH 2
    00080 #define GEOS_CAPI_VERSION "3.2.2-CAPI-1.6.2"
    00081 #endif
    00082
    00083 #define GEOS_CAPI_FIRST_INTERFACE GEOS_CAPI_VERSION_MAJOR
    00084 #define GEOS_CAPI_LAST_INTERFACE (GEOS_CAPI_VERSION_MAJOR+GEOS_CAPI_VERSION_MINOR)
    00085
    00086 /************************************************************************
    00087  *
    00088  * (Abstract) type definitions
    00089  *
    00090  ************************************************************************/
    00091
    00092 typedef void (*GEOSMessageHandler)(const char *fmt, ...);
    00093
    00094 /* When we're included by geos_c.cpp, those are #defined to the original
    00095  * JTS definitions via preprocessor. We don't touch them to allow the
    00096  * compiler to cross-check the declarations. However, for all "normal"
    00097  * C-API users, we need to define them as "opaque" struct pointers, as
    00098  * those clients don't have access to the original C++ headers, by design.
    00099  */
    00100 #ifndef GEOSGeometry
    00101 typedef struct GEOSGeom_t GEOSGeometry;
    00102 typedef struct GEOSPrepGeom_t GEOSPreparedGeometry;
    00103 typedef struct GEOSCoordSeq_t GEOSCoordSequence;
    00104 typedef struct GEOSSTRtree_t GEOSSTRtree;
    00105 #endif
    00106
    00107 /* Those are compatibility definitions for source compatibility
    00108  * with GEOS 2.X clients relying on that type.
    00109  */
    00110 typedef GEOSGeometry* GEOSGeom;
    00111 typedef GEOSCoordSequence* GEOSCoordSeq;
    00112
    00113 /* Supported geometry types
    00114  * This was renamed from GEOSGeomTypeId in GEOS 2.2.X, which might
    00115  * break compatibility, this issue is still under investigation.
    00116  */
    00117
    00118 enum GEOSGeomTypes {
    00119     GEOS_POINT,
    00120     GEOS_LINESTRING,
    00121     GEOS_LINEARRING,
    00122     GEOS_POLYGON,
    00123     GEOS_MULTIPOINT,
    00124     GEOS_MULTILINESTRING,
    00125     GEOS_MULTIPOLYGON,
    00126     GEOS_GEOMETRYCOLLECTION
    00127 };
    00128
    00129 /* Byte oders exposed via the c api */
    00130 enum GEOSByteOrders {
    00131     GEOS_WKB_XDR = 0, /* Big Endian */
    00132     GEOS_WKB_NDR = 1 /* Little Endian */
    00133 };
    00134
    00135 typedef struct GEOSContextHandle_HS *GEOSContextHandle_t;
    00136
    00137 typedef void (*GEOSQueryCallback)(void *item, void *userdata);
    00138
    00139 /************************************************************************
    00140  *
    00141  * Initialization, cleanup, version
    00142  *
    00143  ***********************************************************************/
    00144
    00145 #include <geos/export.h>
    00146
    00147 extern void GEOS_DLL initGEOS(GEOSMessageHandler notice_function,
    00148         GEOSMessageHandler error_function);
    00149 extern void GEOS_DLL finishGEOS(void);
    00150
    00151 extern GEOSContextHandle_t GEOS_DLL initGEOS_r(
    00152                                     GEOSMessageHandler notice_function,
    00153                                     GEOSMessageHandler error_function);
    00154 extern void GEOS_DLL finishGEOS_r(GEOSContextHandle_t handle);
    00155
    00156 extern const char GEOS_DLL *GEOSversion();
    00157
    00158
    00159 /************************************************************************
    00160  *
    00161  * NOTE - These functions are DEPRECATED.  Please use the new Reader and
    00162  * writer APIS!
    00163  *
    00164  ***********************************************************************/
    00165
    00166 extern GEOSGeometry GEOS_DLL *GEOSGeomFromWKT(const char *wkt);
    00167 extern char GEOS_DLL *GEOSGeomToWKT(const GEOSGeometry* g);
    00168
    00169 extern GEOSGeometry GEOS_DLL *GEOSGeomFromWKT_r(GEOSContextHandle_t handle,
    00170                                                 const char *wkt);
    00171 extern char GEOS_DLL *GEOSGeomToWKT_r(GEOSContextHandle_t handle,
    00172                                       const GEOSGeometry* g);
    00173
    00174 /*
    00175  * Specify whether output WKB should be 2d or 3d.
    00176  * Return previously set number of dimensions.
    00177  */
    00178 extern int GEOS_DLL GEOS_getWKBOutputDims();
    00179 extern int GEOS_DLL GEOS_setWKBOutputDims(int newDims);
    00180
    00181 extern int GEOS_DLL GEOS_getWKBOutputDims_r(GEOSContextHandle_t handle);
    00182 extern int GEOS_DLL GEOS_setWKBOutputDims_r(GEOSContextHandle_t handle,
    00183                                             int newDims);
    00184
    00185 /*
    00186  * Specify whether the WKB byte order is big or little endian.
    00187  * The return value is the previous byte order.
    00188  */
    00189 extern int GEOS_DLL GEOS_getWKBByteOrder();
    00190 extern int GEOS_DLL GEOS_setWKBByteOrder(int byteOrder);
    00191
    00192 extern GEOSGeometry GEOS_DLL *GEOSGeomFromWKB_buf(const unsigned char *wkb, size_t size);
    00193 extern unsigned char GEOS_DLL *GEOSGeomToWKB_buf(const GEOSGeometry* g, size_t *size);
    00194
    00195 extern GEOSGeometry GEOS_DLL *GEOSGeomFromHEX_buf(const unsigned char *hex, size_t size);
    00196 extern unsigned char GEOS_DLL *GEOSGeomToHEX_buf(const GEOSGeometry* g, size_t *size);
    00197
    00198 extern int GEOS_DLL GEOS_getWKBByteOrder_r(GEOSContextHandle_t handle);
    00199 extern int GEOS_DLL GEOS_setWKBByteOrder_r(GEOSContextHandle_t handle,
    00200                                            int byteOrder);
    00201
    00202 extern GEOSGeometry GEOS_DLL *GEOSGeomFromWKB_buf_r(GEOSContextHandle_t handle,
    00203                                                     const unsigned char *wkb,
    00204                                                     size_t size);
    00205 extern unsigned char GEOS_DLL *GEOSGeomToWKB_buf_r(GEOSContextHandle_t handle,
    00206                                                    const GEOSGeometry* g,
    00207                                                    size_t *size);
    00208
    00209 extern GEOSGeometry GEOS_DLL *GEOSGeomFromHEX_buf_r(GEOSContextHandle_t handle,
    00210                                                     const unsigned char *hex,
    00211                                                     size_t size);
    00212 extern unsigned char GEOS_DLL *GEOSGeomToHEX_buf_r(GEOSContextHandle_t handle,
    00213                                                    const GEOSGeometry* g,
    00214                                                    size_t *size);
    00215
    00216 /************************************************************************
    00217  *
    00218  * Coordinate Sequence functions
    00219  *
    00220  ***********************************************************************/
    00221
    00222 /*
    00223  * Create a Coordinate sequence with ``size'' coordinates
    00224  * of ``dims'' dimensions.
    00225  * Return NULL on exception.
    00226  */
    00227 extern GEOSCoordSequence GEOS_DLL *GEOSCoordSeq_create(unsigned int size, unsigned int dims);
    00228
    00229 extern GEOSCoordSequence GEOS_DLL *GEOSCoordSeq_create_r(
    00230                                                 GEOSContextHandle_t handle,
    00231                                                 unsigned int size,
    00232                                                 unsigned int dims);
    00233
    00234 /*
    00235  * Clone a Coordinate Sequence.
    00236  * Return NULL on exception.
    00237  */
    00238 extern GEOSCoordSequence GEOS_DLL *GEOSCoordSeq_clone(const GEOSCoordSequence* s);
    00239
    00240 extern GEOSCoordSequence GEOS_DLL *GEOSCoordSeq_clone_r(
    00241                                                 GEOSContextHandle_t handle,
    00242                                                 const GEOSCoordSequence* s);
    00243
    00244 /*
    00245  * Destroy a Coordinate Sequence.
    00246  */
    00247 extern void GEOS_DLL GEOSCoordSeq_destroy(GEOSCoordSequence* s);
    00248
    00249 extern void GEOS_DLL GEOSCoordSeq_destroy_r(GEOSContextHandle_t handle,
    00250                                             GEOSCoordSequence* s);
    00251
    00252 /*
    00253  * Set ordinate values in a Coordinate Sequence.
    00254  * Return 0 on exception.
    00255  */
    00256 extern int GEOS_DLL GEOSCoordSeq_setX(GEOSCoordSequence* s,
    00257         unsigned int idx, double val);
    00258 extern int GEOS_DLL GEOSCoordSeq_setY(GEOSCoordSequence* s,
    00259         unsigned int idx, double val);
    00260 extern int GEOS_DLL GEOSCoordSeq_setZ(GEOSCoordSequence* s,
    00261         unsigned int idx, double val);
    00262 extern int GEOS_DLL GEOSCoordSeq_setOrdinate(GEOSCoordSequence* s,
    00263         unsigned int idx, unsigned int dim, double val);
    00264
    00265 extern int GEOS_DLL GEOSCoordSeq_setX_r(GEOSContextHandle_t handle,
    00266                                         GEOSCoordSequence* s, unsigned int idx,
    00267                                         double val);
    00268 extern int GEOS_DLL GEOSCoordSeq_setY_r(GEOSContextHandle_t handle,
    00269                                         GEOSCoordSequence* s, unsigned int idx,
    00270                                         double val);
    00271 extern int GEOS_DLL GEOSCoordSeq_setZ_r(GEOSContextHandle_t handle,
    00272                                         GEOSCoordSequence* s, unsigned int idx,
    00273                                         double val);
    00274 extern int GEOS_DLL GEOSCoordSeq_setOrdinate_r(GEOSContextHandle_t handle,
    00275                                                GEOSCoordSequence* s,
    00276                                                unsigned int idx,
    00277                                                unsigned int dim, double val);
    00278
    00279 /*
    00280  * Get ordinate values from a Coordinate Sequence.
    00281  * Return 0 on exception.
    00282  */
    00283 extern int GEOS_DLL GEOSCoordSeq_getX(const GEOSCoordSequence* s,
    00284         unsigned int idx, double *val);
    00285 extern int GEOS_DLL GEOSCoordSeq_getY(const GEOSCoordSequence* s,
    00286         unsigned int idx, double *val);
    00287 extern int GEOS_DLL GEOSCoordSeq_getZ(const GEOSCoordSequence* s,
    00288         unsigned int idx, double *val);
    00289 extern int GEOS_DLL GEOSCoordSeq_getOrdinate(const GEOSCoordSequence* s,
    00290         unsigned int idx, unsigned int dim, double *val);
    00291
    00292 extern int GEOS_DLL GEOSCoordSeq_getX_r(GEOSContextHandle_t handle,
    00293                                         const GEOSCoordSequence* s,
    00294                                         unsigned int idx, double *val);
    00295 extern int GEOS_DLL GEOSCoordSeq_getY_r(GEOSContextHandle_t handle,
    00296                                         const GEOSCoordSequence* s,
    00297                                         unsigned int idx, double *val);
    00298 extern int GEOS_DLL GEOSCoordSeq_getZ_r(GEOSContextHandle_t handle,
    00299                                         const GEOSCoordSequence* s,
    00300                                         unsigned int idx, double *val);
    00301 extern int GEOS_DLL GEOSCoordSeq_getOrdinate_r(GEOSContextHandle_t handle,
    00302                                                const GEOSCoordSequence* s,
    00303                                                unsigned int idx,
    00304                                                unsigned int dim, double *val);
    00305 /*
    00306  * Get size and dimensions info from a Coordinate Sequence.
    00307  * Return 0 on exception.
    00308  */
    00309 extern int GEOS_DLL GEOSCoordSeq_getSize(const GEOSCoordSequence* s,
    00310         unsigned int *size);
    00311 extern int GEOS_DLL GEOSCoordSeq_getDimensions(const GEOSCoordSequence* s,
    00312         unsigned int *dims);
    00313
    00314 extern int GEOS_DLL GEOSCoordSeq_getSize_r(GEOSContextHandle_t handle,
    00315                                            const GEOSCoordSequence* s,
    00316                                            unsigned int *size);
    00317 extern int GEOS_DLL GEOSCoordSeq_getDimensions_r(GEOSContextHandle_t handle,
    00318                                                  const GEOSCoordSequence* s,
    00319                                                  unsigned int *dims);
    00320
    00321 /************************************************************************
    00322  *
    00323  *  Linearref functions -- there are more, but these two are probably
    00324  *  sufficient for most purposes
    00325  *
    00326  ***********************************************************************/
    00327
    00328 /*
    00329  * GEOSGeometry ownership is retained by caller
    00330  */
    00331
    00332
    00333 extern double GEOS_DLL GEOSProject(const GEOSGeometry *g,
    00334                                    const GEOSGeometry* p);
    00335 extern double GEOS_DLL GEOSProject_r(GEOSContextHandle_t handle,
    00336                                      const GEOSGeometry *g,
    00337                                      const GEOSGeometry *p);
    00338
    00339 extern GEOSGeometry GEOS_DLL *GEOSInterpolate(const GEOSGeometry *g,
    00340                                               double d);
    00341 extern GEOSGeometry GEOS_DLL *GEOSInterpolate_r(GEOSContextHandle_t handle,
    00342                                                 const GEOSGeometry *g,
    00343                                                 double d);
    00344
    00345 extern double GEOS_DLL GEOSProjectNormalized(const GEOSGeometry *g,
    00346                                              const GEOSGeometry* p);
    00347 extern double GEOS_DLL GEOSProjectNormalized_r(GEOSContextHandle_t handle,
    00348                                                const GEOSGeometry *g,
    00349                                                const GEOSGeometry *p);
    00350
    00351 extern GEOSGeometry GEOS_DLL *GEOSInterpolateNormalized(const GEOSGeometry *g,
    00352                                                         double d);
    00353 extern GEOSGeometry GEOS_DLL *GEOSInterpolateNormalized_r(
    00354                                                 GEOSContextHandle_t handle,
    00355                                                 const GEOSGeometry *g,
    00356                                                 double d);
    00357
    00358 /************************************************************************
    00359  *
    00360  * Buffer related functions
    00361  *
    00362  ***********************************************************************/
    00363
    00364 enum GEOSBufCapStyles {
    00365         GEOSBUF_CAP_ROUND=1,
    00366         GEOSBUF_CAP_FLAT=2,
    00367         GEOSBUF_CAP_SQUARE=3
    00368 };
    00369
    00370 enum GEOSBufJoinStyles {
    00371         GEOSBUF_JOIN_ROUND=1,
    00372         GEOSBUF_JOIN_MITRE=2,
    00373         GEOSBUF_JOIN_BEVEL=3
    00374 };
    00375
    00376 /* These functions return NULL on exception. */
    00377 extern GEOSGeometry GEOS_DLL *GEOSBuffer(const GEOSGeometry* g1,
    00378         double width, int quadsegs);
    00379 extern GEOSGeometry GEOS_DLL *GEOSBuffer_r(GEOSContextHandle_t handle,
    00380                                            const GEOSGeometry* g1,
    00381                                            double width, int quadsegs);
    00382
    00383 /* These functions return NULL on exception. */
    00384 extern GEOSGeometry GEOS_DLL *GEOSBufferWithStyle(const GEOSGeometry* g1,
    00385         double width, int quadsegs, int endCapStyle, int joinStyle,
    00386         double mitreLimit);
    00387 extern GEOSGeometry GEOS_DLL *GEOSBufferWithStyle_r(GEOSContextHandle_t handle,
    00388         const GEOSGeometry* g1, double width, int quadsegs, int endCapStyle,
    00389         int joinStyle, double mitreLimit);
    00390
    00391 /* These functions return NULL on exception. Only LINESTRINGs are accepted. */
    00392 extern GEOSGeometry GEOS_DLL *GEOSSingleSidedBuffer(const GEOSGeometry* g1,
    00393         double width, int quadsegs, int joinStyle, double mitreLimit,
    00394         int leftSide);
    00395 extern GEOSGeometry GEOS_DLL *GEOSSingleSidedBuffer_r(
    00396         GEOSContextHandle_t handle,
    00397         const GEOSGeometry* g1, double width, int quadsegs,
    00398         int joinStyle, double mitreLimit, int leftSide);
    00399
    00400
    00401 /************************************************************************
    00402  *
    00403  * Geometry Constructors.
    00404  * GEOSCoordSequence* arguments will become ownership of the returned object.
    00405  * All functions return NULL on exception.
    00406  *
    00407  ***********************************************************************/
    00408
    00409 extern GEOSGeometry GEOS_DLL *GEOSGeom_createPoint(GEOSCoordSequence* s);
    00410 extern GEOSGeometry GEOS_DLL *GEOSGeom_createLinearRing(GEOSCoordSequence* s);
    00411 extern GEOSGeometry GEOS_DLL *GEOSGeom_createLineString(GEOSCoordSequence* s);
    00412
    00413 extern GEOSGeometry GEOS_DLL *GEOSGeom_createPoint_r(
    00414                                        GEOSContextHandle_t handle,
    00415                                        GEOSCoordSequence* s);
    00416 extern GEOSGeometry GEOS_DLL *GEOSGeom_createLinearRing_r(
    00417                                        GEOSContextHandle_t handle,
    00418                                        GEOSCoordSequence* s);
    00419 extern GEOSGeometry GEOS_DLL *GEOSGeom_createLineString_r(
    00420                                        GEOSContextHandle_t handle,
    00421                                        GEOSCoordSequence* s);
    00422
    00423 /*
    00424  * Second argument is an array of GEOSGeometry* objects.
    00425  * The caller remains owner of the array, but pointed-to
    00426  * objects become ownership of the returned GEOSGeometry.
    00427  */
    00428 extern GEOSGeometry GEOS_DLL *GEOSGeom_createPolygon(GEOSGeometry* shell,
    00429         GEOSGeometry** holes, unsigned int nholes);
    00430 extern GEOSGeometry GEOS_DLL *GEOSGeom_createCollection(int type,
    00431         GEOSGeometry* *geoms, unsigned int ngeoms);
    00432
    00433 extern GEOSGeometry GEOS_DLL *GEOSGeom_createPolygon_r(
    00434                                        GEOSContextHandle_t handle,
    00435                                        GEOSGeometry* shell,
    00436                                        GEOSGeometry** holes,
    00437                                        unsigned int nholes);
    00438 extern GEOSGeometry GEOS_DLL *GEOSGeom_createCollection_r(
    00439                                        GEOSContextHandle_t handle, int type,
    00440                                        GEOSGeometry* *geoms,
    00441                                        unsigned int ngeoms);
    00442
    00443 extern GEOSGeometry GEOS_DLL *GEOSGeom_clone(const GEOSGeometry* g);
    00444
    00445 extern GEOSGeometry GEOS_DLL *GEOSGeom_clone_r(GEOSContextHandle_t handle,
    00446                                                const GEOSGeometry* g);
    00447
    00448 /************************************************************************
    00449  *
    00450  * Memory management
    00451  *
    00452  ***********************************************************************/
    00453
    00454 extern void GEOS_DLL GEOSGeom_destroy(GEOSGeometry* g);
    00455
    00456 extern void GEOS_DLL GEOSGeom_destroy_r(GEOSContextHandle_t handle,
    00457                                         GEOSGeometry* g);
    00458
    00459 /************************************************************************
    00460  *
    00461  * Topology operations - return NULL on exception.
    00462  *
    00463  ***********************************************************************/
    00464
    00465 extern GEOSGeometry GEOS_DLL *GEOSEnvelope(const GEOSGeometry* g1);
    00466 extern GEOSGeometry GEOS_DLL *GEOSIntersection(const GEOSGeometry* g1, const GEOSGeometry* g2);
    00467 extern GEOSGeometry GEOS_DLL *GEOSConvexHull(const GEOSGeometry* g1);
    00468 extern GEOSGeometry GEOS_DLL *GEOSDifference(const GEOSGeometry* g1, const GEOSGeometry* g2);
    00469 extern GEOSGeometry GEOS_DLL *GEOSSymDifference(const GEOSGeometry* g1,
    00470         const GEOSGeometry* g2);
    00471 extern GEOSGeometry GEOS_DLL *GEOSBoundary(const GEOSGeometry* g1);
    00472 extern GEOSGeometry GEOS_DLL *GEOSUnion(const GEOSGeometry* g1, const GEOSGeometry* g2);
    00473 extern GEOSGeometry GEOS_DLL *GEOSUnionCascaded(const GEOSGeometry* g1);
    00474
    00475 extern GEOSGeometry GEOS_DLL *GEOSPointOnSurface(const GEOSGeometry* g1);
    00476 extern GEOSGeometry GEOS_DLL *GEOSGetCentroid(const GEOSGeometry* g);
    00477 extern char GEOS_DLL *GEOSRelate(const GEOSGeometry* g1, const GEOSGeometry* g2);
    00478
    00479 extern GEOSGeometry GEOS_DLL *GEOSEnvelope_r(GEOSContextHandle_t handle,
    00480                                              const GEOSGeometry* g1);
    00481 extern GEOSGeometry GEOS_DLL *GEOSIntersection_r(GEOSContextHandle_t handle,
    00482                                                  const GEOSGeometry* g1,
    00483                                                  const GEOSGeometry* g2);
    00484 extern GEOSGeometry GEOS_DLL *GEOSConvexHull_r(GEOSContextHandle_t handle,
    00485                                                const GEOSGeometry* g1);
    00486 extern GEOSGeometry GEOS_DLL *GEOSDifference_r(GEOSContextHandle_t handle,
    00487                                                const GEOSGeometry* g1,
    00488                                                const GEOSGeometry* g2);
    00489 extern GEOSGeometry GEOS_DLL *GEOSSymDifference_r(GEOSContextHandle_t handle,
    00490                                                   const GEOSGeometry* g1,
    00491                                                   const GEOSGeometry* g2);
    00492 extern GEOSGeometry GEOS_DLL *GEOSBoundary_r(GEOSContextHandle_t handle,
    00493                                              const GEOSGeometry* g1);
    00494 extern GEOSGeometry GEOS_DLL *GEOSUnion_r(GEOSContextHandle_t handle,
    00495                                           const GEOSGeometry* g1,
    00496                                           const GEOSGeometry* g2);
    00497 extern GEOSGeometry GEOS_DLL *GEOSUnionCascaded_r(GEOSContextHandle_t handle, const GEOSGeometry* g1);
    00498 extern GEOSGeometry GEOS_DLL *GEOSPointOnSurface_r(GEOSContextHandle_t handle,
    00499                                                    const GEOSGeometry* g1);
    00500 extern GEOSGeometry GEOS_DLL *GEOSGetCentroid_r(GEOSContextHandle_t handle,
    00501                                                 const GEOSGeometry* g);
    00502 extern char GEOS_DLL *GEOSRelate_r(GEOSContextHandle_t handle,
    00503                                    const GEOSGeometry* g1,
    00504                                    const GEOSGeometry* g2);
    00505
    00506 /*
    00507  * all arguments remain ownership of the caller
    00508  * (both Geometries and pointers)
    00509  */
    00510 extern GEOSGeometry GEOS_DLL *GEOSPolygonize(const GEOSGeometry * const geoms[], unsigned int ngeoms);
    00511 extern GEOSGeometry GEOS_DLL *GEOSPolygonizer_getCutEdges(const GEOSGeometry * const geoms[], unsigned int ngeoms);
    00512
    00513 extern GEOSGeometry GEOS_DLL *GEOSLineMerge(const GEOSGeometry* g);
    00514 extern GEOSGeometry GEOS_DLL *GEOSSimplify(const GEOSGeometry* g1, double tolerance);
    00515 extern GEOSGeometry GEOS_DLL *GEOSTopologyPreserveSimplify(const GEOSGeometry* g1,
    00516         double tolerance);
    00517
    00518 extern GEOSGeometry GEOS_DLL *GEOSPolygonize_r(GEOSContextHandle_t handle,
    00519                               const GEOSGeometry *const geoms[],
    00520                               unsigned int ngeoms);
    00521 extern GEOSGeometry GEOS_DLL *GEOSPolygonizer_getCutEdges_r(
    00522                               GEOSContextHandle_t handle,
    00523                               const GEOSGeometry * const geoms[],
    00524                               unsigned int ngeoms);
    00525
    00526 extern GEOSGeometry GEOS_DLL *GEOSLineMerge_r(GEOSContextHandle_t handle,
    00527                                               const GEOSGeometry* g);
    00528 extern GEOSGeometry GEOS_DLL *GEOSSimplify_r(GEOSContextHandle_t handle,
    00529                                              const GEOSGeometry* g1,
    00530                                              double tolerance);
    00531 extern GEOSGeometry GEOS_DLL *GEOSTopologyPreserveSimplify_r(
    00532                               GEOSContextHandle_t handle,
    00533                               const GEOSGeometry* g1, double tolerance);
    00534
    00535 /************************************************************************
    00536  *
    00537  *  Binary predicates - return 2 on exception, 1 on true, 0 on false
    00538  *
    00539  ***********************************************************************/
    00540
    00541 extern char GEOS_DLL GEOSRelatePattern(const GEOSGeometry* g1, const GEOSGeometry* g2,
    00542         const char *pat);
    00543 extern char GEOS_DLL GEOSDisjoint(const GEOSGeometry* g1, const GEOSGeometry* g2);
    00544 extern char GEOS_DLL GEOSTouches(const GEOSGeometry* g1, const GEOSGeometry* g2);
    00545 extern char GEOS_DLL GEOSIntersects(const GEOSGeometry* g1, const GEOSGeometry* g2);
    00546 extern char GEOS_DLL GEOSCrosses(const GEOSGeometry* g1, const GEOSGeometry* g2);
    00547 extern char GEOS_DLL GEOSWithin(const GEOSGeometry* g1, const GEOSGeometry* g2);
    00548 extern char GEOS_DLL GEOSContains(const GEOSGeometry* g1, const GEOSGeometry* g2);
    00549 extern char GEOS_DLL GEOSOverlaps(const GEOSGeometry* g1, const GEOSGeometry* g2);
    00550 extern char GEOS_DLL GEOSEquals(const GEOSGeometry* g1, const GEOSGeometry* g2);
    00551 extern char GEOS_DLL GEOSEqualsExact(const GEOSGeometry* g1, const GEOSGeometry* g2, double tolerance);
    00552
    00553 extern char GEOS_DLL GEOSRelatePattern_r(GEOSContextHandle_t handle,
    00554                                          const GEOSGeometry* g1,
    00555                                          const GEOSGeometry* g2,
    00556                                          const char *pat);
    00557 extern char GEOS_DLL GEOSDisjoint_r(GEOSContextHandle_t handle,
    00558                                     const GEOSGeometry* g1,
    00559                                     const GEOSGeometry* g2);
    00560 extern char GEOS_DLL GEOSTouches_r(GEOSContextHandle_t handle,
    00561                                    const GEOSGeometry* g1,
    00562                                    const GEOSGeometry* g2);
    00563 extern char GEOS_DLL GEOSIntersects_r(GEOSContextHandle_t handle,
    00564                                       const GEOSGeometry* g1,
    00565                                       const GEOSGeometry* g2);
    00566 extern char GEOS_DLL GEOSCrosses_r(GEOSContextHandle_t handle,
    00567                                    const GEOSGeometry* g1,
    00568                                    const GEOSGeometry* g2);
    00569 extern char GEOS_DLL GEOSWithin_r(GEOSContextHandle_t handle,
    00570                                   const GEOSGeometry* g1,
    00571                                   const GEOSGeometry* g2);
    00572 extern char GEOS_DLL GEOSContains_r(GEOSContextHandle_t handle,
    00573                                     const GEOSGeometry* g1,
    00574                                     const GEOSGeometry* g2);
    00575 extern char GEOS_DLL GEOSOverlaps_r(GEOSContextHandle_t handle,
    00576                                     const GEOSGeometry* g1,
    00577                                     const GEOSGeometry* g2);
    00578 extern char GEOS_DLL GEOSEquals_r(GEOSContextHandle_t handle,
    00579                                   const GEOSGeometry* g1,
    00580                                   const GEOSGeometry* g2);
    00581 extern char GEOS_DLL GEOSEqualsExact_r(GEOSContextHandle_t handle,
    00582                                        const GEOSGeometry* g1,
    00583                                        const GEOSGeometry* g2,
    00584                                        double tolerance);
    00585
    00586 /************************************************************************
    00587  *
    00588  *  Prepared Geometry Binary predicates - return 2 on exception, 1 on true, 0 on false
    00589  *
    00590  ***********************************************************************/
    00591
    00592 /*
    00593  * GEOSGeometry ownership is retained by caller
    00594  */
    00595 extern const GEOSPreparedGeometry GEOS_DLL *GEOSPrepare(const GEOSGeometry* g);
    00596
    00597 extern void GEOS_DLL GEOSPreparedGeom_destroy(const GEOSPreparedGeometry* g);
    00598
    00599 extern char GEOS_DLL GEOSPreparedContains(const GEOSPreparedGeometry* pg1, const GEOSGeometry* g2);
    00600 extern char GEOS_DLL GEOSPreparedContainsProperly(const GEOSPreparedGeometry* pg1, const GEOSGeometry* g2);
    00601 extern char GEOS_DLL GEOSPreparedCovers(const GEOSPreparedGeometry* pg1, const GEOSGeometry* g2);
    00602 extern char GEOS_DLL GEOSPreparedIntersects(const GEOSPreparedGeometry* pg1, const GEOSGeometry* g2);
    00603
    00604 /*
    00605  * GEOSGeometry ownership is retained by caller
    00606  */
    00607 extern const GEOSPreparedGeometry GEOS_DLL *GEOSPrepare_r(
    00608                                             GEOSContextHandle_t handle,
    00609                                             const GEOSGeometry* g);
    00610
    00611 extern void GEOS_DLL GEOSPreparedGeom_destroy_r(GEOSContextHandle_t handle,
    00612                                                 const GEOSPreparedGeometry* g);
    00613
    00614 extern char GEOS_DLL GEOSPreparedContains_r(GEOSContextHandle_t handle,
    00615                                             const GEOSPreparedGeometry* pg1,
    00616                                             const GEOSGeometry* g2);
    00617 extern char GEOS_DLL GEOSPreparedContainsProperly_r(GEOSContextHandle_t handle,
    00618                                          const GEOSPreparedGeometry* pg1,
    00619                                          const GEOSGeometry* g2);
    00620 extern char GEOS_DLL GEOSPreparedCovers_r(GEOSContextHandle_t handle,
    00621                                           const GEOSPreparedGeometry* pg1,
    00622                                           const GEOSGeometry* g2);
    00623 extern char GEOS_DLL GEOSPreparedIntersects_r(GEOSContextHandle_t handle,
    00624                                               const GEOSPreparedGeometry* pg1,
    00625                                               const GEOSGeometry* g2);
    00626
    00627 /************************************************************************
    00628  *
    00629  *  STRtree functions
    00630  *
    00631  ***********************************************************************/
    00632
    00633 /*
    00634  * GEOSGeometry ownership is retained by caller
    00635  */
    00636
    00637 extern GEOSSTRtree GEOS_DLL *GEOSSTRtree_create(size_t nodeCapacity);
    00638 extern void GEOS_DLL GEOSSTRtree_insert(GEOSSTRtree *tree,
    00639                                         const GEOSGeometry *g,
    00640                                         void *item);
    00641 extern void GEOS_DLL GEOSSTRtree_query(GEOSSTRtree *tree,
    00642                                        const GEOSGeometry *g,
    00643                                        GEOSQueryCallback callback,
    00644                                        void *userdata);
    00645 extern void GEOS_DLL GEOSSTRtree_iterate(GEOSSTRtree *tree,
    00646                                        GEOSQueryCallback callback,
    00647                                        void *userdata);
    00648 extern char GEOS_DLL GEOSSTRtree_remove(GEOSSTRtree *tree,
    00649                                         const GEOSGeometry *g,
    00650                                         void *item);
    00651 extern void GEOS_DLL GEOSSTRtree_destroy(GEOSSTRtree *tree);
    00652
    00653
    00654 extern GEOSSTRtree GEOS_DLL *GEOSSTRtree_create_r(
    00655                                     GEOSContextHandle_t handle,
    00656                                     size_t nodeCapacity);
    00657 extern void GEOS_DLL GEOSSTRtree_insert_r(GEOSContextHandle_t handle,
    00658                                           GEOSSTRtree *tree,
    00659                                           const GEOSGeometry *g,
    00660                                           void *item);
    00661 extern void GEOS_DLL GEOSSTRtree_query_r(GEOSContextHandle_t handle,
    00662                                          GEOSSTRtree *tree,
    00663                                          const GEOSGeometry *g,
    00664                                          GEOSQueryCallback callback,
    00665                                          void *userdata);
    00666 extern void GEOS_DLL GEOSSTRtree_iterate_r(GEOSContextHandle_t handle,
    00667                                        GEOSSTRtree *tree,
    00668                                        GEOSQueryCallback callback,
    00669                                        void *userdata);
    00670 extern char GEOS_DLL GEOSSTRtree_remove_r(GEOSContextHandle_t handle,
    00671                                           GEOSSTRtree *tree,
    00672                                           const GEOSGeometry *g,
    00673                                           void *item);
    00674 extern void GEOS_DLL GEOSSTRtree_destroy_r(GEOSContextHandle_t handle,
    00675                                            GEOSSTRtree *tree);
    00676
    00677
    00678 /************************************************************************
    00679  *
    00680  *  Unary predicate - return 2 on exception, 1 on true, 0 on false
    00681  *
    00682  ***********************************************************************/
    00683
    00684 extern char GEOS_DLL GEOSisEmpty(const GEOSGeometry* g1);
    00685 extern char GEOS_DLL GEOSisValid(const GEOSGeometry* g1);
    00686 extern char GEOS_DLL *GEOSisValidReason(const GEOSGeometry *g1);
    00687 extern char GEOS_DLL GEOSisSimple(const GEOSGeometry* g1);
    00688 extern char GEOS_DLL GEOSisRing(const GEOSGeometry* g1);
    00689 extern char GEOS_DLL GEOSHasZ(const GEOSGeometry* g1);
    00690
    00691 extern char GEOS_DLL GEOSisEmpty_r(GEOSContextHandle_t handle,
    00692                                    const GEOSGeometry* g1);
    00693 extern char GEOS_DLL GEOSisValid_r(GEOSContextHandle_t handle,
    00694                                    const GEOSGeometry* g1);
    00695 extern char GEOS_DLL *GEOSisValidReason_r(GEOSContextHandle_t handle,
    00696                                          const GEOSGeometry* g1);
    00697 extern char GEOS_DLL GEOSisSimple_r(GEOSContextHandle_t handle,
    00698                                     const GEOSGeometry* g1);
    00699 extern char GEOS_DLL GEOSisRing_r(GEOSContextHandle_t handle,
    00700                                   const GEOSGeometry* g1);
    00701 extern char GEOS_DLL GEOSHasZ_r(GEOSContextHandle_t handle,
    00702                                 const GEOSGeometry* g1);
    00703
    00704 /************************************************************************
    00705  *
    00706  *  Geometry info
    00707  *
    00708  ***********************************************************************/
    00709
    00710 /* Return NULL on exception, result must be freed by caller. */
    00711 extern char GEOS_DLL *GEOSGeomType(const GEOSGeometry* g1);
    00712
    00713 extern char GEOS_DLL *GEOSGeomType_r(GEOSContextHandle_t handle,
    00714                                      const GEOSGeometry* g1);
    00715
    00716 /* Return -1 on exception */
    00717 extern int GEOS_DLL GEOSGeomTypeId(const GEOSGeometry* g1);
    00718
    00719 extern int GEOS_DLL GEOSGeomTypeId_r(GEOSContextHandle_t handle,
    00720                                      const GEOSGeometry* g1);
    00721
    00722 /* Return 0 on exception */
    00723 extern int GEOS_DLL GEOSGetSRID(const GEOSGeometry* g);
    00724 extern int GEOS_DLL GEOSGetSRID_r(GEOSContextHandle_t handle,
    00725                                   const GEOSGeometry* g);
    00726
    00727 extern void GEOS_DLL GEOSSetSRID(GEOSGeometry* g, int SRID);
    00728 extern void GEOS_DLL GEOSSetSRID_r(GEOSContextHandle_t handle,
    00729                                    GEOSGeometry* g, int SRID);
    00730
    00731 /* May be called on all geometries in GEOS 3.x, returns -1 on error and 1
    00732  * for non-multi geometries. Older GEOS versions only accept
    00733  * GeometryCollections or Multi* geometries here, and are likely to crash
    00734  * when feeded simple geometries, so beware if you need compatibility with
    00735  * old GEOS versions.
    00736  */
    00737 extern int GEOS_DLL GEOSGetNumGeometries(const GEOSGeometry* g);
    00738
    00739 extern int GEOS_DLL GEOSGetNumGeometries_r(GEOSContextHandle_t handle,
    00740                                            const GEOSGeometry* g);
    00741
    00742 /*
    00743  * Return NULL on exception, Geometry must be a Collection.
    00744  * Returned object is a pointer to internal storage:
    00745  * it must NOT be destroyed directly.
    00746  */
    00747 extern const GEOSGeometry GEOS_DLL *GEOSGetGeometryN(const GEOSGeometry* g, int n);
    00748
    00749 extern const GEOSGeometry GEOS_DLL *GEOSGetGeometryN_r(
    00750                                     GEOSContextHandle_t handle,
    00751                                     const GEOSGeometry* g, int n);
    00752
    00753 /* Return -1 on exception */
    00754 extern int GEOS_DLL GEOSNormalize(GEOSGeometry* g1);
    00755
    00756 extern int GEOS_DLL GEOSNormalize_r(GEOSContextHandle_t handle,
    00757                                     GEOSGeometry* g1);
    00758
    00759 /* Return -1 on exception */
    00760 extern int GEOS_DLL GEOSGetNumInteriorRings(const GEOSGeometry* g1);
    00761
    00762 extern int GEOS_DLL GEOSGetNumInteriorRings_r(GEOSContextHandle_t handle,
    00763                                               const GEOSGeometry* g1);
    00764
    00765 /*
    00766  * Return NULL on exception, Geometry must be a Polygon.
    00767  * Returned object is a pointer to internal storage:
    00768  * it must NOT be destroyed directly.
    00769  */
    00770 extern const GEOSGeometry GEOS_DLL *GEOSGetInteriorRingN(const GEOSGeometry* g, int n);
    00771
    00772 extern const GEOSGeometry GEOS_DLL *GEOSGetInteriorRingN_r(
    00773                                     GEOSContextHandle_t handle,
    00774                                     const GEOSGeometry* g, int n);
    00775
    00776 /*
    00777  * Return NULL on exception, Geometry must be a Polygon.
    00778  * Returned object is a pointer to internal storage:
    00779  * it must NOT be destroyed directly.
    00780  */
    00781 extern const GEOSGeometry GEOS_DLL *GEOSGetExteriorRing(const GEOSGeometry* g);
    00782
    00783 extern const GEOSGeometry GEOS_DLL *GEOSGetExteriorRing_r(
    00784                                     GEOSContextHandle_t handle,
    00785                                     const GEOSGeometry* g);
    00786
    00787 /* Return -1 on exception */
    00788 extern int GEOS_DLL GEOSGetNumCoordinates(const GEOSGeometry* g1);
    00789
    00790 extern int GEOS_DLL GEOSGetNumCoordinates_r(GEOSContextHandle_t handle,
    00791                                             const GEOSGeometry* g1);
    00792
    00793 /*
    00794  * Return NULL on exception.
    00795  * Geometry must be a LineString, LinearRing or Point.
    00796  */
    00797 extern const GEOSCoordSequence GEOS_DLL *GEOSGeom_getCoordSeq(const GEOSGeometry* g);
    00798
    00799 extern const GEOSCoordSequence GEOS_DLL *GEOSGeom_getCoordSeq_r(
    00800                                          GEOSContextHandle_t handle,
    00801                                          const GEOSGeometry* g);
    00802
    00803 /*
    00804  * Return 0 on exception (or empty geometry)
    00805  * See also GEOSCoordSeq_getDimensions
    00806  */
    00807 extern int GEOS_DLL GEOSGeom_getDimensions(const GEOSGeometry* g);
    00808
    00809 extern int GEOS_DLL GEOSGeom_getDimensions_r(GEOSContextHandle_t handle,
    00810                                              const GEOSGeometry* g);
    00811
    00812 /************************************************************************
    00813  *
    00814  *  Misc functions
    00815  *
    00816  ***********************************************************************/
    00817
    00818 /* Return 0 on exception, 1 otherwise */
    00819 extern int GEOS_DLL GEOSArea(const GEOSGeometry* g1, double *area);
    00820 extern int GEOS_DLL GEOSLength(const GEOSGeometry* g1, double *length);
    00821 extern int GEOS_DLL GEOSDistance(const GEOSGeometry* g1, const GEOSGeometry* g2,
    00822         double *dist);
    00823 extern int GEOS_DLL GEOSHausdorffDistance(const GEOSGeometry *g1,
    00824         const GEOSGeometry *g2, double *dist);
    00825 extern int GEOS_DLL GEOSHausdorffDistanceDensify(const GEOSGeometry *g1,
    00826         const GEOSGeometry *g2, double densifyFrac, double *dist);
    00827 extern int GEOS_DLL GEOSArea_r(GEOSContextHandle_t handle,
    00828                                const GEOSGeometry* g1, double *area);
    00829 extern int GEOS_DLL GEOSLength_r(GEOSContextHandle_t handle,
    00830                                  const GEOSGeometry* g1, double *length);
    00831 extern int GEOS_DLL GEOSDistance_r(GEOSContextHandle_t handle,
    00832                                    const GEOSGeometry* g1,
    00833                                    const GEOSGeometry* g2, double *dist);
    00834 extern int GEOS_DLL GEOSHausdorffDistance_r(GEOSContextHandle_t handle,
    00835                                    const GEOSGeometry *g1,
    00836                                    const GEOSGeometry *g2,
    00837                                    double *dist);
    00838 extern int GEOS_DLL GEOSHausdorffDistanceDensify_r(GEOSContextHandle_t handle,
    00839                                    const GEOSGeometry *g1,
    00840                                    const GEOSGeometry *g2,
    00841                                    double densifyFrac, double *dist);
    00842
    00843
    00844 /************************************************************************
    00845  *
    00846  * Reader and Writer APIs
    00847  *
    00848  ***********************************************************************/
    00849
    00850 typedef struct GEOSWKTReader_t GEOSWKTReader;
    00851 typedef struct GEOSWKTWriter_t GEOSWKTWriter;
    00852 typedef struct GEOSWKBReader_t GEOSWKBReader;
    00853 typedef struct GEOSWKBWriter_t GEOSWKBWriter;
    00854
    00855
    00856 /* WKT Reader */
    00857 extern GEOSWKTReader GEOS_DLL *GEOSWKTReader_create();
    00858 extern void GEOS_DLL GEOSWKTReader_destroy(GEOSWKTReader* reader);
    00859 extern GEOSGeometry GEOS_DLL *GEOSWKTReader_read(GEOSWKTReader* reader, const char *wkt);
    00860
    00861 extern GEOSWKTReader GEOS_DLL *GEOSWKTReader_create_r(
    00862                                              GEOSContextHandle_t handle);
    00863 extern void GEOS_DLL GEOSWKTReader_destroy_r(GEOSContextHandle_t handle,
    00864                                              GEOSWKTReader* reader);
    00865 extern GEOSGeometry GEOS_DLL *GEOSWKTReader_read_r(GEOSContextHandle_t handle,
    00866                                                    GEOSWKTReader* reader,
    00867                                                    const char *wkt);
    00868
    00869 /* WKT Writer */
    00870 extern GEOSWKTWriter GEOS_DLL *GEOSWKTWriter_create();
    00871 extern void GEOS_DLL GEOSWKTWriter_destroy(GEOSWKTWriter* writer);
    00872 extern char GEOS_DLL *GEOSWKTWriter_write(GEOSWKTWriter* reader, const GEOSGeometry* g);
    00873
    00874 extern GEOSWKTWriter GEOS_DLL *GEOSWKTWriter_create_r(
    00875                                              GEOSContextHandle_t handle);
    00876 extern void GEOS_DLL GEOSWKTWriter_destroy_r(GEOSContextHandle_t handle,
    00877                                              GEOSWKTWriter* writer);
    00878 extern char GEOS_DLL *GEOSWKTWriter_write_r(GEOSContextHandle_t handle,
    00879                                             GEOSWKTWriter* reader,
    00880                                             const GEOSGeometry* g);
    00881
    00882 /* WKB Reader */
    00883 extern GEOSWKBReader GEOS_DLL *GEOSWKBReader_create();
    00884 extern void GEOS_DLL GEOSWKBReader_destroy(GEOSWKBReader* reader);
    00885 extern GEOSGeometry GEOS_DLL *GEOSWKBReader_read(GEOSWKBReader* reader, const unsigned char *wkb, size_t size);
    00886 extern GEOSGeometry GEOS_DLL *GEOSWKBReader_readHEX(GEOSWKBReader* reader, const unsigned char *hex, size_t size);
    00887
    00888 extern GEOSWKBReader GEOS_DLL *GEOSWKBReader_create_r(
    00889                                              GEOSContextHandle_t handle);
    00890 extern void GEOS_DLL GEOSWKBReader_destroy_r(GEOSContextHandle_t handle,
    00891                                              GEOSWKBReader* reader);
    00892 extern GEOSGeometry GEOS_DLL *GEOSWKBReader_read_r(GEOSContextHandle_t handle,
    00893                                                    GEOSWKBReader* reader,
    00894                                                    const unsigned char *wkb,
    00895                                                    size_t size);
    00896 extern GEOSGeometry GEOS_DLL *GEOSWKBReader_readHEX_r(
    00897                                             GEOSContextHandle_t handle,
    00898                                             GEOSWKBReader* reader,
    00899                                             const unsigned char *hex,
    00900                                             size_t size);
    00901
    00902 /* WKB Writer */
    00903 extern GEOSWKBWriter GEOS_DLL *GEOSWKBWriter_create();
    00904 extern void GEOS_DLL GEOSWKBWriter_destroy(GEOSWKBWriter* writer);
    00905
    00906 extern GEOSWKBWriter GEOS_DLL *GEOSWKBWriter_create_r(
    00907                                              GEOSContextHandle_t handle);
    00908 extern void GEOS_DLL GEOSWKBWriter_destroy_r(GEOSContextHandle_t handle,
    00909                                              GEOSWKBWriter* writer);
    00910
    00911 /* The caller owns the results for these two methods! */
    00912 extern unsigned char GEOS_DLL *GEOSWKBWriter_write(GEOSWKBWriter* writer, const GEOSGeometry* g, size_t *size);
    00913 extern unsigned char GEOS_DLL *GEOSWKBWriter_writeHEX(GEOSWKBWriter* writer, const GEOSGeometry* g, size_t *size);
    00914
    00915 extern unsigned char GEOS_DLL *GEOSWKBWriter_write_r(
    00916                                              GEOSContextHandle_t handle,
    00917                                              GEOSWKBWriter* writer,
    00918                                              const GEOSGeometry* g,
    00919                                              size_t *size);
    00920 extern unsigned char GEOS_DLL *GEOSWKBWriter_writeHEX_r(
    00921                                              GEOSContextHandle_t handle,
    00922                                              GEOSWKBWriter* writer,
    00923                                              const GEOSGeometry* g,
    00924                                              size_t *size);
    00925
    00926 /*
    00927  * Specify whether output WKB should be 2d or 3d.
    00928  * Return previously set number of dimensions.
    00929  */
    00930 extern int GEOS_DLL GEOSWKBWriter_getOutputDimension(const GEOSWKBWriter* writer);
    00931 extern void GEOS_DLL GEOSWKBWriter_setOutputDimension(GEOSWKBWriter* writer, int newDimension);
    00932
    00933 extern int GEOS_DLL GEOSWKBWriter_getOutputDimension_r(
    00934                                   GEOSContextHandle_t handle,
    00935                                   const GEOSWKBWriter* writer);
    00936 extern void GEOS_DLL GEOSWKBWriter_setOutputDimension_r(
    00937                                    GEOSContextHandle_t handle,
    00938                                    GEOSWKBWriter* writer, int newDimension);
    00939
    00940 /*
    00941  * Specify whether the WKB byte order is big or little endian.
    00942  * The return value is the previous byte order.
    00943  */
    00944 extern int GEOS_DLL GEOSWKBWriter_getByteOrder(const GEOSWKBWriter* writer);
    00945 extern void GEOS_DLL GEOSWKBWriter_setByteOrder(GEOSWKBWriter* writer, int byteOrder);
    00946
    00947 extern int GEOS_DLL GEOSWKBWriter_getByteOrder_r(GEOSContextHandle_t handle,
    00948                                                  const GEOSWKBWriter* writer);
    00949 extern void GEOS_DLL GEOSWKBWriter_setByteOrder_r(GEOSContextHandle_t handle,
    00950                                                   GEOSWKBWriter* writer,
    00951                                                   int byteOrder);
    00952
    00953 /*
    00954  * Specify whether SRID values should be output.
    00955  */
    00956 extern char GEOS_DLL GEOSWKBWriter_getIncludeSRID(const GEOSWKBWriter* writer);
    00957 extern void GEOS_DLL GEOSWKBWriter_setIncludeSRID(GEOSWKBWriter* writer, const char writeSRID);
    00958
    00959 extern char GEOS_DLL GEOSWKBWriter_getIncludeSRID_r(GEOSContextHandle_t handle,
    00960                                    const GEOSWKBWriter* writer);
    00961 extern void GEOS_DLL GEOSWKBWriter_setIncludeSRID_r(GEOSContextHandle_t handle,
    00962                                    GEOSWKBWriter* writer, const char writeSRID);
    00963
    00964
    00965 /*
    00966  * Free buffers returned by stuff like GEOSWKBWriter_write(),
    00967  * GEOSWKBWriter_writeHEX() and GEOSWKTWriter_write().
    00968  */
    00969 extern void GEOS_DLL GEOSFree( void *buffer );
    00970 extern void GEOS_DLL GEOSFree_r( GEOSContextHandle_t handle, void *buffer );
    00971
    00972 #ifdef __cplusplus
    00973 } // extern "C"
    00974 #endif
    00975
    00976 #endif /* #ifndef GEOS_C_H_INCLUDED */