[Git][debian-gis-team/geos][upstream] New upstream version 3.11.0~beta2
Bas Couwenberg (@sebastic)
gitlab at salsa.debian.org
Mon Jun 20 19:22:28 BST 2022
Bas Couwenberg pushed to branch upstream at Debian GIS Project / geos
Commits:
aa268a59 by Bas Couwenberg at 2022-06-20T19:38:05+02:00
New upstream version 3.11.0~beta2
- - - - -
17 changed files:
- CMakeLists.txt
- NEWS.md
- Version.txt
- capi/geos_c.cpp
- capi/geos_c.h.in
- capi/geos_ts_c.cpp
- include/geos/geom/CoordinateSequence.h
- include/geos/io/WKBReader.h
- include/geos/io/WKTReader.h
- release.md
- src/geom/CoordinateSequence.cpp
- src/io/WKBReader.cpp
- src/io/WKTReader.cpp
- src/operation/buffer/BufferCurveSetBuilder.cpp
- tests/unit/capi/GEOSGeomFromWKBTest.cpp
- tests/unit/capi/GEOSPolygonHullSimplifyTest.cpp
- tests/unit/io/WKTReaderTest.cpp
Changes:
=====================================
CMakeLists.txt
=====================================
@@ -200,19 +200,6 @@ target_compile_options(geos_cxx_flags INTERFACE
# works with multi-configuration generators.
target_compile_definitions(geos_cxx_flags INTERFACE $<$<NOT:$<CONFIG:Debug>>:NDEBUG>)
-#-----------------------------------------------------------------------------
-# Target geos_cxx_flags: overlayng code
-#-----------------------------------------------------------------------------
-#option(DISABLE_OVERLAYNG "Disable overlayng algorithms" OFF)
-#if(DISABLE_OVERLAYNG)
-# target_compile_definitions(geos_cxx_flags INTERFACE DISABLE_OVERLAYNG)
-# message(STATUS
-# "GEOS: OverlayNG DISABLED")
-#else()
-# message(STATUS
-# "GEOS: OverlayNG ENABLED")
-#endif()
-
#-----------------------------------------------------------------------------
# Target geos_developer_cxx_flags: developer mode compilation flags
#-----------------------------------------------------------------------------
@@ -275,15 +262,20 @@ target_link_libraries(geos PUBLIC geos_cxx_flags PRIVATE $<BUILD_INTERFACE:ryu>)
add_subdirectory(include)
add_subdirectory(src)
+# Some packagers would like the DLL files generated by MinGW to
+# include version numbers in the file name. Others would rather
+# they not (which is the cmake default).
+option(VERSION_MINGW_SHARED_LIBS "Add version suffix to MinGW shared libraries" OFF)
+
if(BUILD_SHARED_LIBS)
target_compile_definitions(geos
PRIVATE $<IF:$<CXX_COMPILER_ID:MSVC>,GEOS_DLL_EXPORT,DLL_EXPORT>)
set_target_properties(geos PROPERTIES VERSION ${GEOS_VERSION_NOPATCH})
set_target_properties(geos PROPERTIES SOVERSION ${GEOS_VERSION_NOPATCH})
- if(MINGW)
- set_target_properties(geos PROPERTIES SUFFIX "-${GEOS_VERSION_NOPATCH}${CMAKE_SHARED_LIBRARY_SUFFIX}")
- endif(MINGW)
+ if(MINGW AND VERSION_MINGW_SHARED_LIBS)
+ set_target_properties(geos PROPERTIES SUFFIX "-${GEOS_VERSION_NOPATCH}${CMAKE_SHARED_LIBRARY_SUFFIX}")
+ endif()
endif()
#-----------------------------------------------------------------------------
@@ -301,9 +293,9 @@ if(BUILD_SHARED_LIBS)
if(NOT WIN32 OR MINGW)
set_target_properties(geos_c PROPERTIES SOVERSION ${CAPI_VERSION_MAJOR})
endif()
- if(MINGW)
+ if(MINGW AND VERSION_MINGW_SHARED_LIBS)
set_target_properties(geos_c PROPERTIES SUFFIX "-${CAPI_VERSION_MAJOR}${CMAKE_SHARED_LIBRARY_SUFFIX}")
- endif(MINGW)
+ endif()
endif()
add_subdirectory(capi)
@@ -342,7 +334,9 @@ endif()
#-----------------------------------------------------------------------------
# Web Site
#-----------------------------------------------------------------------------
-if(PROJECT_IS_TOP_LEVEL)
+option(BUILD_WEBSITE "Build website" OFF)
+
+if(PROJECT_IS_TOP_LEVEL AND BUILD_WEBSITE)
add_subdirectory(web)
endif()
@@ -444,6 +438,7 @@ if(PROJECT_IS_TOP_LEVEL)
"/tools/geos-config\$"
"/tools/geos\\\\.pc\$"
"/bin/"
+ "/web/"
${CMAKE_CURRENT_BINARY_DIR}
)
=====================================
NEWS.md
=====================================
@@ -1,5 +1,5 @@
-## Changes in 3.11.0beta1
-2022-06-12
+## Changes in 3.11.0beta2
+2022-06-20
- New things:
- OffsetCurve (GH-530, Paul Ramsey/Martin Davis)
=====================================
Version.txt
=====================================
@@ -5,7 +5,7 @@ GEOS_VERSION_MINOR=11
GEOS_VERSION_PATCH=0
# OPTIONS: "", "dev", "rc1" etc.
-GEOS_PATCH_WORD=beta1
+GEOS_PATCH_WORD=beta2
# GEOS CAPI Versions
#
=====================================
capi/geos_c.cpp
=====================================
@@ -486,11 +486,12 @@ extern "C" {
}
Geometry*
- GEOSPolygonHullSimplifyByArea(const Geometry* g,
+ GEOSPolygonHullSimplifyMode(const Geometry* g,
unsigned int isOuter,
- double areaDeltaRatio)
+ unsigned int parameterMode,
+ double parameter)
{
- return GEOSPolygonHullSimplifyByArea_r(handle, g, isOuter, areaDeltaRatio);
+ return GEOSPolygonHullSimplifyMode_r(handle, g, isOuter, parameterMode, parameter);
}
Geometry*
@@ -1219,6 +1220,11 @@ extern "C" {
GEOSWKTReader_destroy_r(handle, reader);
}
+ void
+ GEOSWKTReader_setFixStructure(WKTReader* reader, char doFix)
+ {
+ GEOSWKTReader_setFixStructure_r(handle, reader, doFix);
+ }
Geometry*
GEOSWKTReader_read(WKTReader* reader, const char* wkt)
@@ -1288,6 +1294,11 @@ extern "C" {
GEOSWKBReader_destroy_r(handle, reader);
}
+ void
+ GEOSWKBReader_setFixStructure(WKBReader* reader, char doFix)
+ {
+ GEOSWKBReader_setFixStructure_r(handle, reader, doFix);
+ }
Geometry*
GEOSWKBReader_read(WKBReader* reader, const unsigned char* wkb, std::size_t size)
=====================================
capi/geos_c.h.in
=====================================
@@ -782,11 +782,12 @@ extern GEOSGeometry GEOS_DLL *GEOSPolygonHullSimplify_r(
double vertexNumFraction);
/** \see GEOSPolygonHullSimplifyByArea */
-extern GEOSGeometry GEOS_DLL *GEOSPolygonHullSimplifyByArea_r(
+extern GEOSGeometry GEOS_DLL *GEOSPolygonHullSimplifyMode_r(
GEOSContextHandle_t handle,
const GEOSGeometry* g,
unsigned int isOuter,
- double areaDeltaRatio);
+ unsigned int parameterMode,
+ double parameter);
/** \see GEOSConcaveHullOfPolygons */
extern GEOSGeometry GEOS_DLL *GEOSConcaveHullOfPolygons_r(
@@ -1743,6 +1744,12 @@ extern GEOSGeometry GEOS_DLL *GEOSWKTReader_read_r(
GEOSWKTReader* reader,
const char *wkt);
+/** \see GEOSWKTReader_setFixStructure */
+extern void GEOS_DLL GEOSWKTReader_setFixStructure_r(
+ GEOSContextHandle_t handle,
+ GEOSWKTReader *reader,
+ char doFix);
+
/* ========== WKT Writer ========== */
/** \see GEOSWKTReader_create */
@@ -1800,6 +1807,12 @@ extern void GEOS_DLL GEOSWKBReader_destroy_r(
GEOSContextHandle_t handle,
GEOSWKBReader* reader);
+/** \see GEOSWKBReader_setFixStructure */
+extern void GEOS_DLL GEOSWKBReader_setFixStructure_r(
+ GEOSContextHandle_t handle,
+ GEOSWKBReader *reader,
+ char doFix);
+
/** \see GEOSWKBReader_read */
extern GEOSGeometry GEOS_DLL *GEOSWKBReader_read_r(
GEOSContextHandle_t handle,
@@ -1814,6 +1827,7 @@ extern GEOSGeometry GEOS_DLL *GEOSWKBReader_readHEX_r(
const unsigned char *hex,
size_t size);
+
/* ========== WKB Writer ========== */
/** \see GEOSWKBWriter_create */
@@ -1891,7 +1905,7 @@ extern GEOSGeoJSONReader GEOS_DLL *GEOSGeoJSONReader_create_r(
extern void GEOS_DLL GEOSGeoJSONReader_destroy_r(GEOSContextHandle_t handle,
GEOSGeoJSONReader* reader);
-/** \see GEOSWKTReader_read */
+/** \see GEOSGeoJSONReader_read */
extern GEOSGeometry GEOS_DLL *GEOSGeoJSONReader_readGeometry_r(
GEOSContextHandle_t handle,
GEOSGeoJSONReader* reader,
@@ -3483,6 +3497,7 @@ extern GEOSGeometry GEOS_DLL *GEOSConcaveHull(
double ratio,
unsigned int allowHoles);
+
/**
* Computes a boundary-respecting hull of a polygonal geometry,
* with hull shape determined by a target parameter
@@ -3505,26 +3520,39 @@ extern GEOSGeometry GEOS_DLL *GEOSPolygonHullSimplify(
unsigned int isOuter,
double vertexNumFraction);
+
+/**
+* Controls the behavior of the GEOSPolygonHullSimplify parameter.
+*/
+enum GEOSPolygonHullParameterModes {
+ /** See geos::simplify::PolygonHullSimplifier::hull() */
+ GEOSHULL_PARAM_VERTEX_RATIO = 1,
+ /** See geos::simplify::PolygonHullSimplifier::hullByAreaDelta() */
+ GEOSHULL_PARAM_AREA_RATIO = 2
+};
+
/**
* Computes a topology-preserving simplified hull of a polygonal geometry,
-* with hull shape determined by the areaDeltaRatio,
-* specifying the ratio of maximum difference in area to original area.
-* Larger values compute less concave results.
-* A value of 0 produces the original geometry.
-* Either outer or inner hulls can be computed..
+* with hull shape determined by the parameter, controlled by a parameter
+* mode, which is one defined in GEOSPolygonHullParameterModes. In general,
+* larger values compute less concave results and value of 0
+* produces the original geometry.
+* Either outer or inner hulls can be computed.
*
* \param g the polygonal geometry to process
* \param isOuter indicates whether to compute an outer or inner hull (1 for outer hull, 0 for inner)
-* \param areaDeltaRatio the target ratio of area difference to original area
+* \param parameterMode the interpretation to apply to the parameter argument
+* \param parameter the target ratio of area difference to original area
* \return A newly allocated geometry of the concave hull. NULL on exception.
*
* Caller is responsible for freeing with GEOSGeom_destroy().
* \see geos::simplify::PolygonHullSimplifier
*/
-extern GEOSGeometry GEOS_DLL *GEOSPolygonHullSimplifyByArea(
+extern GEOSGeometry GEOS_DLL *GEOSPolygonHullSimplifyMode(
const GEOSGeometry* g,
unsigned int isOuter,
- double areaDeltaRatio);
+ unsigned int parameterMode,
+ double parameter);
/**
* Constructs a concave hull of a set of polygons, respecting
@@ -4614,6 +4642,16 @@ extern GEOSGeometry GEOS_DLL *GEOSWKTReader_read(
GEOSWKTReader* reader,
const char *wkt);
+/**
+* Set the reader to automatically repair structural errors
+* in the input (currently just unclosed rings) while reading.
+* \param reader A WKT reader object, caller retains ownership
+* \param doFix Set to 1 to repair, 0 for no repair (default).
+*/
+extern void GEOS_DLL GEOSWKTReader_setFixStructure(
+ GEOSWKTReader *reader,
+ char doFix);
+
/* ========= WKT Writer ========= */
/**
@@ -4712,6 +4750,16 @@ extern GEOSWKBReader GEOS_DLL *GEOSWKBReader_create(void);
extern void GEOS_DLL GEOSWKBReader_destroy(
GEOSWKBReader* reader);
+/**
+* Set the reader to automatically repair structural errors
+* in the input (currently just unclosed rings) while reading.
+* \param reader A WKB reader object, caller retains ownership
+* \param doFix Set to 1 to repair, 0 for no repair (default).
+*/
+extern void GEOS_DLL GEOSWKBReader_setFixStructure(
+ GEOSWKBReader *reader,
+ char doFix);
+
/**
* Read a geometry from a well-known binary buffer.
* \param reader A \ref GEOSWKBReader
=====================================
capi/geos_ts_c.cpp
=====================================
@@ -1251,15 +1251,26 @@ extern "C" {
}
Geometry*
- GEOSPolygonHullSimplifyByArea_r(GEOSContextHandle_t extHandle,
+ GEOSPolygonHullSimplifyMode_r(GEOSContextHandle_t extHandle,
const Geometry* g1,
unsigned int isOuter,
- double areaDeltaRatio)
+ unsigned int parameterMode,
+ double parameter)
{
return execute(extHandle, [&]() {
- std::unique_ptr<Geometry> g3 = PolygonHullSimplifier::hullByAreaDelta(g1, isOuter, areaDeltaRatio);
- g3->setSRID(g1->getSRID());
- return g3.release();
+ if (parameterMode == GEOSHULL_PARAM_AREA_RATIO) {
+ std::unique_ptr<Geometry> g3 = PolygonHullSimplifier::hullByAreaDelta(g1, isOuter, parameter);
+ g3->setSRID(g1->getSRID());
+ return g3.release();
+ }
+ else if (parameterMode == GEOSHULL_PARAM_VERTEX_RATIO) {
+ std::unique_ptr<Geometry> g3 = PolygonHullSimplifier::hull(g1, isOuter, parameter);
+ g3->setSRID(g1->getSRID());
+ return g3.release();
+ }
+ else {
+ throw IllegalArgumentException("GEOSPolygonHullSimplifyMode_r: Unknown parameterMode");
+ }
});
}
@@ -3029,6 +3040,14 @@ extern "C" {
});
}
+ void
+ GEOSWKTReader_setFixStructure_r(GEOSContextHandle_t extHandle, WKTReader* reader, char doFix)
+ {
+ return execute(extHandle, [&]() {
+ return reader->setFixStructure(doFix);
+ });
+ }
+
Geometry*
GEOSWKTReader_read_r(GEOSContextHandle_t extHandle, WKTReader* reader, const char* wkt)
{
@@ -3128,6 +3147,14 @@ extern "C" {
});
}
+ void
+ GEOSWKBReader_setFixStructure_r(GEOSContextHandle_t extHandle, WKBReader* reader, char doFix)
+ {
+ return execute(extHandle, [&]() {
+ return reader->setFixStructure(doFix);
+ });
+ }
+
struct membuf : public std::streambuf {
membuf(char* s, std::size_t n)
{
=====================================
include/geos/geom/CoordinateSequence.h
=====================================
@@ -184,14 +184,12 @@ public:
/** \brief
- * Tests whether an array of {@link Coordinate}s forms a ring,
- * by checking length and closure.
- * Self-intersection is not checked.
+ * Tests whether an a {@link CoordinateSequence} forms a ring,
+ * by checking length and closure. Self-intersection is not checked.
*
- * @param pts an array of Coordinates
* @return true if the coordinate form a ring.
*/
- static bool isRing(const CoordinateSequence *pts);
+ bool isRing() const;
/// Reverse Coordinate order in given CoordinateSequence
static void reverse(CoordinateSequence* cl);
=====================================
include/geos/io/WKBReader.h
=====================================
@@ -85,6 +85,8 @@ public:
/// Inizialize parser with default GeometryFactory.
WKBReader();
+ void setFixStructure(bool doFixStructure);
+
/**
* \brief Reads a Geometry from an istream.
*
@@ -132,6 +134,7 @@ private:
unsigned int inputDimension;
bool hasZ;
bool hasM;
+ bool fixStructure;
ByteOrderDataInStream dis;
=====================================
include/geos/io/WKTReader.h
=====================================
@@ -69,12 +69,14 @@ public:
explicit WKTReader(const geom::GeometryFactory& gf)
: geometryFactory(&gf)
, precisionModel(gf.getPrecisionModel())
+ , fixStructure(false)
{};
/** @deprecated in 3.4.0 */
explicit WKTReader(const geom::GeometryFactory* gf)
: geometryFactory(gf)
, precisionModel(gf->getPrecisionModel())
+ , fixStructure(false)
{};
/**
@@ -84,10 +86,16 @@ public:
WKTReader()
: geometryFactory(geom::GeometryFactory::getDefaultInstance())
, precisionModel(geometryFactory->getPrecisionModel())
+ , fixStructure(false)
{};
~WKTReader() {};
+ void
+ setFixStructure(bool doFixStructure) {
+ fixStructure = doFixStructure;
+ }
+
/// Parse a WKT string returning a Geometry
template<typename T>
std::unique_ptr<T> read(const std::string& wkt) const {
@@ -121,6 +129,7 @@ protected:
private:
const geom::GeometryFactory* geometryFactory;
const geom::PrecisionModel* precisionModel;
+ bool fixStructure;
void getPreciseCoordinate(io::StringTokenizer* tokenizer, geom::Coordinate&, std::size_t& dim) const;
=====================================
release.md
=====================================
@@ -1,4 +1,4 @@
-2022-06-12
+2022-06-20
- New things:
- OffsetCurve (GH-530, Paul Ramsey/Martin Davis)
=====================================
src/geom/CoordinateSequence.cpp
=====================================
@@ -157,15 +157,15 @@ CoordinateSequence::increasingDirection(const CoordinateSequence& pts)
return 1;
}
-/* public static */
+/* public */
bool
-CoordinateSequence::isRing(const CoordinateSequence *pts)
+CoordinateSequence::isRing() const
{
- if (pts->size() < 4) return false;
+ if (size() < 4)
+ return false;
- if (pts->getAt(0) != pts->getAt(pts->size()-1)) {
+ if (getAt(0) != getAt(size()-1))
return false;
- }
return true;
}
=====================================
src/io/WKBReader.cpp
=====================================
@@ -31,6 +31,7 @@
#include <geos/geom/MultiPolygon.h>
#include <geos/geom/CoordinateSequenceFactory.h>
#include <geos/geom/CoordinateSequence.h>
+#include <geos/geom/CoordinateArraySequence.h>
#include <geos/geom/PrecisionModel.h>
#include <iomanip>
@@ -51,12 +52,19 @@ WKBReader::WKBReader(geom::GeometryFactory const& f)
, inputDimension(2)
, hasZ(false)
, hasM(false)
+ , fixStructure(false)
{}
WKBReader::WKBReader()
: WKBReader(*(GeometryFactory::getDefaultInstance()))
{}
+void
+WKBReader::setFixStructure(bool doFixStructure)
+{
+ fixStructure = doFixStructure;
+}
+
std::ostream&
WKBReader::printHEX(std::istream& is, std::ostream& os)
{
@@ -366,6 +374,12 @@ WKBReader::readLinearRing()
std::size_t << "WKB npoints: " << size << std::endl;
#endif
auto pts = readCoordinateSequence(size);
+ // Replace unclosed ring with closed
+ if (fixStructure && !pts->isRing()) {
+ std::unique_ptr<CoordinateArraySequence> cas(new CoordinateArraySequence(*pts));
+ cas->closeRing();
+ pts.reset(cas.release());
+ }
return factory.createLinearRing(std::move(pts));
}
=====================================
src/io/WKTReader.cpp
=====================================
@@ -264,6 +264,11 @@ std::unique_ptr<LinearRing>
WKTReader::readLinearRingText(StringTokenizer* tokenizer) const
{
auto&& coords = getCoordinates(tokenizer);
+ if (fixStructure && !coords->isRing()) {
+ std::unique_ptr<CoordinateArraySequence> cas(new CoordinateArraySequence(*coords));
+ cas->closeRing();
+ coords.reset(cas.release());
+ }
return geometryFactory->createLinearRing(std::move(coords));
}
=====================================
src/operation/buffer/BufferCurveSetBuilder.cpp
=====================================
@@ -207,7 +207,7 @@ BufferCurveSetBuilder::addLineString(const LineString* line)
*
* Singled-sided buffers currently treat rings as if they are lines.
*/
- if (CoordinateSequence::isRing(coord.get()) && ! curveBuilder.getBufferParameters().isSingleSided()) {
+ if (coord->isRing() && ! curveBuilder.getBufferParameters().isSingleSided()) {
addRingBothSides(coord.get(), distance);
}
else {
=====================================
tests/unit/capi/GEOSGeomFromWKBTest.cpp
=====================================
@@ -27,7 +27,7 @@ struct test_capigeosgeomfromwkb_data : public capitest::utility {
}
void
- test_wkb(std::string const& wkbhex, std::string const& wkt)
+ test_wkb(const std::string& wkbhex, const std::string& wkt)
{
wkb_hex_decoder::binary_type wkb;
wkb_hex_decoder::decode(wkbhex, wkb);
@@ -35,13 +35,9 @@ struct test_capigeosgeomfromwkb_data : public capitest::utility {
geom1_ = GEOSGeomFromWKB_buf(&wkb[0], wkb.size());
ensure("GEOSGeomFromWKB_buf failed to create geometry", nullptr != geom1_);
- // TODO: Update test to compare with WKT-based geometry
- (void)wkt;
- // ATM, some XYZ and XYZM geometries fail
- //geom2_ = GEOSWKTReader_read(reader_, wkt.c_str());
- //ensure ( 0 != geom2_ );
- //char result = GEOSEquals(geom1_, geom2_);
- //ensure_equals(result, char(1));
+ geom2_ = GEOSWKTReader_read(reader_, wkt.c_str());
+ ensure ("GEOSWKTReader_read failed to create geometry", nullptr != geom2_ );
+ ensure_geometry_equals(geom1_, geom2_);
}
};
@@ -109,17 +105,30 @@ void object::test<5>
test_wkb(ewkb, wkt);
}
-// TODO: Does GEOSGeomFromWKB_buf accept EWKB or WKB only?
-// The cases below test EWKB input and they are failing.
-//template<>
-//template<>
-//void object::test<6>()
-//{
-// // SELECT st_geomfromewkt('MULTIPOINT((0 0 1 1), (3 2 2 1))') ;
-// std::string wkt("MULTIPOINT((0 0 1 1), (3 2 2 1))");
-// std::string ewkb("01040000C00200000001010000C000000000000000000000000000000000000000000000F03F000000000000F03F01010000C0000000000000084000000000000000400000000000000040000000000000F03F");
-// test_wkb(ewkb, wkt);
-//}
+// Check force close on unclosed rings
+template<>
+template<>
+void object::test<6>
+()
+{
+ geom1_ = GEOSWKTReader_read(reader_, "POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))");
+ ensure("geom1_ not null", geom1_ != nullptr);
+ GEOSWKTReader_setFixStructure(reader_, 1);
+ geom2_ = GEOSWKTReader_read(reader_, "POLYGON((0 0, 0 1, 1 1, 1 0))");
+ ensure("geom2_ not null", geom2_ != nullptr);
+ ensure_geometry_equals(geom1_, geom2_);
+}
+
+// Supply EWKB input
+template<>
+template<>
+void object::test<7>()
+{
+ test_wkb(
+ "01040000C00200000001010000C000000000000000000000000000000000000000000000F03F000000000000F03F01010000C0000000000000084000000000000000400000000000000040000000000000F03F",
+ "MULTIPOINT((0 0 1 1), (3 2 2 1))"
+ );
+}
} // namespace tut
=====================================
tests/unit/capi/GEOSPolygonHullSimplifyTest.cpp
=====================================
@@ -85,7 +85,7 @@ void object::test<5>()
{
input_ = GEOSGeomFromWKT("POLYGON ((0 0, 0 1, 1 1, 1 0, 0 0))");
ensure(nullptr != input_);
- geom1_ = GEOSPolygonHullSimplifyByArea(input_, 1, 0.7);
+ geom1_ = GEOSPolygonHullSimplifyMode(input_, 1, GEOSHULL_PARAM_AREA_RATIO, 0.7);
ensure(nullptr != geom1_);
// char *wkt = GEOSWKTWriter_write(wktw_, geom1_);
// printf("%s\n", wkt);
=====================================
tests/unit/io/WKTReaderTest.cpp
=====================================
@@ -10,6 +10,7 @@
#include <geos/geom/GeometryFactory.h>
#include <geos/geom/Geometry.h>
#include <geos/geom/LineString.h>
+#include <geos/geom/Polygon.h>
#include <geos/geom/Point.h>
#include <geos/geom/CoordinateSequence.h>
#include <geos/util/GEOSException.h>
@@ -303,5 +304,17 @@ void object::test<12>
ensure("MULTIPOINT( EMPTY, (1 1))", geom3->getGeometryN(0)->isEmpty());
}
+template<>
+template<>
+void object::test<13>
+()
+{
+ wktreader.setFixStructure(true);
+ auto geom = wktreader.read("POLYGON((0 0, 0 1, 1 1, 1 0))");
+ std::unique_ptr<geos::geom::Polygon> p(static_cast<geos::geom::Polygon*>(geom.release()));
+ ensure("setFixStructure", p->getExteriorRing()->getNumPoints() == 5);
+}
+
+
} // namespace tut
View it on GitLab: https://salsa.debian.org/debian-gis-team/geos/-/commit/aa268a592da6688f8914338ba2935b74eac04419
--
View it on GitLab: https://salsa.debian.org/debian-gis-team/geos/-/commit/aa268a592da6688f8914338ba2935b74eac04419
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20220620/37aee535/attachment-0001.htm>
More information about the Pkg-grass-devel
mailing list