[geos-commits] [SCM] GEOS branch main updated. a8361685706776ba18266ac873d914d99f60ffad
git at osgeo.org
git at osgeo.org
Thu Oct 1 07:35:47 PDT 2026
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GEOS".
The branch, main has been updated
via a8361685706776ba18266ac873d914d99f60ffad (commit)
from 395d979c05ddcfd729ffe80b2b18e7873dbf8b29 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit a8361685706776ba18266ac873d914d99f60ffad
Author: Sandro Santilli <strk at kbt.io>
Date: Thu Oct 1 16:35:26 2026 +0200
Properly set SRID in GEOSisSimpleWithParams
diff --git a/capi/geos_ts_c.cpp b/capi/geos_ts_c.cpp
index 547e4570f..e35bc743e 100644
--- a/capi/geos_ts_c.cpp
+++ b/capi/geos_ts_c.cpp
@@ -1671,6 +1671,7 @@ extern "C" {
} else {
*result = extHandle->geomFactory->createMultiPoint(locations).release();
}
+ (*result)->setSRID(inputGeom->getSRID());
}
return simple;
diff --git a/tests/unit/capi/GEOSisSimpleWithParamsTest.cpp b/tests/unit/capi/GEOSisSimpleWithParamsTest.cpp
index f469fea99..307d53573 100644
--- a/tests/unit/capi/GEOSisSimpleWithParamsTest.cpp
+++ b/tests/unit/capi/GEOSisSimpleWithParamsTest.cpp
@@ -30,6 +30,8 @@ template<>
template<>
void object::test<1>()
{
+ set_test_name("MultiLineString containing two rings that touch at their endpoints, default params");
+
input_ = GEOSGeomFromWKT("MULTILINESTRING( (0 0, -10 10,-10 -10, 0 0), (0 0,20 -10,20 10,0 0) )");
ensure(nullptr != input_);
ensure_equals((int)GEOSisSimpleWithParams(input_, _params, &result_), 0);
@@ -40,6 +42,8 @@ template<>
template<>
void object::test<2>()
{
+ set_test_name("MultiLineString containing two rings that touch at their endpoints, EndPoint boundary node rule");
+
input_ = GEOSGeomFromWKT("MULTILINESTRING( (0 0, -10 10,-10 -10, 0 0), (0 0,20 -10,20 10,0 0) )");
ensure(nullptr != input_);
GEOSisSimpleParams_setBoundaryNodeRule(_params, GEOSRELATE_BNR_ENDPOINT);
@@ -51,6 +55,8 @@ template<>
template<>
void object::test<3>()
{
+ set_test_name("MultiLineString containing two rings that touch at their endpoints, MultiValent boundary node rule");
+
input_ = GEOSGeomFromWKT("MULTILINESTRING( (0 0, -10 10,-10 -10, 0 0), (0 0,20 -10,20 10,0 0) )");
ensure(nullptr != input_);
GEOSisSimpleParams_setBoundaryNodeRule(_params, GEOSRELATE_BNR_MULTIVALENT_ENDPOINT);
@@ -62,6 +68,8 @@ template<>
template<>
void object::test<4>()
{
+ set_test_name("MultiLineString containing two rings that touch at their endpoints, MonoValent boundary node rule");
+
input_ = GEOSGeomFromWKT("MULTILINESTRING( (0 0, -10 10,-10 -10, 0 0), (0 0,20 -10,20 10,0 0) )");
ensure(nullptr != input_);
GEOSisSimpleParams_setBoundaryNodeRule(_params, GEOSRELATE_BNR_MONOVALENT_ENDPOINT);
@@ -73,6 +81,8 @@ template<>
template<>
void object::test<5>()
{
+ set_test_name("MultiLineString with a line intersected by two other lines, finding all locations");
+
input_ = GEOSGeomFromWKT("MULTILINESTRING( (0 0,10 0),(2 -5,2 5),(4 -5, 4 5) )");
ensure(nullptr != input_);
GEOSisSimpleParams_setFindAllLocations(_params, 1);
@@ -80,4 +90,32 @@ void object::test<5>()
ensure_equals(GEOSGetNumGeometries(result_), 2);
}
+template<>
+template<>
+void object::test<6>()
+{
+ set_test_name("Non-simple line with a SRID");
+
+ input_ = GEOSGeomFromWKT("LINESTRING(0 0,10 0,2 -5,2 5,6 -8)");
+ GEOSSetSRID(input_, 3857);
+ ensure(nullptr != input_);
+ ensure_equals((int)GEOSisSimpleWithParams(input_, _params, &result_), 0);
+ ensure_equals(GEOSGetNumGeometries(result_), 1);
+ ensure_equals(GEOSGetSRID(result_), 3857);
+}
+
+template<>
+template<>
+void object::test<7>()
+{
+ set_test_name("Non-simple line with a SRID and finding all locations");
+
+ input_ = GEOSGeomFromWKT("LINESTRING(0 0,10 0,2 -5,2 5,6 -8)");
+ GEOSSetSRID(input_, 4326);
+ ensure(nullptr != input_);
+ GEOSisSimpleParams_setFindAllLocations(_params, 1);
+ ensure_equals((int)GEOSisSimpleWithParams(input_, _params, &result_), 0);
+ ensure_equals(GEOSGetNumGeometries(result_), 3);
+ ensure_equals(GEOSGetSRID(result_), 4326);
+}
} // namespace tut
-----------------------------------------------------------------------
Summary of changes:
capi/geos_ts_c.cpp | 1 +
tests/unit/capi/GEOSisSimpleWithParamsTest.cpp | 38 ++++++++++++++++++++++++++
2 files changed, 39 insertions(+)
hooks/post-receive
--
GEOS
More information about the geos-commits
mailing list