@@ -117,6 +117,23 @@ typedef void (*GEOSMessageHandler)(GEOS_PRINTF_FORMAT const char *fmt, ...)
117117*/
118118typedef void (* GEOSMessageHandler_r )(const char * message , void * userdata );
119119
120+
121+ /**
122+ * A GEOS progression and cancel function.
123+ *
124+ * Such function takes a progression ratio, and an optional
125+ * message, and returns true if computation must continue, or false if it
126+ * must be interrupted.
127+ *
128+ * \param progressRatio Progression ratio (between 0 and 1)
129+ * \param message Information message (can be NULL)
130+ * \param userdata the user data pointer that was passed to GEOS together with
131+ * this callback.
132+ * \return TRUE if processing must continue, or FALSE to interrupt it.
133+ */
134+ typedef int (* GEOSProgressCallback_r )(double progressRatio , const char * message , void * userdata );
135+
136+
120137/*
121138* When we're included by geos_c.cpp, these types are #defined to the
122139* C++ definitions via preprocessor. We don't touch them to allow the
@@ -886,6 +903,16 @@ GEOSCoverageSimplifyVW_r(
886903 double tolerance ,
887904 int preserveBoundary );
888905
906+ /** \see GEOSCoverageSimplifyVWWithProgress */
907+ extern GEOSGeometry GEOS_DLL *
908+ GEOSCoverageSimplifyVWWithProgress_r (
909+ GEOSContextHandle_t extHandle ,
910+ const GEOSGeometry * input ,
911+ double tolerance ,
912+ int preserveBoundary ,
913+ GEOSProgressCallback_r progressFunc ,
914+ void * progressUserData );
915+
889916/** \see GEOSCoverageCleanParams_create */
890917extern GEOSCoverageCleanParams GEOS_DLL *
891918GEOSCoverageCleanParams_create_r (
@@ -4321,6 +4348,40 @@ extern GEOSGeometry GEOS_DLL * GEOSCoverageSimplifyVW(
43214348 double tolerance ,
43224349 int preserveBoundary );
43234350
4351+ /**
4352+ * Operates on a coverage (represented as a list of polygonal geometry
4353+ * with exactly matching edge geometry) to apply a Visvalingam–Whyatt
4354+ * simplification to the edges, reducing complexity in proportion with
4355+ * the provided tolerance, while retaining a valid coverage (no edges
4356+ * will cross or touch after the simplification).
4357+ * Geometries never disappear, but they may be simplified down to just
4358+ * a triangle. Also, some invalid geoms (such as Polygons which have too
4359+ * few non-repeated points) will be returned unchanged.
4360+ * If the input dataset is not a valid coverage due to overlaps,
4361+ * it will still be simplified, but invalid topology such as crossing
4362+ * edges will still be invalid.
4363+ *
4364+ * \param input The polygonal coverage to access,
4365+ * stored in a geometry collection. All members must be POLYGON
4366+ * or MULTIPOLYGON.
4367+ * \param tolerance A tolerance parameter in linear units.
4368+ * \param preserveBoundary Use 1 to preserve the outside edges
4369+ * of the coverage without simplification,
4370+ * 0 to allow them to be simplified.
4371+ * \param progressFunc Progress callback (or null)
4372+ * \param progressUserData User data passed to progress callback (can be null)
4373+ * \return A collection containing the simplified geometries, or null
4374+ * on error.
4375+ *
4376+ * \since 3.14
4377+ */
4378+ extern GEOSGeometry GEOS_DLL * GEOSCoverageSimplifyVWWithProgress (
4379+ const GEOSGeometry * input ,
4380+ double tolerance ,
4381+ int preserveBoundary ,
4382+ GEOSProgressCallback_r progressFunc ,
4383+ void * progressUserData );
4384+
43244385/**
43254386* Create a default GEOSCoverageCleanParams object for controlling
43264387* the way invalid polygon interactions are repaird by \ref GEOSCoverageCleanWithParams.
@@ -5328,7 +5389,7 @@ extern char GEOS_DLL GEOSIntersects(const GEOSGeometry* g1, const GEOSGeometry*
53285389extern char GEOS_DLL GEOSCrosses (const GEOSGeometry * g1 , const GEOSGeometry * g2 );
53295390
53305391/**
5331- * Tests if geometry g1 is completely within g2,
5392+ * Tests if geometry g1 is completely within g2,
53325393* but not wholly contained in the boundary of g2.
53335394* \param g1 Input geometry
53345395* \param g2 Input geometry
0 commit comments