From 9fe22540a97cdc94ef41d438b990b6a1dcfe169b Mon Sep 17 00:00:00 2001 From: Darafei Praliaskouski Date: Mon, 17 Dec 2018 06:37:39 +0000 Subject: [PATCH] Remove GEOS < 3.6 mentions from code and docs. Closes #4267 Closes https://github.com/postgis/postgis/pull/352 git-svn-id: http://svn.osgeo.org/postgis/trunk@17107 b70326c6-7e19-0410-871a-916f4a2858ee --- .travis.yml | 14 +++--- NEWS | 2 +- README.postgis | 3 +- doc/extras_topology.xml | 25 +++------- doc/installation.xml | 7 ++- doc/reference_accessor.xml | 21 +++----- doc/reference_constructor.xml | 11 ++-- doc/reference_editor.xml | 7 ++- doc/reference_measure.xml | 50 ++++++++----------- doc/reference_processing.xml | 69 +++++++++++--------------- liblwgeom/cunit/cu_triangulate.c | 57 ++++++++++----------- liblwgeom/liblwgeom.h.in | 4 -- postgis/lwgeom_geos.c | 24 --------- postgis/postgis.sql.in | 24 +-------- raster/test/regress/rt_polygon.sql | 12 +---- regress/core/interrupt_relate.sql | 2 - regress/core/regress_buffer_params.sql | 2 +- regress/core/regress_ogc_cover.sql | 1 - 18 files changed, 118 insertions(+), 217 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3b2e19992..4c402b6da 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,19 +6,19 @@ language: c env: - tag=latest mode=tests - - tag=pg11-geos37-gdal23-proj52 mode=debug - - tag=pg11-geos37-gdal23-proj52 mode=coverage - - tag=pg11-geos37-gdal23-proj52 mode=usan_gcc - - tag=pg11-geos37-gdal23-proj52 mode=usan_clang - - tag=pg11-geos37-gdal23-proj52 mode=tests + - tag=pg11-geos37-gdal24-proj52 mode=debug + - tag=pg11-geos37-gdal24-proj52 mode=coverage + - tag=pg11-geos37-gdal24-proj52 mode=usan_gcc + - tag=pg11-geos37-gdal24-proj52 mode=usan_clang + - tag=pg11-geos37-gdal24-proj52 mode=tests - tag=pg10-geos36-gdal23-proj49 mode=tests - tag=pg96-geos36-gdal22-proj49 mode=tests - - tag=pg95-geos35-gdal111-proj48 mode=tests + - tag=pg95-geos36-gdal21-proj48 mode=tests matrix: allow_failures: - env: tag=latest mode=tests - - env: tag=pg11-geos37-gdal23-proj52 mode=coverage + - env: tag=pg11-geos37-gdal24-proj52 mode=coverage script: - echo "/tmp/logbt-coredumps/core.%p.%E" | sudo tee /proc/sys/kernel/core_pattern diff --git a/NEWS b/NEWS index 341614122..ee369e1d0 100644 --- a/NEWS +++ b/NEWS @@ -1,7 +1,7 @@ PostGIS 3.0.0 2019/xx/xx * Breaking Changes * - - #4267, Bump minimum GEOS version to 3.6 (Regina Obe) + - #4267, Bump minimum GEOS version to 3.6 (Regina Obe, Darafei Praliaskouski) - #3888, Raster support now available as a separate extension (Sandro Santilli) - #3807, Extension library files no longer include the minor version. diff --git a/README.postgis b/README.postgis index 599580b5c..bd4e75caf 100644 --- a/README.postgis +++ b/README.postgis @@ -43,8 +43,7 @@ this to work. http://trac.osgeo.org/proj/ -* GEOS (Required, Version 3.5 or higher) - - 3.6+ is strongly recommended to expose most GEOS features +* GEOS (Required, Version 3.6 or higher) - 3.7+ is needed just for the ST_FrechetDistance function The GEOS library provides support for exact topological tests such as diff --git a/doc/extras_topology.xml b/doc/extras_topology.xml index a2b33eb9a..8e1558a18 100644 --- a/doc/extras_topology.xml +++ b/doc/extras_topology.xml @@ -1861,12 +1861,11 @@ SELECT topology.ST_RemoveIsoNode('ma_topo', 7 ) As result; If use tolerance > 0 and there is more than one edge near the point then an exception is thrown. - If tolerance = 0, the function use ST_Intersects otherwise uses ST_DWithin. - - Availability: 2.0.0 - requires GEOS >= 3.3.0. + Performed by the GEOS module. + Availability: 2.0.0 @@ -1919,13 +1918,11 @@ ERROR: Two or more edges found The function returns an integer (id-face) given a topology, a POINT and a tolerance. If tolerance = 0 then the point has to intersect the face. If the point doesn't intersect a face, returns 0 (zero). If use tolerance > 0 and there is more than one face near the point then an exception is thrown. - - If tolerance = 0, the function uses ST_Intersects otherwise uses ST_DWithin. - - Availability: 2.0.0 - requires GEOS >= 3.3.0. + Performed by the GEOS module. + Availability: 2.0.0 Examples @@ -1978,14 +1975,11 @@ ERROR: Two or more faces found The function return an integer (id-node) given a topology, a POINT and a tolerance. If tolerance = 0 mean exactly intersection otherwise retrieve the node from an interval. If there isn't a node at the point, it return 0 (zero). If use tolerance > 0 and near the point there are more than one node it throw an exception. - - - If tolerance = 0, the function use ST_Intersects otherwise will use ST_DWithin. - - Availability: 2.0.0 - requires GEOS >= 3.3.0. + Performed by the GEOS module. + Availability: 2.0.0 @@ -2526,13 +2520,10 @@ nodeid The newly added edge has "universe" face on both sides and links to itself. If the aline geometry crosses, overlaps, contains or is contained by an existing linestring edge, then an error is thrown and the edge is not added. The geometry of aline must have the same srid as defined for the topology otherwise an invalid spatial reference sys error will be thrown. - - - - Availability: 2.0.0 requires GEOS >= 3.3.0. + Performed by the GEOS module. + Availability: 2.0.0 - Examples SELECT topology.AddEdge('ma_topo', ST_GeomFromText('LINESTRING(227575.8 893917.2,227591.9 893900.4)', 26986) ) As edgeid; diff --git a/doc/installation.xml b/doc/installation.xml index 077c0e000..1f691c418 100644 --- a/doc/installation.xml +++ b/doc/installation.xml @@ -146,7 +146,7 @@ psql -d yourdatabase -f sfcgal_comments.sql - Proj4 reprojection library, version 4.9.0 or greater. Proj4 4.9 or above is needed to take advantage of improved geodetic. + Proj4 reprojection library, version 4.6.0 or greater. Proj4 4.9 or above is needed to take advantage of improved geodetic. The Proj4 library is used to provide coordinate reprojection support within PostGIS. Proj4 is available for download from @@ -158,11 +158,10 @@ psql -d yourdatabase -f sfcgal_comments.sql - GEOS geometry library, version 3.6 or greater, but GEOS 3.7+ is recommended to take full advantage of all the new functions and features. You should have at least GEOS 3.5, - without which you will be missing some major enhancements such as and . GEOS is available for download from + GEOS geometry library, version 3.6 or greater, but GEOS 3.7+ is recommended to take full advantage of all the new functions and features. GEOS is available for download from http://trac.osgeo.org/geos/ - and 3.5+ is backward-compatible with older versions so fairly safe to upgrade. + . diff --git a/doc/reference_accessor.xml b/doc/reference_accessor.xml index 9052ed03b..38f234a23 100644 --- a/doc/reference_accessor.xml +++ b/doc/reference_accessor.xml @@ -1458,11 +1458,9 @@ FROM (SELECT 'LINESTRING(0 0, 0 1, 1 0, 1 1, 0 0)'::geometry AS the_geom) AS foo SQL-MM defines the result of ST_IsValid(NULL) to be 0, while PostGIS returns NULL. - + Performed by the GEOS module. -The version accepting flags is available starting with 2.0.0 -and requires GEOS >= 3.3.0. Such version does not print a NOTICE -explaining the invalidity. +The version accepting flags is available starting with 2.0.0. Such version does not print a NOTICE explaining the invalidity. Allowed flags are documented in . @@ -1535,13 +1533,10 @@ NOTICE: Self-intersection at or near point 0 0 Allowed flags are documented in . - - Availability: 1.4 - requires GEOS >= 3.1.0. - Availability: 2.0 - requires GEOS >= 3.3.0 for the version taking flags. - + Performed by the GEOS module. + Availability: 1.4 + Availability: 2.0 version taking flags. - - Examples @@ -1630,12 +1625,10 @@ The 'flags' argument is a bitfield. It can have the following values: - - Availability: 2.0.0 - requires GEOS >= 3.3.0. - + Performed by the GEOS module. + Availability: 2.0.0 - Examples diff --git a/doc/reference_constructor.xml b/doc/reference_constructor.xml index e95ca01ea..40c3ffdf6 100644 --- a/doc/reference_constructor.xml +++ b/doc/reference_constructor.xml @@ -34,8 +34,8 @@ &sfs_compliant; s3.2.6.2 - - Availability: 1.1.0 - requires GEOS >= 2.1.0. + Performed by the GEOS module. + Availability: 1.1.0 @@ -86,13 +86,12 @@ &sfs_compliant; s3.2.6.2 - - Availability: 1.1.0 - requires GEOS >= 2.1.0. + Performed by the GEOS module. + Availability: 1.1.0 Examples - Forthcoming @@ -838,7 +837,7 @@ LINESTRING(1 2,4 5,7 8) OGC KML standards, cf: http://www.opengeospatial.org/standards/kml: - Availability: 1.5,libxml2 2.6+ + Availability: 1.5, requires libxml2 2.6+ &Z_support; ST_GeomFromKML function not support SQL/MM curves geometries. diff --git a/doc/reference_editor.xml b/doc/reference_editor.xml index ddb6cbc0c..41aca97b4 100644 --- a/doc/reference_editor.xml +++ b/doc/reference_editor.xml @@ -802,9 +802,8 @@ GEOMETRYCOLLECTION( the constituent line work of a MULTILINESTRING. Only use with MULTILINESTRING/LINESTRINGs. If you feed a polygon or geometry collection into this function, it will return an empty GEOMETRYCOLLECTION - + Performed by the GEOS module. Availability: 1.1.0 - requires GEOS >= 2.1.0 Will strip the M dimension. @@ -2073,8 +2072,8 @@ SELECT ST_AsEWKT(ST_SnapToGrid(ST_GeomFromEWKT('LINESTRING(-1.1115678 2.123 3 2. ). - - Availability: 2.0.0 requires GEOS >= 3.3.0. + Performed by the GEOS module. + Availability: 2.0.0 diff --git a/doc/reference_measure.xml b/doc/reference_measure.xml index 277dde902..4f13bf199 100644 --- a/doc/reference_measure.xml +++ b/doc/reference_measure.xml @@ -1200,7 +1200,7 @@ SELECT ST_AsText( Input geometries that do not meet the criteria to join any other cluster will be assigned a cluster number of NULL. - Availability: 2.3.0 - requires GEOS + Availability: 2.3.0 @@ -1302,7 +1302,7 @@ GROUP BY cid; ST_ClusterIntersecting is an aggregate function that returns an array of GeometryCollections, where each GeometryCollection represents an interconnected set of geometries. - Availability: 2.2.0 - requires GEOS + Availability: 2.2.0 @@ -1366,7 +1366,7 @@ GEOMETRYCOLLECTION(LINESTRING(6 6,7 7)) cluster number for each input geometry. The distance used for clustering is the distance between the centroids of the geometries. - Availability: 2.3.0 - requires GEOS + Availability: 2.3.0 @@ -1471,7 +1471,7 @@ FROM parcels; ST_ClusterWithin is an aggregate function that returns an array of GeometryCollections, where each GeometryCollection represents a set of geometries separated by no more than the specified distance. (Distances are Cartesian distances in the units of the SRID.) - Availability: 2.2.0 - requires GEOS + Availability: 2.2.0 @@ -1722,16 +1722,12 @@ ST_Point | t | t | f | f From JTS docs slightly reworded: The advantage to using this predicate over and is that it can be computed efficiently, with no need to compute topology at individual points. - An example use case for this predicate is computing the intersections - of a set of geometries with a large polygonal geometry. - Since intersection is a fairly slow operation, it can be more efficient - to use containsProperly to filter out test geometries which lie - wholly inside the area. In these cases the intersection is - known a priori to be exactly the original test geometry. + An example use case for this predicate is computing the intersections of a set of geometries with a large polygonal geometry. Since intersection is a fairly slow operation, it can be more efficient to use containsProperly to filter out test geometries which lie + wholly inside the area. In these cases the intersection is known a priori to be exactly the original test geometry. - - Availability: 1.4.0 - requires GEOS >= 3.1.0. + Performed by the GEOS module. + Availability: 1.4.0 Do not call with a GEOMETRYCOLLECTION as an argument @@ -1824,8 +1820,6 @@ ST_Point | t | t | f | f Returns 1 (TRUE) if no point in Geometry/Geography B is outside Geometry/Geography A - Performed by the GEOS module - Do not call with a GEOMETRYCOLLECTION as an argument @@ -1839,10 +1833,11 @@ ST_Point | t | t | f | f the geometries. To avoid index use, use the function _ST_Covers. - Enhanced: 2.4.0 Support for polygon in polygon and line in polygon added for geography type + Performed by the GEOS module + Enhanced: 2.4.0 Support for polygon in polygon and line in polygon added for geography type Enhanced: 2.3.0 Enhancement to PIP short-circuit for geometry extended to support MultiPoints with few points. Prior versions only supported point in polygon. Availability: 1.5 - support for geography was introduced. - Availability: 1.2.2 - requires GEOS >= 3.0 + Availability: 1.2.2 NOTE: this is the "allowable" version that returns a boolean, not an integer. @@ -1926,8 +1921,6 @@ SELECT ST_Covers(geog_poly, geog_pt) As poly_covers_pt, Returns 1 (TRUE) if no point in Geometry/Geography A is outside Geometry/Geography B - Performed by the GEOS module - Do not call with a GEOMETRYCOLLECTION as an argument @@ -1935,7 +1928,8 @@ SELECT ST_Covers(geog_poly, geog_pt) As poly_covers_pt, Do not use this function with invalid geometries. You will get unexpected results. - Availability: 1.2.2 - requires GEOS >= 3.0 + Performed by the GEOS module + Availability: 1.2.2 This function call will automatically include a bounding box comparison that will make use of any indexes that are available on the geometries. To avoid index use, use the function @@ -2586,7 +2580,7 @@ FROM (SELECT ST_MinimumClearance will return Infinity. - Availability: 2.3.0 - requires GEOS >= 3.6.0 + Availability: 2.3.0 @@ -2635,7 +2629,7 @@ SELECT ST_MinimumClearance('POLYGON ((0 0, 1 0, 1 1, 0.5 3.2e-4, 0 0))'); Returns the two-point LineString spanning a geometry's minimum clearance. If the geometry does not have a minimum clearance, LINESTRING EMPTY will be returned. - + Performed by the GEOS module. Availability: 2.3.0 - requires GEOS >= 3.6.0 @@ -2716,7 +2710,7 @@ The current implementation supports only vertices as the discrete locations. Thi One important part of this subset is Linestrings that are roughly parallel to each other, and roughly equal in length. This is a useful metric for line matching. - Availability: 1.5.0 - requires GEOS >= 3.2.0 + Availability: 1.5.0 @@ -2795,6 +2789,7 @@ The current implementation supports only vertices as the discrete locations. Thi The smaller densifyFrac we specify, the more acurate Fréchet distance we get. But, the computation time and the memory usage increase with the square of the number of subsegments. + Performed by the GEOS module. Availability: 2.4.0 - requires GEOS >= 3.7.0 @@ -4538,13 +4533,10 @@ SELECT ST_AsEWKT(ST_PointOnSurface(ST_GeomFromEWKT('LINESTRING(0 5 1, 0 0 1, 0 1 Do not call with a GeometryCollection as an argument not in OGC spec, but implied. see s2.1.13.2 - - Performed by the GEOS module - &sfs_compliant; s2.1.1.2 // s2.1.13.3 &sqlmm_compliant; SQL-MM 3: 5.1.25 - Enhanced: 2.0.0 - added support for specifying boundary node rule (requires GEOS >= 3.0). - + Performed by the GEOS module + Enhanced: 2.0.0 - added support for specifying boundary node rule. @@ -4611,8 +4603,8 @@ t Takes intersectionMatrix and intersectionMatrixPattern and Returns true if the intersectionMatrix satisfies the intersectionMatrixPattern. For more information refer to . - - Availability: 2.0.0 - requires GEOS >= 3.3.0. + Performed by the GEOS module + Availability: 2.0.0 diff --git a/doc/reference_processing.xml b/doc/reference_processing.xml index 96dba16dd..33dc33516 100644 --- a/doc/reference_processing.xml +++ b/doc/reference_processing.xml @@ -72,7 +72,7 @@ from the input geometry. For geography this may not behave as expected if object is sufficiently large that it falls between two UTM zones or crosses the dateline Enhanced: 2.5.0 - ST_Buffer geometry support was enhanced to allow for side buffering specification side=both|left|right. Availability: 1.5 - ST_Buffer was enhanced to support different endcaps and join types. These are useful for example to convert road linestrings - into polygon roads with flat or square edges instead of rounded edges. Thin wrapper for geography was added. - requires GEOS >= 3.2 to take advantage of advanced geometry functionality. + into polygon roads with flat or square edges instead of rounded edges. Thin wrapper for geography was added. The optional third parameter (currently only applies to geometry) can either specify number of segments used to approximate a quarter circle (integer case, defaults to 8) or a list of blank-separated key=value pairs (string case) to tweak operations as follows: @@ -81,10 +81,10 @@ The optional third parameter (currently only applies to geometry) can either spe 'quad_segs=#' : number of segments used to approximate a quarter circle (defaults to 8). -'endcap=round|flat|square' : endcap style (defaults to "round", needs GEOS-3.2 or higher for a different value). 'butt' is also accepted as a synonym for 'flat'. +'endcap=round|flat|square' : endcap style (defaults to "round"). 'butt' is also accepted as a synonym for 'flat'. -'join=round|mitre|bevel' : join style (defaults to "round", needs GEOS-3.2 or higher for a different value). 'miter' is also accepted as a synonym for 'mitre'. +'join=round|mitre|bevel' : join style (defaults to "round"). 'miter' is also accepted as a synonym for 'mitre'. 'mitre_limit=#.#' : mitre ratio limit (only affects mitered join style). 'miter_limit' is also accepted as a synonym for 'mitre_limit'. @@ -397,7 +397,7 @@ POLYGON((236057.59057465 900908.759918696,236028.301252769 900838.049240578,235 Input linework must be correctly noded for this function to work properly - Availability: 1.1.0 - requires GEOS >= 2.1.0. + Availability: 1.1.0 @@ -496,9 +496,8 @@ FROM (SELECT ST_Buffer( Performed by the GEOS module. - Requires GEOS 3.5.0+ - Availability: 2.2.0 - requires GEOS >= 3.5.0. + Availability: 2.2.0 @@ -1099,8 +1098,8 @@ Output is a COLLECTION of polygons (for flags=0) or a MULTILINESTRING (for flags=1) or TIN (for flags=2). The tolerance, if any, is used to snap input vertices togheter. - - Availability: 2.1.0 - requires GEOS >= 3.4.0. + Performed by the GEOS module. + Availability: 2.1.0 &Z_support; &T_support; @@ -2062,10 +2061,11 @@ FROM (SELECT ST_Translate(ST_Force3D(ST_Boundary(ST_Buffer(ST_Point(1,3), 2,2))) Single polygons may become multi-geometries in case of self-intersections. + Performed by the GEOS module. - Availability: 2.0.0, requires GEOS-3.3.0 - Enhanced: 2.0.1, speed improvements requires GEOS-3.3.4 - Enhanced: 2.1.0 added support for GEOMETRYCOLLECTION and MULTIPOINT. + Availability: 2.0.0 + Enhanced: 2.0.1, speed improvements + Enhanced: 2.1.0, added support for GEOMETRYCOLLECTION and MULTIPOINT. &Z_support; @@ -2156,8 +2156,8 @@ FROM (SELECT ST_Translate(ST_Force3D(ST_Boundary(ST_Buffer(ST_Point(1,3), 2,2))) ST_MinimumBoundingCircle(ST_Collect(somepointfield)). The ratio of the area of a polygon divided by the area of its Minimum Bounding Circle is often referred to as the Roeck test. - - Availability: 1.4.0 - requires GEOS + Performed by the GEOS module. + Availability: 1.4.0 @@ -2347,8 +2347,9 @@ POLYGON((19.9999999999997 79.9999999999999,33.0769230769229 60.3846153846152,138 Input linework must be correctly noded for this function to work properly + Performed by the GEOS module. - Availability: 1.0.0RC1 - requires GEOS >= 2.1.0. + Availability: 1.0.0RC1 @@ -2418,17 +2419,13 @@ while preserving all of the input ones. &Z_support; + Performed by the GEOS module. + Availability: 2.0.0 - Availability: 2.0.0 - requires GEOS >= 3.3.0. - - -Due to a bug in GEOS up to 3.3.1 this function fails to node self-intersecting -lines. This is fixed with GEOS 3.3.2 or higher. - - + Changed: 2.4.0 this function uses GEOSNode internally instead of GEOSUnaryUnion. This may cause the resulting linestrings to have a different order and direction compared to Postgis < 2.4. - + Examples @@ -2489,14 +2486,9 @@ and retain the same direction. For a negative distance it'll be at the right side and in the opposite direction. - -Availability: 2.0 - requires GEOS >= 3.2, improved with GEOS >= 3.3 - - - -Enhanced: 2.5 - added support for GEOMETRYCOLLECTION and MULTILINESTRING - - + Performed by the GEOS module. + Availability: 2.0 + Enhanced: 2.5 - added support for GEOMETRYCOLLECTION and MULTILINESTRING The optional third parameter allows specifying a list of blank-separated @@ -2756,8 +2748,8 @@ MULTILINESTRING((164 1,11.7867965644036 1,1 11.7867965644036,1 195), Those going in the same direction are in the first element of the collection, those going in the opposite direction are in the second element. The paths themselves are given in the direction of the first geometry. - - Availability: 2.0.0 requires GEOS >= 3.3.0. + Performed by the GEOS module. + Availability: 2.0.0 Examples: Finding shared paths @@ -3056,7 +3048,6 @@ select ST_WrapX(the_geom, -30, 360); this function. Performed by the GEOS module. - Requires GEOS 3.0.0+ Availability: 1.3.3 @@ -3603,8 +3594,8 @@ MULTILINESTRING((1 3 2.75,1 4 2),(1 1 3,1 2 2.25)) Uses the same envelope clipping as ST_ClipByBox2D. max_vertices must be 5 or more, as 5 points are needed to represent a closed box. - - Availability: 2.2.0 requires GEOS >= 3.5.0. + Performed by the GEOS module. + Availability: 2.2.0 Enhanced: 2.5.0 reuses existing points on polygon split, vertex count is lowered from 8 to 5. @@ -3991,8 +3982,8 @@ MULTILINESTRING((3 4,4 5),(1 2,3 4)) - - Availability: 2.3.0 - requires GEOS >= 3.5.0. + Performed by the GEOS module. + Availability: 2.3.0 @@ -4085,8 +4076,8 @@ MULTILINESTRING((135.555555555556 270,36.8181818181818 92.2727272727273),(36.818 - - Availability: 2.3.0 - requires GEOS >= 3.5.0. + Performed by the GEOS module. + Availability: 2.3.0 diff --git a/liblwgeom/cunit/cu_triangulate.c b/liblwgeom/cunit/cu_triangulate.c index 6770202dd..b46ac9004 100644 --- a/liblwgeom/cunit/cu_triangulate.c +++ b/liblwgeom/cunit/cu_triangulate.c @@ -16,7 +16,8 @@ #include "liblwgeom_internal.h" -static void test_lwgeom_delaunay_triangulation(void) +static void +test_lwgeom_delaunay_triangulation(void) { LWGEOM *in, *tmp, *out; char *wkt, *exp_wkt; @@ -31,60 +32,57 @@ static void test_lwgeom_delaunay_triangulation(void) out = lwgeom_normalize(tmp); lwgeom_free(tmp); - wkt = lwgeom_to_ewkt(out); + wkt = lwgeom_to_ewkt(out); lwgeom_free(out); exp_wkt = "GEOMETRYCOLLECTION(POLYGON((5 5,20 0,10 0,5 5)))"; - if ( strcmp(wkt, exp_wkt) ) - { - fprintf(stderr, "\nExp: %s\nObt: %s\n", exp_wkt, wkt); - } + if (strcmp(wkt, exp_wkt)) + fprintf(stderr, "\nExp: %s\nObt: %s\n", exp_wkt, wkt); + CU_ASSERT_STRING_EQUAL(wkt, exp_wkt); lwfree(wkt); } -static void test_lwgeom_voronoi_diagram(void) +static void +test_lwgeom_voronoi_diagram(void) { -#if POSTGIS_GEOS_VERSION >= 35 - LWGEOM* in = lwgeom_from_wkt("MULTIPOINT(4 4, 5 5, 6 6)", LW_PARSER_CHECK_NONE); + LWGEOM *in = lwgeom_from_wkt("MULTIPOINT(4 4, 5 5, 6 6)", LW_PARSER_CHECK_NONE); - LWGEOM* out_boundaries = lwgeom_voronoi_diagram(in, NULL, 0, 0); - LWGEOM* out_lines = lwgeom_voronoi_diagram(in, NULL, 0, 1); + LWGEOM *out_boundaries = lwgeom_voronoi_diagram(in, NULL, 0, 0); + LWGEOM *out_lines = lwgeom_voronoi_diagram(in, NULL, 0, 1); /* For boundaries we get a generic LWCOLLECTION */ CU_ASSERT_EQUAL(COLLECTIONTYPE, lwgeom_get_type(out_boundaries)); /* For lines we get a MULTILINETYPE */ - CU_ASSERT_EQUAL(MULTILINETYPE, lwgeom_get_type(out_lines)); + CU_ASSERT_EQUAL(MULTILINETYPE, lwgeom_get_type(out_lines)); lwgeom_free(in); lwgeom_free(out_boundaries); lwgeom_free(out_lines); -#endif /* POSTGIS_GEOS_VERSION >= 35 */ } -static void test_lwgeom_voronoi_diagram_custom_envelope(void) +static void +test_lwgeom_voronoi_diagram_custom_envelope(void) { -#if POSTGIS_GEOS_VERSION >= 35 - LWGEOM* in = lwgeom_from_wkt("MULTIPOINT(4 4, 5 5, 6 6)", LW_PARSER_CHECK_NONE); - LWGEOM* for_extent = lwgeom_from_wkt("LINESTRING (-10 -10, 10 10)", LW_PARSER_CHECK_NONE); - const GBOX* clipping_extent = lwgeom_get_bbox(for_extent); + LWGEOM *in = lwgeom_from_wkt("MULTIPOINT(4 4, 5 5, 6 6)", LW_PARSER_CHECK_NONE); + LWGEOM *for_extent = lwgeom_from_wkt("LINESTRING (-10 -10, 10 10)", LW_PARSER_CHECK_NONE); + const GBOX *clipping_extent = lwgeom_get_bbox(for_extent); - LWGEOM* out = lwgeom_voronoi_diagram(in, clipping_extent, 0, 0); - const GBOX* output_extent = lwgeom_get_bbox(out); + LWGEOM *out = lwgeom_voronoi_diagram(in, clipping_extent, 0, 0); + const GBOX *output_extent = lwgeom_get_bbox(out); CU_ASSERT_TRUE(gbox_same(clipping_extent, output_extent)); lwgeom_free(in); lwgeom_free(for_extent); lwgeom_free(out); -#endif /* POSTGIS_GEOS_VERSION >= 35 */ } -#if POSTGIS_GEOS_VERSION >= 35 -static void assert_empty_diagram(char* wkt, double tolerance) +static void +assert_empty_diagram(char *wkt, double tolerance) { - LWGEOM* in = lwgeom_from_wkt(wkt, LW_PARSER_CHECK_NONE); - LWGEOM* out = lwgeom_voronoi_diagram(in, NULL, tolerance, 0); + LWGEOM *in = lwgeom_from_wkt(wkt, LW_PARSER_CHECK_NONE); + LWGEOM *out = lwgeom_voronoi_diagram(in, NULL, tolerance, 0); CU_ASSERT_TRUE(lwgeom_is_collection(out)); CU_ASSERT_EQUAL(COLLECTIONTYPE, lwgeom_get_type(out)); @@ -92,25 +90,24 @@ static void assert_empty_diagram(char* wkt, double tolerance) lwgeom_free(in); lwgeom_free(out); } -#endif /* POSTGIS_GEOS_VERSION >= 35 */ -static void test_lwgeom_voronoi_diagram_expected_empty(void) +static void +test_lwgeom_voronoi_diagram_expected_empty(void) { -#if POSTGIS_GEOS_VERSION >= 35 assert_empty_diagram("POLYGON EMPTY", 0); assert_empty_diagram("POINT (1 2)", 0); /* This one produces an empty diagram because our two unqiue points * collapse onto one after considering the tolerance. */ assert_empty_diagram("MULTIPOINT (0 0, 0 0.00001)", 0.001); -#endif /* POSTGIS_GEOS_VERSION >= 35 */ } /* ** Used by test harness to register the tests in this file. */ void triangulate_suite_setup(void); -void triangulate_suite_setup(void) +void +triangulate_suite_setup(void) { CU_pSuite suite = CU_add_suite("triangulate", NULL, NULL); PG_ADD_TEST(suite, test_lwgeom_delaunay_triangulation); diff --git a/liblwgeom/liblwgeom.h.in b/liblwgeom/liblwgeom.h.in index e96bb9e05..48fef904a 100644 --- a/liblwgeom/liblwgeom.h.in +++ b/liblwgeom/liblwgeom.h.in @@ -2256,8 +2256,6 @@ LWCOLLECTION *lwgeom_subdivide(const LWGEOM *geom, uint32_t maxvertices); * @param geom1 the geometry to snap * @param geom2 the geometry to snap to * @param tolerance the distance under which vertices and segments are snapped - * - * Requires GEOS-3.3.0+ */ LWGEOM* lwgeom_snap(const LWGEOM* geom1, const LWGEOM* geom2, double tolerance); @@ -2267,8 +2265,6 @@ LWGEOM* lwgeom_snap(const LWGEOM* geom1, const LWGEOM* geom2, double tolerance); * * @param geom1 a lineal geometry * @param geom2 another lineal geometry - * - * Requires GEOS-3.3.0+ */ LWGEOM* lwgeom_sharedpaths(const LWGEOM* geom1, const LWGEOM* geom2); diff --git a/postgis/lwgeom_geos.c b/postgis/lwgeom_geos.c index 907a41951..ffb1ad874 100644 --- a/postgis/lwgeom_geos.c +++ b/postgis/lwgeom_geos.c @@ -3350,13 +3350,6 @@ Datum ST_MinimumClearance(PG_FUNCTION_ARGS); PG_FUNCTION_INFO_V1(ST_MinimumClearance); Datum ST_MinimumClearance(PG_FUNCTION_ARGS) { -#if POSTGIS_GEOS_VERSION < 36 - lwpgerror("The GEOS version this PostGIS binary " - "was compiled against (%d) doesn't support " - "'ST_MinimumClearance' function (3.6.0+ required)", - POSTGIS_GEOS_VERSION); - PG_RETURN_NULL(); -#else /* POSTGIS_GEOS_VERSION >= 36 */ GSERIALIZED* input; GEOSGeometry* input_geos; int error; @@ -3375,7 +3368,6 @@ Datum ST_MinimumClearance(PG_FUNCTION_ARGS) PG_FREE_IF_COPY(input, 0); PG_RETURN_FLOAT8(result); -#endif } /****************************************** @@ -3389,13 +3381,6 @@ Datum ST_MinimumClearanceLine(PG_FUNCTION_ARGS); PG_FUNCTION_INFO_V1(ST_MinimumClearanceLine); Datum ST_MinimumClearanceLine(PG_FUNCTION_ARGS) { -#if POSTGIS_GEOS_VERSION < 36 - lwpgerror("The GEOS version this PostGIS binary " - "was compiled against (%d) doesn't support " - "'ST_MinimumClearanceLine' function (3.6.0+ required)", - POSTGIS_GEOS_VERSION); - PG_RETURN_NULL(); -#else /* POSTGIS_GEOS_VERSION >= 36 */ GSERIALIZED* input; GSERIALIZED* result; GEOSGeometry* input_geos; @@ -3421,7 +3406,6 @@ Datum ST_MinimumClearanceLine(PG_FUNCTION_ARGS) PG_FREE_IF_COPY(input, 0); PG_RETURN_POINTER(result); -#endif } /****************************************** @@ -3433,13 +3417,6 @@ Datum ST_OrientedEnvelope(PG_FUNCTION_ARGS); PG_FUNCTION_INFO_V1(ST_OrientedEnvelope); Datum ST_OrientedEnvelope(PG_FUNCTION_ARGS) { -#if POSTGIS_GEOS_VERSION < 36 - lwpgerror("The GEOS version this PostGIS binary " - "was compiled against (%d) doesn't support " - "'ST_OrientedEnvelope' function (3.6.0+ required)", - POSTGIS_GEOS_VERSION); - PG_RETURN_NULL(); -#else GSERIALIZED* input; GSERIALIZED* result; GEOSGeometry* input_geos; @@ -3465,5 +3442,4 @@ Datum ST_OrientedEnvelope(PG_FUNCTION_ARGS) PG_FREE_IF_COPY(input, 0); PG_RETURN_POINTER(result); -#endif } diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in index bcbe229bb..e24ad1303 100644 --- a/postgis/postgis.sql.in +++ b/postgis/postgis.sql.in @@ -3428,7 +3428,7 @@ CREATE OR REPLACE FUNCTION ST_Buffer(geometry,float8) LANGUAGE 'c' IMMUTABLE STRICT _PARALLEL COST 1; -- reset cost, see #3675 --- Availability: 1.5.0 - requires GEOS-3.2 or higher +-- Availability: 1.5.0 CREATE OR REPLACE FUNCTION _ST_Buffer(geometry,float8,cstring) RETURNS geometry AS 'MODULE_PATHNAME','buffer' @@ -3470,7 +3470,7 @@ CREATE OR REPLACE FUNCTION ST_OrientedEnvelope(geometry) AS 'MODULE_PATHNAME', 'ST_OrientedEnvelope' LANGUAGE 'c' IMMUTABLE STRICT _PARALLEL; --- Availability: 2.0.0 - requires GEOS-3.2 or higher +-- Availability: 2.0.0 CREATE OR REPLACE FUNCTION ST_OffsetCurve(line geometry, distance float8, params text DEFAULT '') RETURNS geometry AS 'MODULE_PATHNAME','ST_OffsetCurve' @@ -3505,7 +3505,6 @@ CREATE OR REPLACE FUNCTION ST_LineCrossingDirection(geom1 geometry, geom2 geomet $$ SELECT CASE WHEN NOT $1 OPERATOR(@extschema@.&&) $2 THEN 0 ELSE @extschema@._ST_LineCrossingDirection($1,$2) END $$ LANGUAGE 'sql' IMMUTABLE _PARALLEL; --- Requires GEOS >= 3.0.0 -- Availability: 1.3.3 CREATE OR REPLACE FUNCTION ST_SimplifyPreserveTopology(geometry, float8) RETURNS geometry @@ -3513,7 +3512,6 @@ CREATE OR REPLACE FUNCTION ST_SimplifyPreserveTopology(geometry, float8) LANGUAGE 'c' IMMUTABLE STRICT _PARALLEL COST 1; -- reset cost, see #3675 --- Requires GEOS >= 3.1.0 -- Availability: 1.4.0 CREATE OR REPLACE FUNCTION ST_IsValidReason(geometry) RETURNS text @@ -3528,7 +3526,6 @@ CREATE TYPE valid_detail AS ( location geometry ); --- Requires GEOS >= 3.3.0 -- Availability: 2.0.0 CREATE OR REPLACE FUNCTION ST_IsValidDetail(geometry) RETURNS valid_detail @@ -3536,7 +3533,6 @@ CREATE OR REPLACE FUNCTION ST_IsValidDetail(geometry) LANGUAGE 'c' IMMUTABLE STRICT _PARALLEL COST 1000; --- Requires GEOS >= 3.3.0 -- Availability: 2.0.0 CREATE OR REPLACE FUNCTION ST_IsValidDetail(geometry, int4) RETURNS valid_detail @@ -3544,7 +3540,6 @@ CREATE OR REPLACE FUNCTION ST_IsValidDetail(geometry, int4) LANGUAGE 'c' IMMUTABLE STRICT _PARALLEL COST 1000; --- Requires GEOS >= 3.3.0 -- Availability: 2.0.0 CREATE OR REPLACE FUNCTION ST_IsValidReason(geometry, int4) RETURNS text @@ -3556,14 +3551,12 @@ SELECT CASE WHEN valid THEN 'Valid Geometry' ELSE reason END FROM ( LANGUAGE 'sql' IMMUTABLE STRICT _PARALLEL COST 100; --- Requires GEOS >= 3.3.0 -- Availability: 2.0.0 CREATE OR REPLACE FUNCTION ST_IsValid(geometry, int4) RETURNS boolean AS 'SELECT (@extschema@.ST_isValidDetail($1, $2)).valid' LANGUAGE 'sql' IMMUTABLE STRICT _PARALLEL; --- Requires GEOS >= 3.2.0 -- Availability: 1.5.0 CREATE OR REPLACE FUNCTION ST_HausdorffDistance(geom1 geometry, geom2 geometry) RETURNS FLOAT8 @@ -3571,7 +3564,6 @@ CREATE OR REPLACE FUNCTION ST_HausdorffDistance(geom1 geometry, geom2 geometry) LANGUAGE 'c' IMMUTABLE STRICT _PARALLEL COST 100; -- Guessed cost --- Requires GEOS >= 3.2.0 -- Availability: 1.5.0 CREATE OR REPLACE FUNCTION ST_HausdorffDistance(geom1 geometry, geom2 geometry, float8) RETURNS FLOAT8 @@ -3579,7 +3571,6 @@ CREATE OR REPLACE FUNCTION ST_HausdorffDistance(geom1 geometry, geom2 geometry, LANGUAGE 'c' IMMUTABLE STRICT _PARALLEL COST 100; -- Guessed cost --- Requires GEOS >= 3.7.0 -- Availability: 2.4.0 CREATE OR REPLACE FUNCTION ST_FrechetDistance(geom1 geometry, geom2 geometry, float8 default -1) RETURNS FLOAT8 @@ -3625,7 +3616,6 @@ CREATE OR REPLACE FUNCTION ST_Union(geom1 geometry, geom2 geometry) LANGUAGE 'c' IMMUTABLE STRICT _PARALLEL; -- Availability: 2.0.0 --- Requires: GEOS-3.3.0 CREATE OR REPLACE FUNCTION ST_UnaryUnion(geometry) RETURNS geometry AS 'MODULE_PATHNAME','ST_UnaryUnion' @@ -3644,7 +3634,6 @@ CREATE OR REPLACE FUNCTION ST_RemoveRepeatedPoints(geom geometry, tolerance floa LANGUAGE 'c' IMMUTABLE STRICT _PARALLEL COST 1; -- reset cost, see #3675 --- Requires GEOS >= 3.5.0 -- Availability: 2.2.0 CREATE OR REPLACE FUNCTION ST_ClipByBox2d(geom geometry, box box2d) RETURNS geometry @@ -3652,7 +3641,6 @@ CREATE OR REPLACE FUNCTION ST_ClipByBox2d(geom geometry, box box2d) LANGUAGE 'c' IMMUTABLE STRICT _PARALLEL COST 50; -- Guessed cost --- Requires GEOS >= 3.5.0 -- Availability: 2.2.0 CREATE OR REPLACE FUNCTION ST_Subdivide(geom geometry, maxvertices integer DEFAULT 256) RETURNS setof geometry @@ -3671,7 +3659,6 @@ CREATE OR REPLACE FUNCTION ST_Subdivide(geom geometry, maxvertices integer DEFAU -- May return a geometry with inferior dimensions (dimensional collapses). -- May return NULL if can't handle input. -- --- Requires: GEOS-3.3.0 -- Availability: 2.0.0 CREATE OR REPLACE FUNCTION ST_MakeValid(geometry) RETURNS geometry @@ -3692,7 +3679,6 @@ CREATE OR REPLACE FUNCTION ST_MakeValid(geometry) -- -- Returns NULL on failure. -- --- Requires: GEOS-3.3.0 -- Availability: 2.0.0 CREATE OR REPLACE FUNCTION ST_CleanGeometry(geometry) RETURNS geometry @@ -3735,7 +3721,6 @@ CREATE OR REPLACE FUNCTION ST_Split(geom1 geometry, geom2 geometry) -- first geometry. -- -- Availability: 2.0.0 --- Requires GEOS >= 3.3.0 -- CREATE OR REPLACE FUNCTION ST_SharedPaths(geom1 geometry, geom2 geometry) RETURNS geometry @@ -3752,7 +3737,6 @@ CREATE OR REPLACE FUNCTION ST_SharedPaths(geom1 geometry, geom2 geometry) -- Snap first geometry against second. -- -- Availability: 2.0.0 --- Requires GEOS >= 3.3.0 -- CREATE OR REPLACE FUNCTION ST_Snap(geom1 geometry, geom2 geometry, float8) RETURNS geometry @@ -3769,7 +3753,6 @@ CREATE OR REPLACE FUNCTION ST_Snap(geom1 geometry, geom2 geometry, float8) -- Returns true if pattern 'pattern' matches DE9 intersection matrix 'matrix' -- -- Availability: 2.0.0 --- Requires GEOS >= 3.3.0 -- CREATE OR REPLACE FUNCTION ST_RelateMatch(text, text) RETURNS bool @@ -3788,7 +3771,6 @@ CREATE OR REPLACE FUNCTION ST_RelateMatch(text, text) -- Returns a linestring or a multilinestring containing all parts. -- -- Availability: 2.0.0 --- Requires GEOS >= 3.3.0 -- CREATE OR REPLACE FUNCTION ST_Node(g geometry) RETURNS geometry @@ -3841,7 +3823,6 @@ CREATE OR REPLACE FUNCTION ST_DelaunayTriangles(g1 geometry, tolerance float8 DE -- If return_polygons is false, returns a MultiLineString. -- -- Availability: 2.3.0 --- Requires GEOS >= 3.5.0 -- CREATE OR REPLACE FUNCTION _ST_Voronoi(g1 geometry, clip geometry DEFAULT NULL, tolerance float8 DEFAULT 0.0, return_polygons boolean DEFAULT true) @@ -4145,7 +4126,6 @@ CREATE OR REPLACE FUNCTION ST_Relate(geom1 geometry, geom2 geometry) LANGUAGE 'c' IMMUTABLE STRICT _PARALLEL; -- Availability: 2.0.0 --- Requires GEOS >= 3.3.0 CREATE OR REPLACE FUNCTION ST_Relate(geom1 geometry, geom2 geometry, int4) RETURNS text AS 'MODULE_PATHNAME','relate_full' diff --git a/raster/test/regress/rt_polygon.sql b/raster/test/regress/rt_polygon.sql index 31402adba..cd4220f97 100644 --- a/raster/test/regress/rt_polygon.sql +++ b/raster/test/regress/rt_polygon.sql @@ -58,11 +58,7 @@ FROM ( ) foo; SELECT - CASE - WHEN temp_geos_version() >= 3.3 - THEN ST_AsText(ST_Polygon(rast)) = 'MULTIPOLYGON(((1 -1,1 0,5 0,5 -5,4 -5,0 -5,0 -1,1 -1),(1 -1,1 -2,2 -2,2 -1,1 -1),(2 -2,2 -3,3 -3,3 -2,2 -2)))' - ELSE ST_AsText(ST_Polygon(rast)) = 'MULTIPOLYGON(((1 0,1 -1,0 -1,0 -5,4 -5,5 -5,5 0,1 0),(1 -1,1 -2,2 -2,2 -3,3 -3,3 -2,2 -2,2 -1,1 -1)))' - END + ST_AsText(ST_Polygon(rast)) = 'MULTIPOLYGON(((1 -1,1 0,5 0,5 -5,4 -5,0 -5,0 -1,1 -1),(1 -1,1 -2,2 -2,2 -1,1 -1),(2 -2,2 -3,3 -3,3 -2,2 -2)))' FROM ( SELECT ST_SetValue( @@ -78,11 +74,7 @@ FROM ( ) foo; SELECT - CASE - WHEN temp_geos_version() >= 3.3 - THEN ST_AsText(ST_Polygon(rast)) = 'MULTIPOLYGON(((1 -1,1 0,5 0,5 -5,4 -5,0 -5,0 -1,1 -1),(1 -1,1 -2,2 -2,2 -1,1 -1),(2 -2,2 -3,3 -3,3 -2,2 -2),(3 -3,3 -4,4 -4,4 -3,3 -3)))' - ELSE ST_AsText(ST_Polygon(rast)) = 'MULTIPOLYGON(((1 0,1 -1,0 -1,0 -5,4 -5,5 -5,5 0,1 0),(1 -1,1 -2,2 -2,2 -3,3 -3,3 -4,4 -4,4 -3,3 -3,3 -2,2 -2,2 -1,1 -1)))' - END + ST_AsText(ST_Polygon(rast)) = 'MULTIPOLYGON(((1 -1,1 0,5 0,5 -5,4 -5,0 -5,0 -1,1 -1),(1 -1,1 -2,2 -2,2 -1,1 -1),(2 -2,2 -3,3 -3,3 -2,2 -2),(3 -3,3 -4,4 -4,4 -3,3 -3)))' FROM ( SELECT ST_SetValue( diff --git a/regress/core/interrupt_relate.sql b/regress/core/interrupt_relate.sql index 1ade05569..0fd2b4767 100644 --- a/regress/core/interrupt_relate.sql +++ b/regress/core/interrupt_relate.sql @@ -29,8 +29,6 @@ UPDATE _time SET t = now(); -- reset time as creating tables spends some ----------------------------- -- IM9 based predicates --- --- These require GEOS-3.4.3+ ----------------------------- SET statement_timeout TO 100; diff --git a/regress/core/regress_buffer_params.sql b/regress/core/regress_buffer_params.sql index 799d5391a..530e9b60c 100644 --- a/regress/core/regress_buffer_params.sql +++ b/regress/core/regress_buffer_params.sql @@ -1,5 +1,5 @@ --- ---- Tests for ST_Buffer with parameters (needs GEOS-3.2 or higher) +--- Tests for ST_Buffer with parameters --- --- diff --git a/regress/core/regress_ogc_cover.sql b/regress/core/regress_ogc_cover.sql index 1c6a816ea..b862800cd 100644 --- a/regress/core/regress_ogc_cover.sql +++ b/regress/core/regress_ogc_cover.sql @@ -1,6 +1,5 @@ --- --- Tests for GEOS/JTS implemented functions ---- supported by GEOS 3.0 and upwards --- SELECT 'covers100', ST_Covers('POLYGON((0 0, 0 10, 10 10, 10 0, 0 0))', 'LINESTRING(1 10, 9 10, 9 8)'); -- 2.40.0