Codebase list geos / 541310c
New upstream version 3.7.2 Bas Couwenberg 5 years ago
24 changed file(s) with 449 addition(s) and 230 deletion(s). Raw diff Collapse all Expand all
2222 #################################################################################
2323 # Set GEOS project
2424 #################################################################################
25 project(GEOS VERSION 3.7.0 LANGUAGES C CXX)
25 project(GEOS VERSION 3.7.2 LANGUAGES C CXX)
2626
2727 # Add custom GEOS modules for CMake
2828 list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/modules")
5757
5858 # GEOS C API version
5959 set(CAPI_INTERFACE_CURRENT 12)
60 set(CAPI_INTERFACE_REVISION 0)
60 set(CAPI_INTERFACE_REVISION 2)
6161 set(CAPI_INTERFACE_AGE 11)
6262
6363 math(EXPR CAPI_VERSION_MAJOR "${CAPI_INTERFACE_CURRENT} - ${CAPI_INTERFACE_AGE}")
0 2019-05-02 Paul Ramsey <pramsey@cleverelephant.ca>
1
2 * NEWS: Set date for 3.7.2 release
3
4 2019-02-04 Regina Obe <lr@pcorp.us>
5
6 * HOWTO_RELEASE, README.md: Update instructions to include updating
7 the readme. Fix some old bot links
8
9 2019-02-04 Regina Obe <lr@pcorp.us>
10
11 Merge branch '3.7' of https://git.osgeo.org/gitea/geos/geos into
12 3.7
13
14 2019-02-04 Regina Obe <lr@pcorp.us>
15
16 * .drone-1.0.yml, README.md: Update badges to 3.7 (was stuck at
17 3.6), update drone to dronie (1.0 server)
18
19 2019-01-28 Paul Ramsey <pramsey@cleverelephant.ca>
20
21 * NEWS, src/noding/SingleInteriorIntersectionFinder.cpp,
22 tests/xmltester/CMakeLists.txt, tests/xmltester/Makefile.am,
23 tests/xmltester/tests/ticket/bug838.xml: Invalid union result from
24 valid polygon inputs References #838
25
26 2019-01-28 Paul Ramsey <pramsey@cleverelephant.ca>
27
28 * NEWS, src/operation/overlay/PolygonBuilder.cpp,
29 tests/xmltester/tests/general/TestFunctionAA.xml: Polygon build
30 failure in Overlay difference References #789
31
32 2019-01-28 Paul Ramsey <pramsey@cleverelephant.ca>
33
34 * NEWS, capi/CMakeLists.txt, src/CMakeLists.txt: fail with cmake
35 -DGEOS_ENABLE_MACOSX_FRAMEWORK=NO Closes #936
36
37 2019-01-25 Paul Ramsey <pramsey@cleverelephant.ca>
38
39 * src/geom/Envelope.cpp: Convert from nullptr to NULL
40
41 2019-01-25 Paul Ramsey <pramsey@cleverelephant.ca>
42
43 * NEWS: Update news
44
45 2019-01-25 Paul Ramsey <pramsey@cleverelephant.ca>
46
47 * src/geom/Envelope.cpp: Change Envelope constructor to use strtod
48 References #875
49
50 2018-12-21 Regina Obe <lr@pcorp.us>
51
52 Merge branch '3.7' of https://git.osgeo.org/gitea/geos/geos into
53 3.7
54
55 2018-12-20 Paul Ramsey <pramsey@cleverelephant.ca>
56
57 * CMakeLists.txt: Remove 'dev' suffix from patch number
58
59 2018-12-20 Regina Obe <regina.obe@appsassociates.com>
60
61 * configure.ac: Change version to 3.7.2dev from 3.7.2
62
63 2018-12-08 Regina Obe <lr@pcorp.us>
64
65 * CMakeLists.txt, include/geos/version.h.vc: More version number
66 updates
67
68 2018-12-08 Regina Obe <lr@pcorp.us>
69
70 * CMakeLists.txt, capi/geos_c.h.in: Increment to GEOS 3.7.2
71
72 2018-11-29 Paul Ramsey <pramsey@cleverelephant.ca>
73
74 * NEWS, configure.ac: Bump versions for next dev cycle
75
076 2018-11-29 Paul Ramsey <pramsey@cleverelephant.ca>
177
278 * NEWS, configure.ac: News and version bump for 3.7.1
0 Changes in 3.7.2
1 2019-05-02
2
3 - Bug fixes / improvements
4 - Envelope constructor using strtod (#875 Paul Ramsey)
5 - Failure in CMake for OSX Framework (#936 Paul Ramsey)
6 - Polygon build failure in Overlay difference (#789 Paul Ramsey)
7 - Invalid union result from valid polygon inputs (#838)
8
9
010 Changes in 3.7.1
111 2018-11-29
212
66
77 | branch / CI | Debbie | Winnie | Dronie | Travis CI | GitLab CI | AppVeyor | Bessie | Bessie32 |
88 |:--- |:--- |:--- |:--- |:--- |:--- |:--- |:--- |:--- |
9 | master | [![debbie](https://debbie.postgis.net/buildStatus/icon?job=GEOS_Master)](https://debbie.postgis.net/view/GEOS/job/GEOS_Master/) | [![winnie](https://winnie.postgis.net:444/view/GEOS/job/GEOS_Master/badge/icon)](https://winnie.postgis.net:444/view/GEOS/job/GEOS_Master/) | [![dronie](https://drone.osgeo.org/api/badges/geos/geos/status.svg?branch=master)](https://drone.osgeo.org/geos/geos?branch=master) | [![travis](https://travis-ci.com/libgeos/geos.svg?branch=master)](https://travis-ci.com/libgeos/geos?branch=master) | [![gitlab-ci](https://gitlab.com/geos/libgeos/badges/master/build.svg)](https://gitlab.com/geos/libgeos/commits/master) | [![appveyor](https://ci.appveyor.com/api/projects/status/ao909hwpsb1yu062/branch/master?svg=true)](https://ci.appveyor.com/project/OSGeo/geos/branch/master) | [![bessie](https://debbie.postgis.net/buildStatus/icon?job=GEOS_Worker_Run/label=bessie&BRANCH=master)](https://debbie.postgis.net/view/GEOS/job/GEOS_Worker_Run/label=bessie) | [![bessie32](https://debbie.postgis.net/buildStatus/icon?job=GEOS_Worker_Run/label=bessie32&BRANCH=master)](https://debbie.postgis.net/view/GEOS/job/GEOS_Worker_Run/label=bessie32) ||
10 | svn-3.6 | [![debbie](https://debbie.postgis.net/buildStatus/icon?job=GEOS_Branch_3.6)](https://debbie.postgis.net/view/GEOS/job/GEOS_Branch_3.6/) | [![winnie](https://winnie.postgis.net:444/view/GEOS/job/GEOS_Branch_3.6/badge/icon)](https://winnie.postgis.net:444/view/GEOS/job/GEOS_Branch_3.6/) | [![dronie](https://drone.osgeo.org/api/badges/geos/geos/status.svg?branch=svn-3.6)](https://drone.osgeo.org/geos/geos?branch=svn-3.6) | [![travis](https://travis-ci.com/libgeos/geos.svg?branch=svn-3.6)](https://travis-ci.com/libgeos/geos?branch=svn-3.6) | [![gitlab-ci](https://gitlab.com/geos/libgeos/badges/svn-3.6/build.svg)](https://gitlab.com/geos/libgeos/commits/svn-3.6) | [![appveyor](https://ci.appveyor.com/api/projects/status/ao909hwpsb1yu062/branch/svn-3.6?svg=true)](https://ci.appveyor.com/project/OSGeo/geos/branch/svn-3.6) |
9 | 3.7 | [![debbie](https://debbie.postgis.net/buildStatus/icon?job=GEOS_3.7)](https://debbie.postgis.net/view/GEOS/job/GEOS_3.7/) | [![winnie](https://winnie.postgis.net:444/view/GEOS/job/GEOS_3.7/badge/icon)](https://winnie.postgis.net:444/view/GEOS/job/GEOS_3.7/) | [![dronie](https://dronie.osgeo.org/api/badges/geos/geos/status.svg?ref=refs/heads/3.7)](https://drone.osgeo.org/geos/geos?branch=3.7) | [![travis](https://travis-ci.com/libgeos/geos.svg?branch=3.7)](https://travis-ci.com/libgeos/geos?branch=3.7) | [![gitlab-ci](https://gitlab.com/geos/libgeos/badges/3.7/build.svg)](https://gitlab.com/geos/libgeos/commits/3.7) | [![appveyor](https://ci.appveyor.com/api/projects/status/ao909hwpsb1yu062/branch/3.7?svg=true)](https://ci.appveyor.com/project/OSGeo/geos/branch/3.7) | [![bessie](https://debbie.postgis.net/buildStatus/icon?job=GEOS_Worker_Run/label=bessie&BRANCH=3.7)](https://debbie.postgis.net/view/GEOS/job/GEOS_Worker_Run/label=bessie) | [![bessie32](https://debbie.postgis.net/buildStatus/icon?job=GEOS_Worker_Run/label=bessie32&BRANCH=3.7)](https://debbie.postgis.net/view/GEOS/job/GEOS_Worker_Run/label=bessie32) ||
10 | 3.7 | [![debbie](https://debbie.postgis.net/buildStatus/icon?job=GEOS_Branch_3.7)](https://debbie.postgis.net/view/GEOS/job/GEOS_Branch_3.7/) | [![winnie](https://winnie.postgis.net:444/view/GEOS/job/GEOS_Branch_3.7/badge/icon)](https://winnie.postgis.net:444/view/GEOS/job/GEOS_Branch_3.7/) | [![dronie](https://dronie.osgeo.org/api/badges/geos/geos/status.svg?ref=refs/heads/3.7)](https://dronie.osgeo.org/geos/geos?branch=3.7) | [![travis](https://travis-ci.com/libgeos/geos.svg?branch=3.7)](https://travis-ci.com/libgeos/geos?branch=3.7) | [![gitlab-ci](https://gitlab.com/geos/libgeos/badges/3.7/build.svg)](https://gitlab.com/geos/libgeos/commits/3.7) | [![appveyor](https://ci.appveyor.com/api/projects/status/ao909hwpsb1yu062/branch/3.7?svg=true)](https://ci.appveyor.com/project/OSGeo/geos/branch/3.7) |
1111
1212 More on: https://trac.osgeo.org/geos#BuildandInstall
1313
104104
105105 ./configure ... --enable-ruby
106106
107 Since version 3.6.0 PHP bindings are not included in the core
107 Since version 3.7.0 PHP bindings are not included in the core
108108 library anymore but available as a separate project:
109109
110110 https://git.osgeo.org/gogs/geos/php-geos
1818 You have another version of autoconf. It may work, but is not guaranteed to.
1919 If you have problems, you may need to regenerate the build system entirely.
2020 To do so, use the procedure documented by the package, typically 'autoreconf'.])])
21
22 # ===========================================================================
23 # https://www.gnu.org/software/autoconf-archive/ax_require_defined.html
24 # ===========================================================================
25 #
26 # SYNOPSIS
27 #
28 # AX_REQUIRE_DEFINED(MACRO)
29 #
30 # DESCRIPTION
31 #
32 # AX_REQUIRE_DEFINED is a simple helper for making sure other macros have
33 # been defined and thus are available for use. This avoids random issues
34 # where a macro isn't expanded. Instead the configure script emits a
35 # non-fatal:
36 #
37 # ./configure: line 1673: AX_CFLAGS_WARN_ALL: command not found
38 #
39 # It's like AC_REQUIRE except it doesn't expand the required macro.
40 #
41 # Here's an example:
42 #
43 # AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG])
44 #
45 # LICENSE
46 #
47 # Copyright (c) 2014 Mike Frysinger <vapier@gentoo.org>
48 #
49 # Copying and distribution of this file, with or without modification, are
50 # permitted in any medium without royalty provided the copyright notice
51 # and this notice are preserved. This file is offered as-is, without any
52 # warranty.
53
54 #serial 2
55
56 AC_DEFUN([AX_REQUIRE_DEFINED], [dnl
57 m4_ifndef([$1], [m4_fatal([macro ]$1[ is not defined; is a m4 file missing?])])
58 ])dnl AX_REQUIRE_DEFINED
2159
2260 # Copyright (C) 2002-2018 Free Software Foundation, Inc.
2361 #
3939 CLEAN_DIRECT_OUTPUT 1)
4040 endif()
4141
42 add_dependencies(geos_c geos_revision)
43
4244 endif()
4345
44 add_dependencies(geos_c geos_revision)
4546
4647 #################################################################################
4748 # Installation
6060 #define GEOS_CAPI_VERSION_MAJOR 1
6161 #define GEOS_CAPI_VERSION_MINOR 11
6262 #define GEOS_CAPI_VERSION_PATCH 0
63 #define GEOS_CAPI_VERSION "3.7.0-CAPI-1.11.0"
63 #define GEOS_CAPI_VERSION "3.7.2-CAPI-1.11.0"
6464 #else
6565 #ifndef GEOS_VERSION_MAJOR
6666 #define GEOS_VERSION_MAJOR 3
6969 #define GEOS_VERSION_MINOR 7
7070 #endif
7171 #ifndef GEOS_VERSION_PATCH
72 #define GEOS_VERSION_PATCH 1
72 #define GEOS_VERSION_PATCH 2
7373 #endif
7474 #ifndef GEOS_VERSION
75 #define GEOS_VERSION "3.7.1"
75 #define GEOS_VERSION "3.7.2"
7676 #endif
7777 #ifndef GEOS_JTS_PORT
7878 #define GEOS_JTS_PORT "1.13.0"
8080
8181 #define GEOS_CAPI_VERSION_MAJOR 1
8282 #define GEOS_CAPI_VERSION_MINOR 11
83 #define GEOS_CAPI_VERSION_PATCH 1
84 #define GEOS_CAPI_VERSION "3.7.1-CAPI-1.11.1"
83 #define GEOS_CAPI_VERSION_PATCH 2
84 #define GEOS_CAPI_VERSION "3.7.2-CAPI-1.11.2"
8585 #endif
8686
8787 #define GEOS_CAPI_FIRST_INTERFACE GEOS_CAPI_VERSION_MAJOR
6060 #define GEOS_CAPI_VERSION_MAJOR 1
6161 #define GEOS_CAPI_VERSION_MINOR 11
6262 #define GEOS_CAPI_VERSION_PATCH 0
63 #define GEOS_CAPI_VERSION "3.7.0-CAPI-1.11.0"
63 #define GEOS_CAPI_VERSION "3.7.2-CAPI-1.11.0"
6464 #else
6565 #ifndef GEOS_VERSION_MAJOR
6666 #define GEOS_VERSION_MAJOR @VERSION_MAJOR@
26142614 JTS_PORT=1.13.0
26152615
26162616 CAPI_INTERFACE_CURRENT=12
2617 CAPI_INTERFACE_REVISION=1
2617 CAPI_INTERFACE_REVISION=2
26182618 CAPI_INTERFACE_AGE=11
26192619
26202620 VERSION_MAJOR=3
26212621 VERSION_MINOR=7
2622 VERSION_PATCH=1
2622 VERSION_PATCH=2
26232623 VERSION="$VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH"
26242624 VERSION_RELEASE=`echo "$VERSION" | sed -E 's/^([0-9]+\.[0-9]+\.[0-9]+).*$/\1/'`
26252625
1414
1515 dnl -- Version info for the CAPI
1616 CAPI_INTERFACE_CURRENT=12
17 CAPI_INTERFACE_REVISION=1
17 CAPI_INTERFACE_REVISION=2
1818 CAPI_INTERFACE_AGE=11
1919
2020 dnl
2323 dnl
2424 VERSION_MAJOR=3
2525 VERSION_MINOR=7
26 VERSION_PATCH=1
26 VERSION_PATCH=2
2727 VERSION="$VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH"
2828 VERSION_RELEASE=`echo "$VERSION" | sed -E 's/^([[0-9]+\.[0-9]+\.[0-9]+]).*$/\1/'`
2929
2222 # This could be handy for archiving the generated documentation or
2323 # if some version control system is used.
2424
25 PROJECT_NUMBER = 3.7.1
25 PROJECT_NUMBER = 3.7.2
2626
2727 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
2828 # base path where the generated documentation will be put.
307307 # directories like "/usr/src/myproject". Separate the files or directories
308308 # with spaces.
309309
310 INPUT = ./../src ./../include ./../capi
310 INPUT = ../../geos-git/doc/../src ../../geos-git/doc/../include ../../geos-git/doc/../capi
311311
312312 # If the value of the INPUT tag contains directories, you can use the
313313 # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
0 #define GEOS_REVISION "27a5e771"
0 #define GEOS_REVISION "b55d2125"
include/geos/geom/._CoordinateArraySequenceFactory.inl less more
Binary diff not shown
3333 #endif
3434
3535 #ifndef GEOS_VERSION_PATCH
36 #define GEOS_VERSION_PATCH 0
36 #define GEOS_VERSION_PATCH 2
3737 #endif
3838
3939 #ifndef GEOS_VERSION
40 #define GEOS_VERSION "3.7.0"
40 #define GEOS_VERSION "3.7.2"
4141 #endif
4242
4343 #ifndef GEOS_JTS_PORT
55 #
66 # This is free software; you can redistribute and/or modify it under
77 # the terms of the GNU Lesser General Public Licence as published
8 # by the Free Software Foundation.
8 # by the Free Software Foundation.
99 # See the COPYING file for more information.
1010 #
1111 #################################################################################
2525
2626 add_library(GEOS SHARED ${geos_SOURCES} ${geos_c_SOURCES})
2727
28 math(EXPR CVERSION "${VERSION_MAJOR} + 1")
29 # VERSION = current version, SOVERSION = compatibility version
28 math(EXPR CVERSION "${VERSION_MAJOR} + 1")
29 # VERSION = current version, SOVERSION = compatibility version
3030 set_target_properties(GEOS
3131 PROPERTIES
3232 CLEAN_DIRECT_OUTPUT 1
3333 FRAMEWORK 1
34 VERSION "${CVERSION}.${VERSION_MINOR}.${VERSION_PATCH}"
35 SOVERSION ${CVERSION}
34 VERSION "${CVERSION}.${VERSION_MINOR}.${VERSION_PATCH}"
35 SOVERSION ${CVERSION}
3636 FRAMEWORK_VERSION ${VERSION_MAJOR}
37 BUILD_WITH_INSTALL_RPATH TRUE
3837 INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}"
3938 MACOSX_FRAMEWORK_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in"
4039 MACOSX_FRAMEWORK_BUNDLE_VERSION "GEOS ${VERSION}"
139139 vector<string> values = split(coordString, ":,");
140140
141141 // create a new envelopet
142 init(::atof(values[0].c_str()),
143 ::atof(values[1].c_str()),
144 ::atof(values[2].c_str()),
145 ::atof(values[3].c_str()));
142 init(strtod(values[0].c_str(), NULL),
143 strtod(values[1].c_str(), NULL),
144 strtod(values[2].c_str(), NULL),
145 strtod(values[3].c_str(), NULL));
146146 }
147147
148148 /*public*/
1111 *
1212 **********************************************************************
1313 *
14 * Last port: noding/SingleInteriorIntersectionFinder.java rev. ??? (JTS-1.8)
14 * Last port: noding/SingleInteriorIntersectionFinder.java rev. 2019-01-28
1515 *
1616 **********************************************************************/
1717
2121 #include <geos/geom/Coordinate.h>
2222
2323 using namespace geos::geom;
24
25
26 namespace { // anonymous
27
28 /* private in JTS */
29 bool isEndInteriorIntersection(
30 const Coordinate& p0, bool isEnd0,
31 const Coordinate& p1, bool isEnd1)
32 {
33 if (isEnd0 && isEnd1) return false;
34 if (p0.equals2D(p1)) {
35 return true;
36 }
37 return false;
38 }
39
40 /* public in JTS */
41 bool isEndInteriorIntersection(
42 const Coordinate& p00, const Coordinate& p01,
43 const Coordinate& p10, const Coordinate& p11,
44 bool isEnd00, bool isEnd01,
45 bool isEnd10, bool isEnd11)
46 {
47 if (isEndInteriorIntersection(p00, isEnd00, p10, isEnd10)) return true;
48 if (isEndInteriorIntersection(p00, isEnd00, p11, isEnd11)) return true;
49 if (isEndInteriorIntersection(p01, isEnd01, p10, isEnd10)) return true;
50 if (isEndInteriorIntersection(p01, isEnd01, p11, isEnd11)) return true;
51 return false;
52 }
53
54 } // anonymous namespace
55
2456
2557 namespace geos {
2658 namespace noding { // geos.noding
4577 const Coordinate& p10 = e1->getCoordinate(segIndex1);
4678 const Coordinate& p11 = e1->getCoordinate(segIndex1 + 1);
4779
80 bool isEnd00 = segIndex0 == 0;
81 bool isEnd01 = segIndex0 + 2 == static_cast<int>(e0->size());
82 bool isEnd10 = segIndex1 == 0;
83 bool isEnd11 = segIndex1 + 2 == static_cast<int>(e1->size());
84
4885 li.computeIntersection(p00, p01, p10, p11);
4986 //if (li.hasIntersection() && li.isProper()) Debug.println(li);
87 bool isProperInteriorInt = li.hasIntersection() &&
88 li.isInteriorIntersection();
89 bool isEndInteriorInt = (e0 != e1) && isEndInteriorIntersection(
90 p00, p01, p10, p11, isEnd00, isEnd01, isEnd10, isEnd11);
5091
51 if (li.hasIntersection())
52 {
53 if (li.isInteriorIntersection())
54 {
55 intSegments.resize(4);
56 intSegments[0] = p00;
57 intSegments[1] = p01;
58 intSegments[2] = p10;
59 intSegments[3] = p11;
92 if (isProperInteriorInt || isEndInteriorInt) {
93 // found an intersection!
94 intSegments.resize(4);
95 intSegments[0] = p00;
96 intSegments[1] = p01;
97 intSegments[2] = p10;
98 intSegments[3] = p11;
99 interiorIntersection = li.getIntersection(0);
100 }
60101
61 interiorIntersection = li.getIntersection(0);
62 }
63 }
64102 }
65103
66104
2020 #include <geos/operation/overlay/OverlayOp.h>
2121 #include <geos/operation/overlay/MaximalEdgeRing.h>
2222 #include <geos/operation/overlay/MinimalEdgeRing.h>
23 #include <geos/operation/polygonize/EdgeRing.h>
2324 #include <geos/geomgraph/Node.h>
2425 #include <geos/geomgraph/NodeMap.h>
2526 #include <geos/geomgraph/DirectedEdgeStar.h>
4344 using namespace geos::algorithm;
4445 using namespace geos::geom;
4546
46
4747 namespace geos {
4848 namespace operation { // geos.operation
4949 namespace overlay { // geos.operation.overlay
145145 DirectedEdge *de=(*dirEdges)[i];
146146 #if GEOS_DEBUG
147147 cerr << " dirEdge " << i << endl
148 << de->printEdge() << endl
149 << " inResult:" << de->isInResult() << endl
150 << " isArea:" << de->getLabel().isArea() << endl;
148 << de->printEdge() << endl
149 << " inResult:" << de->isInResult() << endl
150 << " isArea:" << de->getLabel().isArea() << endl;
151151 #endif
152152 if (de->isInResult() && de->getLabel().isArea())
153153 {
304304 {
305305 geom = (*rIt)->toPolygon(geometryFactory);
306306 std::cerr << "INSERT INTO shells VALUES ('"
307 << *geom
308 << "');" << std::endl;
307 << *geom
308 << "');" << std::endl;
309309 delete geom;
310310 }
311311 geom = hole->toPolygon(geometryFactory);
312312 std::cerr << "INSERT INTO hole VALUES ('"
313 << *geom
314 << "');" << std::endl;
313 << *geom
314 << "');" << std::endl;
315315 delete geom;
316316 #endif
317317 //assert(shell!=NULL); // unable to assign hole to a shell
330330 {
331331 LinearRing *testRing=testEr->getLinearRing();
332332 const Envelope *testEnv=testRing->getEnvelopeInternal();
333 const Coordinate& testPt=testRing->getCoordinateN(0);
334333 EdgeRing *minShell=nullptr;
335 const Envelope *minEnv=nullptr;
336 for(size_t i=0, n=newShellList.size(); i<n; i++)
337 {
338 LinearRing *lr=nullptr;
339 EdgeRing *tryShell=newShellList[i];
340 LinearRing *tryRing=tryShell->getLinearRing();
341 const Envelope *tryEnv=tryRing->getEnvelopeInternal();
342 if (minShell!=nullptr) {
343 lr=minShell->getLinearRing();
344 minEnv=lr->getEnvelopeInternal();
345 }
346 bool isContained=false;
347 const CoordinateSequence *rcl = tryRing->getCoordinatesRO();
348 if (tryEnv->contains(testEnv)
349 && CGAlgorithms::isPointInRing(testPt,rcl))
350 isContained=true;
334 const Envelope *minShellEnv=nullptr;
335
336 for(auto const& tryShell: newShellList)
337 {
338 LinearRing *tryShellRing = tryShell->getLinearRing();
339 const Envelope *tryShellEnv=tryShellRing->getEnvelopeInternal();
340 // hole must be contained in shell
341 // the hole envelope cannot equal the shell envelope
342 // (also guards against testing rings against themselves)
343 if (tryShellEnv->equals(testEnv)) continue;
344 // hole must be contained in shell
345 if (!tryShellEnv->contains(testEnv)) continue;
346 const CoordinateSequence *tsrcs = tryShellRing->getCoordinatesRO();
347 Coordinate testPt = geos::operation::polygonize::EdgeRing::ptNotInList(testRing->getCoordinatesRO(), tsrcs);
348
349 bool isContained = false;
350 if (CGAlgorithms::locatePointInRing(testPt, *tsrcs) != Location::EXTERIOR)
351 isContained = true;
352
351353 // check if this new containing ring is smaller than
352354 // the current minimum ring
353355 if (isContained) {
354 if (minShell==nullptr
355 || minEnv->contains(tryEnv)) {
356 minShell=tryShell;
356 if (minShell==nullptr ||
357 minShellEnv->contains(tryShellEnv)) {
358 minShell = tryShell;
359 minShellEnv = minShell->getLinearRing()->getEnvelopeInternal();
357360 }
358361 }
359362 }
2828 the whole c api. */
2929 #define GEOS_VERSION_MAJOR 3
3030 #define GEOS_VERSION_MINOR 7
31 #define GEOS_VERSION_PATCH 1
32 #define GEOS_VERSION "3.7.1"
31 #define GEOS_VERSION_PATCH 2
32 #define GEOS_VERSION "3.7.2"
3333 #define GEOS_JTS_PORT "1.13.0"
3434
3535 #define GEOS_CAPI_VERSION_MAJOR 1
3636 #define GEOS_CAPI_VERSION_MINOR 11
37 #define GEOS_CAPI_VERSION_PATCH 1
37 #define GEOS_CAPI_VERSION_PATCH 2
3838 #define GEOS_CAPI_FIRST_INTERFACE GEOS_CAPI_VERSION_MAJOR
3939 #define GEOS_CAPI_LAST_INTERFACE (GEOS_CAPI_VERSION_MAJOR+GEOS_CAPI_VERSION_MINOR)
40 #define GEOS_CAPI_VERSION "3.7.1-CAPI-1.11.1"
40 #define GEOS_CAPI_VERSION "3.7.2-CAPI-1.11.2"
4141
4242 /* Supported geometry types */
4343 enum GEOSGeomTypes {
122122
123123
124124 #ifdef SWIGPYTHON
125 %include ../swig/python/python.i
125 %include ../../geos-git/swig/python/python.i
126126 #endif
127127
128128 #ifdef SWIGRUBY
129 %include ../swig/ruby/ruby.i
129 %include ../../geos-git/swig/ruby/ruby.i
130130 #endif
131131
132132
6161 ${XMLTESTS_DIR}/ticket/bug188.xml
6262 ${XMLTESTS_DIR}/ticket/bug244.xml
6363 ${XMLTESTS_DIR}/ticket/bug275.xml
64 ${XMLTESTS_DIR}/ticket/bug838.xml
6465 ${XMLTESTS_DIR}/general/TestBoundary.xml
6566 ${XMLTESTS_DIR}/general/TestBuffer.xml
6667 ${XMLTESTS_DIR}/general/TestBufferMitredJoin.xml
4343 $(srcdir)/tests/ticket/bug615.xml \
4444 $(srcdir)/tests/ticket/bug716.xml \
4545 $(srcdir)/tests/ticket/bug837.xml \
46 $(srcdir)/tests/ticket/bug838.xml \
4647 $(srcdir)/tests/general/TestBoundary.xml \
4748 $(srcdir)/tests/general/TestBuffer.xml \
4849 $(srcdir)/tests/general/TestBufferMitredJoin.xml \
635635 $(srcdir)/tests/ticket/bug615.xml \
636636 $(srcdir)/tests/ticket/bug716.xml \
637637 $(srcdir)/tests/ticket/bug837.xml \
638 $(srcdir)/tests/ticket/bug838.xml \
638639 $(srcdir)/tests/general/TestBoundary.xml \
639640 $(srcdir)/tests/general/TestBuffer.xml \
640641 $(srcdir)/tests/general/TestBufferMitredJoin.xml \
3232 <op name="symdifference" arg1="A" arg2="B">
3333 MULTIPOLYGON(
3434 (
35 (10 10, 10 100, 50 100, 50 50, 100 50, 100 10, 10 10)),
35 (10 10, 10 100, 50 100, 50 50, 100 50, 100 10, 10 10)),
3636 (
3737 (50 100, 50 200, 200 200, 200 50, 100 50, 100 100, 50 100)))
3838 </op>
4343 <desc>AA - A with hole intersecting B</desc>
4444 <a>
4545 POLYGON(
46 (20 20, 20 160, 160 160, 160 20, 20 20),
46 (20 20, 20 160, 160 160, 160 20, 20 20),
4747 (140 140, 40 140, 40 40, 140 40, 140 140))
4848 </a>
4949 <b>
5959 <test>
6060 <op name="union" arg1="A" arg2="B">
6161 POLYGON(
62 (20 20, 20 160, 80 160, 80 240, 220 240, 220 100, 160 100, 160 20, 20 20),
62 (20 20, 20 160, 80 160, 80 240, 220 240, 220 100, 160 100, 160 20, 20 20),
6363 (80 100, 80 140, 40 140, 40 40, 140 40, 140 100, 80 100))
6464 </op>
6565 </test>
6666 <test>
6767 <op name="difference" arg1="A" arg2="B">
6868 POLYGON(
69 (20 20, 20 160, 80 160, 80 140, 40 140, 40 40, 140 40, 140 100, 160 100,
69 (20 20, 20 160, 80 160, 80 140, 40 140, 40 40, 140 40, 140 100, 160 100,
7070 160 20, 20 20))
7171 </op>
7272 </test>
7474 <op name="symdifference" arg1="A" arg2="B">
7575 MULTIPOLYGON(
7676 (
77 (20 20, 20 160, 80 160, 80 140, 40 140, 40 40, 140 40, 140 100, 160 100,
78 160 20, 20 20)),
79 (
80 (80 100, 80 140, 140 140, 140 100, 80 100)),
77 (20 20, 20 160, 80 160, 80 140, 40 140, 40 40, 140 40, 140 100, 160 100,
78 160 20, 20 20)),
79 (
80 (80 100, 80 140, 140 140, 140 100, 80 100)),
8181 (
8282 (80 160, 80 240, 220 240, 220 100, 160 100, 160 160, 80 160)))
8383 </op>
116116 <op name="symdifference" arg1="A" arg2="B">
117117 MULTIPOLYGON(
118118 (
119 (20 340, 330 380, 50 40, 28 260, 140 220, 210 320, 140 270, 27 270, 20 340)),
119 (20 340, 330 380, 50 40, 28 260, 140 220, 210 320, 140 270, 27 270, 20 340)),
120120 (
121121 (27 270, 28 260, 0 270, 27 270)))
122122 </op>
134134 <test>
135135 <op name="intersection" arg1="A" arg2="B">
136136 GEOMETRYCOLLECTION(
137 POINT(110 260),
138 LINESTRING(110 0, 110 60),
137 POINT(110 260),
138 LINESTRING(110 0, 110 60),
139139 POLYGON(
140140 (110 100, 40 140, 110 180, 180 140, 110 100)))
141141 </op>
143143 <test>
144144 <op name="union" arg1="A" arg2="B">
145145 POLYGON(
146 (110 0, 0 0, 0 260, 110 260, 220 260, 220 0, 110 0),
147 (110 260, 40 220, 110 180, 180 220, 110 260),
146 (110 0, 0 0, 0 260, 110 260, 220 260, 220 0, 110 0),
147 (110 260, 40 220, 110 180, 180 220, 110 260),
148148 (110 100, 40 60, 110 60, 180 60, 110 100))
149149 </op>
150150 </test>
151151 <test>
152152 <op name="difference" arg1="A" arg2="B">
153153 POLYGON(
154 (110 0, 0 0, 0 260, 110 260, 40 220, 110 180, 40 140, 110 100, 40 60,
154 (110 0, 0 0, 0 260, 110 260, 40 220, 110 180, 40 140, 110 100, 40 60,
155155 110 60, 110 0))
156156 </op>
157157 </test>
158158 <test>
159159 <op name="symdifference" arg1="A" arg2="B">
160160 POLYGON(
161 (110 0, 0 0, 0 260, 110 260, 220 260, 220 0, 110 0),
162 (110 260, 40 220, 110 180, 180 220, 110 260),
163 (110 180, 40 140, 110 100, 180 140, 110 180),
161 (110 0, 0 0, 0 260, 110 260, 220 260, 220 0, 110 0),
162 (110 260, 40 220, 110 180, 180 220, 110 260),
163 (110 180, 40 140, 110 100, 180 140, 110 180),
164164 (110 100, 40 60, 110 60, 180 60, 110 100))
165165 </op>
166166 </test>
170170 <desc>AA - simple polygons with two touching holes in their symDifference</desc>
171171 <a>
172172 POLYGON(
173 (0 0, 120 0, 120 50, 50 50, 120 100, 50 150, 120 150, 120 190, 0 190,
173 (0 0, 120 0, 120 50, 50 50, 120 100, 50 150, 120 150, 120 190, 0 190,
174174 0 0))
175175 </a>
176176 <b>
177177 POLYGON(
178 (230 0, 120 0, 120 50, 190 50, 120 100, 190 150, 120 150, 120 190, 230 190,
178 (230 0, 120 0, 120 50, 190 50, 120 100, 190 150, 120 150, 120 190, 230 190,
179179 230 0))
180180 </b>
181181 <test>
182182 <op name="symdifference" arg1="A" arg2="B">
183183 POLYGON(
184 (120 0, 0 0, 0 190, 120 190, 230 190, 230 0, 120 0),
185 (120 100, 50 50, 120 50, 190 50, 120 100),
184 (120 0, 0 0, 0 190, 120 190, 230 190, 230 0, 120 0),
185 (120 100, 50 50, 120 50, 190 50, 120 100),
186186 (120 100, 190 150, 120 150, 50 150, 120 100))
187187 </op>
188188 </test>
197197 <b>
198198 MULTIPOLYGON(
199199 (
200 (40 20, 0 0, 20 40, 60 60, 40 20)),
201 (
202 (60 90, 60 60, 90 60, 90 90, 60 90)),
203 (
204 (70 120, 90 90, 100 120, 70 120)),
200 (40 20, 0 0, 20 40, 60 60, 40 20)),
201 (
202 (60 90, 60 60, 90 60, 90 90, 60 90)),
203 (
204 (70 120, 90 90, 100 120, 70 120)),
205205 (
206206 (120 70, 90 90, 120 100, 120 70)))
207207 </b>
208208 <test>
209209 <op name="symdifference" arg1="A" arg2="B">
210210 POLYGON(
211 (0 0, 0 230, 210 230, 210 0, 0 0),
212 (0 0, 40 20, 60 60, 20 40, 0 0),
213 (60 60, 90 60, 90 90, 60 90, 60 60),
214 (90 90, 120 70, 120 100, 90 90),
211 (0 0, 0 230, 210 230, 210 0, 0 0),
212 (0 0, 40 20, 60 60, 20 40, 0 0),
213 (60 60, 90 60, 90 90, 60 90, 60 60),
214 (90 90, 120 70, 120 100, 90 90),
215215 (90 90, 100 120, 70 120, 90 90))
216216 </op>
217217 </test>
226226 <b>
227227 MULTIPOLYGON(
228228 (
229 (40 20, 0 0, 20 40, 60 60, 40 20)),
229 (40 20, 0 0, 20 40, 60 60, 40 20)),
230230 (
231231 (60 100, 60 60, 100 60, 100 100, 60 100)))
232232 </b>
234234 <op name="intersection" arg1="A" arg2="B">
235235 MULTIPOLYGON(
236236 (
237 (40 20, 0 0, 20 40, 60 60, 40 20)),
237 (40 20, 0 0, 20 40, 60 60, 40 20)),
238238 (
239239 (60 60, 60 100, 100 100, 100 60, 60 60)))
240240 </op>
242242 <test>
243243 <op name="symdifference" arg1="A" arg2="B">
244244 POLYGON(
245 (0 0, 0 300, 340 300, 340 0, 0 0),
246 (0 0, 40 20, 60 60, 20 40, 0 0),
245 (0 0, 0 300, 340 300, 340 0, 0 0),
246 (0 0, 40 20, 60 60, 20 40, 0 0),
247247 (60 60, 100 60, 100 100, 60 100, 60 60))
248248 </op>
249249 </test>
258258 <b>
259259 MULTIPOLYGON(
260260 (
261 (60 20, 0 20, 60 60, 60 20)),
261 (60 20, 0 20, 60 60, 60 20)),
262262 (
263263 (60 100, 60 60, 100 60, 100 100, 60 100)))
264264 </b>
266266 <op name="intersection" arg1="A" arg2="B">
267267 MULTIPOLYGON(
268268 (
269 (60 20, 0 20, 60 60, 60 20)),
269 (60 20, 0 20, 60 60, 60 20)),
270270 (
271271 (60 60, 60 100, 100 100, 100 60, 60 60)))
272272 </op>
280280 <test>
281281 <op name="difference" arg1="A" arg2="B">
282282 POLYGON(
283 (0 20, 0 120, 120 120, 120 0, 0 0, 0 20),
284 (0 20, 60 20, 60 60, 0 20),
283 (0 20, 0 120, 120 120, 120 0, 0 0, 0 20),
284 (0 20, 60 20, 60 60, 0 20),
285285 (60 60, 100 60, 100 100, 60 100, 60 60))
286286 </op>
287287 </test>
288288 <test>
289289 <op name="symdifference" arg1="A" arg2="B">
290290 POLYGON(
291 (0 20, 0 120, 120 120, 120 0, 0 0, 0 20),
292 (0 20, 60 20, 60 60, 0 20),
291 (0 20, 0 120, 120 120, 120 0, 0 0, 0 20),
292 (0 20, 60 20, 60 60, 0 20),
293293 (60 60, 100 60, 100 100, 60 100, 60 60))
294294 </op>
295295 </test>
299299 <desc>AA - simple polygons with holes</desc>
300300 <a>
301301 POLYGON(
302 (160 330, 60 260, 20 150, 60 40, 190 20, 270 130, 260 250, 160 330),
302 (160 330, 60 260, 20 150, 60 40, 190 20, 270 130, 260 250, 160 330),
303303 (140 240, 80 190, 90 100, 160 70, 210 130, 210 210, 140 240))
304304 </a>
305305 <b>
306306 POLYGON(
307 (300 330, 190 270, 150 170, 150 110, 250 30, 380 50, 380 250, 300 330),
307 (300 330, 190 270, 150 170, 150 110, 250 30, 380 50, 380 250, 300 330),
308308 (290 240, 240 200, 240 110, 290 80, 330 170, 290 240))
309309 </b>
310310 <test>
311311 <op name="intersection" arg1="A" arg2="B">
312312 POLYGON(
313 (251 104, 217 57, 176 89, 210 130, 210 210, 172 226, 190 270, 217 285, 260 250,
313 (251 104, 217 57, 176 89, 210 130, 210 210, 172 226, 190 270, 217 285, 260 250,
314314 263 218, 240 200, 240 110, 251 104))
315315 </op>
316316 </test>
318318 <op name="symdifference" arg1="A" arg2="B">
319319 MULTIPOLYGON(
320320 (
321 (217 57, 190 20, 60 40, 20 150, 60 260, 160 330, 217 285, 190 270, 172 226,
322 140 240, 80 190, 90 100, 160 70, 176 89, 217 57)),
323 (
324 (217 57, 251 104, 290 80, 330 170, 290 240, 263 218, 260 250, 217 285, 300 330,
325 380 250, 380 50, 250 30, 217 57)),
326 (
327 (263 218, 270 130, 251 104, 240 110, 240 200, 263 218)),
321 (217 57, 190 20, 60 40, 20 150, 60 260, 160 330, 217 285, 190 270, 172 226,
322 140 240, 80 190, 90 100, 160 70, 176 89, 217 57)),
323 (
324 (217 57, 251 104, 290 80, 330 170, 290 240, 263 218, 260 250, 217 285, 300 330,
325 380 250, 380 50, 250 30, 217 57)),
326 (
327 (263 218, 270 130, 251 104, 240 110, 240 200, 263 218)),
328328 (
329329 (172 226, 210 210, 210 130, 176 89, 150 110, 150 170, 172 226)))
330330 </op>
337337 POLYGON ((20 0, 20 160, 200 160, 200 0, 20 0))
338338 </a>
339339 <b>
340 POLYGON ((220 80, 0 80, 0 240, 220 240, 220 80),
340 POLYGON ((220 80, 0 80, 0 240, 220 240, 220 80),
341341 (100 80, 120 120, 80 120, 100 80))
342342 </b>
343343 <test>
344344 <op name="intersection" arg1="A" arg2="B">
345 POLYGON ((20 80, 20 160, 200 160, 200 80, 100 80, 20 80),
345 POLYGON ((20 80, 20 160, 200 160, 200 80, 100 80, 20 80),
346346 (100 80, 120 120, 80 120, 100 80))
347347 </op>
348348 </test>
353353 </test>
354354 <test>
355355 <op name="difference" arg1="A" arg2="B">
356 MULTIPOLYGON (((20 0, 20 80, 100 80, 200 80, 200 0, 20 0)),
356 MULTIPOLYGON (((20 0, 20 80, 100 80, 200 80, 200 0, 20 0)),
357357 ((100 80, 80 120, 120 120, 100 80)))
358358 </op>
359359 </test>
360360 <test>
361361 <op name="symdifference" arg1="A" arg2="B">
362 MULTIPOLYGON (((20 0, 20 80, 100 80, 200 80, 200 0, 20 0)),
363 ((200 80, 200 160, 20 160, 20 80, 0 80, 0 240, 220 240, 220 80, 200 80)),
362 MULTIPOLYGON (((20 0, 20 80, 100 80, 200 80, 200 0, 20 0)),
363 ((200 80, 200 160, 20 160, 20 80, 0 80, 0 240, 220 240, 220 80, 200 80)),
364364 ((100 80, 80 120, 120 120, 100 80)))
365365 </op>
366366 </test>
371371 <a>
372372 MULTIPOLYGON(
373373 (
374 (120 340, 120 200, 140 200, 140 280, 160 280, 160 200, 180 200, 180 280, 200 280,
375 200 200, 220 200, 220 340, 120 340)),
376 (
377 (360 200, 220 200, 220 180, 300 180, 300 160, 220 160, 220 140, 300 140, 300 120,
374 (120 340, 120 200, 140 200, 140 280, 160 280, 160 200, 180 200, 180 280, 200 280,
375 200 200, 220 200, 220 340, 120 340)),
376 (
377 (360 200, 220 200, 220 180, 300 180, 300 160, 220 160, 220 140, 300 140, 300 120,
378378 220 120, 220 100, 360 100, 360 200)))
379379 </a>
380380 <b>
381381 MULTIPOLYGON(
382382 (
383 (100 220, 100 200, 300 200, 300 220, 100 220)),
384 (
385 (280 180, 280 160, 300 160, 300 180, 280 180)),
386 (
387 (220 140, 220 120, 240 120, 240 140, 220 140)),
383 (100 220, 100 200, 300 200, 300 220, 100 220)),
384 (
385 (280 180, 280 160, 300 160, 300 180, 280 180)),
386 (
387 (220 140, 220 120, 240 120, 240 140, 220 140)),
388388 (
389389 (180 220, 160 240, 200 240, 180 220)))
390390 </b>
391391 <test>
392392 <op name="getboundary" arg1="A">
393393 MULTILINESTRING(
394 (120 340, 120 200, 140 200, 140 280, 160 280, 160 200, 180 200, 180 280, 200 280,
395 200 200, 220 200, 220 340, 120 340),
396 (360 200, 220 200, 220 180, 300 180, 300 160, 220 160, 220 140, 300 140, 300 120,
394 (120 340, 120 200, 140 200, 140 280, 160 280, 160 200, 180 200, 180 280, 200 280,
395 200 200, 220 200, 220 340, 120 340),
396 (360 200, 220 200, 220 180, 300 180, 300 160, 220 160, 220 140, 300 140, 300 120,
397397 220 120, 220 100, 360 100, 360 200))
398398 </op>
399399 </test>
406406 <test>
407407 <op name="intersection" arg1="A" arg2="B">
408408 GEOMETRYCOLLECTION(
409 POINT(200 240),
410 LINESTRING(300 200, 220 200),
411 LINESTRING(280 180, 300 180),
412 LINESTRING(300 180, 300 160),
413 LINESTRING(300 160, 280 160),
414 LINESTRING(220 140, 240 140),
415 LINESTRING(240 120, 220 120),
409 POINT(200 240),
410 LINESTRING(300 200, 220 200),
411 LINESTRING(280 180, 300 180),
412 LINESTRING(300 180, 300 160),
413 LINESTRING(300 160, 280 160),
414 LINESTRING(220 140, 240 140),
415 LINESTRING(240 120, 220 120),
416416 POLYGON(
417 (120 200, 120 220, 140 220, 140 200, 120 200)),
417 (120 200, 120 220, 140 220, 140 200, 120 200)),
418418 POLYGON(
419 (160 200, 160 220, 180 220, 180 200, 160 200)),
419 (160 200, 160 220, 180 220, 180 200, 160 200)),
420420 POLYGON(
421 (180 240, 180 220, 160 240, 180 240)),
421 (180 240, 180 220, 160 240, 180 240)),
422422 POLYGON(
423423 (200 200, 200 220, 220 220, 220 200, 200 200)))
424424 </op>
426426 <test>
427427 <op name="union" arg1="A" arg2="B">
428428 POLYGON(
429 (120 220, 120 340, 220 340, 220 220, 300 220, 300 200, 360 200, 360 100, 220 100,
430 220 120, 220 140, 220 160, 280 160, 280 180, 220 180, 220 200, 200 200, 180 200, 160 200,
431 140 200, 120 200, 100 200, 100 220, 120 220),
432 (200 240, 200 280, 180 280, 180 240, 200 240),
433 (200 240, 180 220, 200 220, 200 240),
434 (160 240, 160 280, 140 280, 140 220, 160 220, 160 240),
429 (120 220, 120 340, 220 340, 220 220, 300 220, 300 200, 360 200, 360 100, 220 100,
430 220 120, 220 140, 220 160, 280 160, 280 180, 220 180, 220 200, 200 200, 180 200, 160 200,
431 140 200, 120 200, 100 200, 100 220, 120 220),
432 (200 240, 200 280, 180 280, 180 240, 200 240),
433 (200 240, 180 220, 200 220, 200 240),
434 (160 240, 160 280, 140 280, 140 220, 160 220, 160 240),
435435 (240 120, 300 120, 300 140, 240 140, 240 120))
436436 </op>
437437 </test>
439439 <op name="difference" arg1="A" arg2="B">
440440 MULTIPOLYGON(
441441 (
442 (120 220, 120 340, 220 340, 220 220, 200 220, 200 240, 200 280, 180 280, 180 240,
443 160 240, 160 280, 140 280, 140 220, 120 220)),
444 (
445 (160 220, 160 240, 180 220, 160 220)),
446 (
447 (300 200, 360 200, 360 100, 220 100, 220 120, 240 120, 300 120, 300 140, 240 140,
442 (120 220, 120 340, 220 340, 220 220, 200 220, 200 240, 200 280, 180 280, 180 240,
443 160 240, 160 280, 140 280, 140 220, 120 220)),
444 (
445 (160 220, 160 240, 180 220, 160 220)),
446 (
447 (300 200, 360 200, 360 100, 220 100, 220 120, 240 120, 300 120, 300 140, 240 140,
448448 220 140, 220 160, 280 160, 300 160, 300 180, 280 180, 220 180, 220 200, 300 200)))
449449 </op>
450450 </test>
452452 <op name="symdifference" arg1="A" arg2="B">
453453 MULTIPOLYGON(
454454 (
455 (120 220, 120 340, 220 340, 220 220, 200 220, 200 240, 200 280, 180 280, 180 240,
456 160 240, 160 280, 140 280, 140 220, 120 220)),
457 (
458 (120 220, 120 200, 100 200, 100 220, 120 220)),
459 (
460 (140 200, 140 220, 160 220, 160 200, 140 200)),
461 (
462 (160 220, 160 240, 180 220, 160 220)),
463 (
464 (180 200, 180 220, 200 220, 200 200, 180 200)),
465 (
466 (180 220, 180 240, 200 240, 180 220)),
467 (
468 (220 200, 220 220, 300 220, 300 200, 360 200, 360 100, 220 100, 220 120, 220 140,
469 220 160, 280 160, 280 180, 220 180, 220 200),
455 (120 220, 120 340, 220 340, 220 220, 200 220, 200 240, 200 280, 180 280, 180 240,
456 160 240, 160 280, 140 280, 140 220, 120 220)),
457 (
458 (120 220, 120 200, 100 200, 100 220, 120 220)),
459 (
460 (140 200, 140 220, 160 220, 160 200, 140 200)),
461 (
462 (160 220, 160 240, 180 220, 160 220)),
463 (
464 (180 200, 180 220, 200 220, 200 200, 180 200)),
465 (
466 (180 220, 180 240, 200 240, 180 220)),
467 (
468 (220 200, 220 220, 300 220, 300 200, 360 200, 360 100, 220 100, 220 120, 220 140,
469 220 160, 280 160, 280 180, 220 180, 220 200),
470470 (240 120, 300 120, 300 140, 240 140, 240 120)))
471471 </op>
472472 </test>
477477 <a>
478478 MULTIPOLYGON(
479479 (
480 (100 200, 100 180, 120 180, 120 200, 100 200)),
481 (
482 (60 240, 60 140, 220 140, 220 160, 160 160, 160 180, 200 180, 200 200, 160 200,
483 160 220, 220 220, 220 240, 60 240),
484 (80 220, 80 160, 140 160, 140 220, 80 220)),
480 (100 200, 100 180, 120 180, 120 200, 100 200)),
481 (
482 (60 240, 60 140, 220 140, 220 160, 160 160, 160 180, 200 180, 200 200, 160 200,
483 160 220, 220 220, 220 240, 60 240),
484 (80 220, 80 160, 140 160, 140 220, 80 220)),
485485 (
486486 (280 220, 240 180, 260 160, 300 200, 280 220)))
487487 </a>
488488 <b>
489489 MULTIPOLYGON(
490490 (
491 (80 220, 80 160, 140 160, 140 220, 80 220),
492 (100 200, 100 180, 120 180, 120 200, 100 200)),
493 (
494 (220 240, 220 220, 160 220, 160 200, 220 200, 220 180, 160 180, 160 160, 220 160,
495 220 140, 320 140, 320 240, 220 240),
491 (80 220, 80 160, 140 160, 140 220, 80 220),
492 (100 200, 100 180, 120 180, 120 200, 100 200)),
493 (
494 (220 240, 220 220, 160 220, 160 200, 220 200, 220 180, 160 180, 160 160, 220 160,
495 220 140, 320 140, 320 240, 220 240),
496496 (240 220, 240 160, 300 160, 300 220, 240 220)))
497497 </b>
498498 <test>
499499 <op name="getboundary" arg1="A">
500500 MULTILINESTRING(
501 (100 200, 100 180, 120 180, 120 200, 100 200),
502 (60 240, 60 140, 220 140, 220 160, 160 160, 160 180, 200 180, 200 200, 160 200,
503 160 220, 220 220, 220 240, 60 240),
504 (80 220, 80 160, 140 160, 140 220, 80 220),
501 (100 200, 100 180, 120 180, 120 200, 100 200),
502 (60 240, 60 140, 220 140, 220 160, 160 160, 160 180, 200 180, 200 200, 160 200,
503 160 220, 220 220, 220 240, 60 240),
504 (80 220, 80 160, 140 160, 140 220, 80 220),
505505 (280 220, 240 180, 260 160, 300 200, 280 220))
506506 </op>
507507 </test>
514514 <test>
515515 <op name="intersection" arg1="A" arg2="B">
516516 GEOMETRYCOLLECTION(
517 POINT(240 180),
518 POINT(260 160),
519 POINT(280 220),
520 POINT(300 200),
521 LINESTRING(100 200, 100 180),
522 LINESTRING(100 180, 120 180),
523 LINESTRING(120 180, 120 200),
524 LINESTRING(120 200, 100 200),
525 LINESTRING(220 140, 220 160),
526 LINESTRING(220 160, 160 160),
527 LINESTRING(160 160, 160 180),
528 LINESTRING(160 180, 200 180),
529 LINESTRING(200 200, 160 200),
530 LINESTRING(160 200, 160 220),
531 LINESTRING(160 220, 220 220),
532 LINESTRING(220 220, 220 240),
533 LINESTRING(80 220, 80 160),
534 LINESTRING(80 160, 140 160),
535 LINESTRING(140 160, 140 220),
517 POINT(240 180),
518 POINT(260 160),
519 POINT(280 220),
520 POINT(300 200),
521 LINESTRING(100 200, 100 180),
522 LINESTRING(100 180, 120 180),
523 LINESTRING(120 180, 120 200),
524 LINESTRING(120 200, 100 200),
525 LINESTRING(220 140, 220 160),
526 LINESTRING(220 160, 160 160),
527 LINESTRING(160 160, 160 180),
528 LINESTRING(160 180, 200 180),
529 LINESTRING(200 200, 160 200),
530 LINESTRING(160 200, 160 220),
531 LINESTRING(160 220, 220 220),
532 LINESTRING(220 220, 220 240),
533 LINESTRING(80 220, 80 160),
534 LINESTRING(80 160, 140 160),
535 LINESTRING(140 160, 140 220),
536536 LINESTRING(140 220, 80 220))
537537 </op>
538538 </test>
540540 <op name="union" arg1="A" arg2="B">
541541 MULTIPOLYGON(
542542 (
543 (220 140, 60 140, 60 240, 220 240, 320 240, 320 140, 220 140),
544 (200 200, 200 180, 220 180, 220 200, 200 200),
545 (240 220, 240 180, 240 160, 260 160, 300 160, 300 200, 300 220, 280 220, 240 220)),
543 (220 140, 60 140, 60 240, 220 240, 320 240, 320 140, 220 140),
544 (200 200, 200 180, 220 180, 220 200, 200 200),
545 (240 220, 240 180, 240 160, 260 160, 300 160, 300 200, 300 220, 280 220, 240 220)),
546546 (
547547 (240 180, 280 220, 300 200, 260 160, 240 180)))
548548 </op>
551551 <op name="difference" arg1="A" arg2="B">
552552 MULTIPOLYGON(
553553 (
554 (100 180, 100 200, 120 200, 120 180, 100 180)),
555 (
556 (220 140, 60 140, 60 240, 220 240, 220 220, 160 220, 160 200, 200 200, 200 180,
557 160 180, 160 160, 220 160, 220 140),
558 (80 220, 80 160, 140 160, 140 220, 80 220)),
554 (100 180, 100 200, 120 200, 120 180, 100 180)),
555 (
556 (220 140, 60 140, 60 240, 220 240, 220 220, 160 220, 160 200, 200 200, 200 180,
557 160 180, 160 160, 220 160, 220 140),
558 (80 220, 80 160, 140 160, 140 220, 80 220)),
559559 (
560560 (240 180, 280 220, 300 200, 260 160, 240 180)))
561561 </op>
564564 <op name="symdifference" arg1="A" arg2="B">
565565 MULTIPOLYGON(
566566 (
567 (220 140, 60 140, 60 240, 220 240, 320 240, 320 140, 220 140),
568 (200 200, 200 180, 220 180, 220 200, 200 200),
569 (240 220, 240 180, 240 160, 260 160, 300 160, 300 200, 300 220, 280 220, 240 220)),
567 (220 140, 60 140, 60 240, 220 240, 320 240, 320 140, 220 140),
568 (200 200, 200 180, 220 180, 220 200, 200 200),
569 (240 220, 240 180, 240 160, 260 160, 300 160, 300 200, 300 220, 280 220, 240 220)),
570570 (
571571 (240 180, 280 220, 300 200, 260 160, 240 180)))
572572 </op>
581581 </a>
582582 <b>
583583 POLYGON(
584 (160 160, 100 160, 100 100, 160 100, 160 160),
584 (160 160, 100 160, 100 100, 160 100, 160 160),
585585 (140 140, 120 140, 120 120, 140 120, 140 140))
586586 </b>
587587 <test>
598598 <test>
599599 <op name="intersection" arg1="A" arg2="B">
600600 GEOMETRYCOLLECTION(
601 LINESTRING(140 140, 140 120),
601 LINESTRING(140 140, 140 120),
602602 POLYGON(
603603 (100 160, 140 160, 140 140, 120 140, 120 120, 140 120, 140 100, 100 100, 100 160)))
604604 </op>
613613 <op name="difference" arg1="A" arg2="B">
614614 MULTIPOLYGON(
615615 (
616 (60 160, 100 160, 100 100, 140 100, 140 60, 60 60, 60 160)),
616 (60 160, 100 160, 100 100, 140 100, 140 60, 60 60, 60 160)),
617617 (
618618 (140 140, 140 120, 120 120, 120 140, 140 140)))
619619 </op>
622622 <op name="symdifference" arg1="A" arg2="B">
623623 MULTIPOLYGON(
624624 (
625 (60 160, 100 160, 100 100, 140 100, 140 60, 60 60, 60 160)),
625 (60 160, 100 160, 100 100, 140 100, 140 60, 60 60, 60 160)),
626626 (
627627 (140 140, 140 160, 160 160, 160 100, 140 100, 140 120, 120 120, 120 140, 140 140)))
628628 </op>
629629 </test>
630630 </case>
631631
632 <case>
633 <desc>AA - Polygons which stress hole assignment</desc>
634 <a>
635 POLYGON ((0 0, 4 0, 4 4, 0 4, 0 0), (1 1, 1 2, 2 1, 1 1), (1 2, 1 3, 2 3, 1 2), (2 3, 3 3, 3 2, 2 3))
636 </a>
637 <b>
638 POLYGON ((2 1, 3 1, 3 2, 2 1))
639 </b>
640 <test>
641 <op name="intersection" arg1="A" arg2="B">
642 POLYGON ((3 2, 3 1, 2 1, 3 2))
643 </op>
644 </test>
645 <test>
646 <op name="union" arg1="A" arg2="B">
647 POLYGON ((0 0, 0 4, 4 4, 4 0, 0 0), (1 2, 1 1, 2 1, 1 2), (1 2, 2 3, 1 3, 1 2), (2 3, 3 2, 3 3, 2 3))
648 </op>
649 </test>
650 <test>
651 <op name="difference" arg1="A" arg2="B">
652 MULTIPOLYGON (((0 0, 0 4, 4 4, 4 0, 0 0), (1 2, 1 1, 2 1, 3 1, 3 2, 3 3, 2 3, 1 3, 1 2)), ((2 1, 1 2, 2 3, 3 2, 2 1)))
653 </op>
654 </test>
655 <test>
656 <op name="symdifference" arg1="A" arg2="B">
657 MULTIPOLYGON (((0 0, 0 4, 4 4, 4 0, 0 0), (1 2, 1 1, 2 1, 3 1, 3 2, 3 3, 2 3, 1 3, 1 2)), ((2 1, 1 2, 2 3, 3 2, 2 1)))
658 </op>
659 </test>
660 </case>
661
662
632663 </run>
0 <run>
1 <precisionModel type="FLOATING" />
2 <case>
3 <desc>
4 Union of two valid polygons resulting in an invalid geometry
5 See https://trac.osgeo.org/geos/ticket/838
6 </desc>
7 <a>
8 00000000060000000200000000030000000100000005412CD75B00000000413D8F0966666667412CD75933333333413D8F6D80000000412CD82166666667413D8F6E4CCCCCCD412CD82500000000413D8EA61999999A412CD75B00000000413D8F096666666700000000030000000100000005412CD82500000001413D8EA61999999A412CD82333333334413D8F0A33333333412CD8EB66666666413D8F0B19999999412CD8ED33333333413D8EA700000001412CD82500000001413D8EA61999999A
9 </a>
10 <b>
11 00000000030000000100000007412CD9D4D50CE8F7413D8EA7FBC39C12412CD8ED33333333413D8EA700000000412CD8EB66666667413D8F0B1999999A412CD82333333333413D8F0A33333333412CD82166666667413D8F6E4CCCCCCD412CD9B1CCCCCCCD413D8F701999999A412CD9D4D50CE8F7413D8EA7FBC39C12
12 </b>
13 <test>
14 <op name="union" arg1="A" arg2="B">
15 0103000000010000000A000000000000005BD72C4167666666098F3D413333333359D72C41000000806D8F3D416766666621D82C41CDCCCC4C6E8F3D41CDCCCCCCB1D92C419A999919708F3D41F7E80CD5D4D92C41129CC3FBA78E3D4133333333EDD82C4100000000A78E3D410100000025D82C419A999919A68E3D413333333323D82C41333333330A8F3D410000000025D82C419A999919A68E3D41000000005BD72C4167666666098F3D41
16 </op>
17 </test>
18 </case>
19 </run>