Skip to content

Commit c12d55d

Browse files
craig[bot]yuzefovich
andcommitted
Merge #148859
148859: geos: update GEOS to 3.12.3 r=yuzefovich a=yuzefovich Most of the test changes are due to ordering difference within POLYGONs (which seems ok). Others were compared against PostGIS running GEOS 3.13.1 and mostly match Postgres. The following differences were found: - a couple cases in TestSimplifyGEOS appear to be close enough - `ST_LineInterPolatePoints` now returns an error for `LINESTRING EMPTY`, which wasn't the case before for us with 3.11.2, nor is the case for PostGIS with 3.13.1. I spent some time trying to install PostGIS 3.4.3 locally which uses GEOS 3.12.x, but brew makes it hard, so I gave up. I plan to bump GEOS to 3.13.1 shortly, so hopefully some of the differences will be reverted. Epic: None Release note (general change): Spatial libraries from Cockroach now rely on GEOS 3.12 instead of GEOS 3.11. Co-authored-by: Yahor Yuzefovich <[email protected]>
2 parents 15c9b15 + 337648a commit c12d55d

File tree

13 files changed

+125
-127
lines changed

13 files changed

+125
-127
lines changed

build/bazelutil/distdir_files.bzl

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,22 +1192,22 @@ DISTDIR_FILES = {
11921192
"https://storage.googleapis.com/public-bazel-artifacts/bazel/rules_proto-6.0.2.tar.gz": "6fb6767d1bef535310547e03247f7518b03487740c11b6c6adb7952033fe1295",
11931193
"https://storage.googleapis.com/public-bazel-artifacts/bazel/rules_python-0.1.0.tar.gz": "b6d46438523a3ec0f3cead544190ee13223a52f6a6765a29eae7b7cc24cc83a0",
11941194
"https://storage.googleapis.com/public-bazel-artifacts/bazel/sqllogictest-96138842571462ed9a697bff590828d8f6356a2f.tar.gz": "f7e0d659fbefb65f32d4c5d146cba4c73c43e0e96f9b217a756c82be17451f97",
1195-
"https://storage.googleapis.com/public-bazel-artifacts/c-deps/20241202-211651/libgeos_foreign.linux.20241202-211651.tar.gz": "ae787cc08fdf6b511859c5c67e5b834a9f6cdb57aa49d32f9226a984bbeb2af5",
1196-
"https://storage.googleapis.com/public-bazel-artifacts/c-deps/20241202-211651/libgeos_foreign.linuxarm.20241202-211651.tar.gz": "edaac8486c7da5a87c3857e52223a35e3533286786c0109847de1fd142884c2a",
1197-
"https://storage.googleapis.com/public-bazel-artifacts/c-deps/20241202-211651/libgeos_foreign.macos.20241202-211651.tar.gz": "2b762d57dd877e54fee402afbdebe433bbd4ee636accf782ec44633c6f1e380b",
1198-
"https://storage.googleapis.com/public-bazel-artifacts/c-deps/20241202-211651/libgeos_foreign.macosarm.20241202-211651.tar.gz": "401252bba664cbbd9d9329fc068b04b0cc01e390e7c7f419a6cba081c6e950c2",
1199-
"https://storage.googleapis.com/public-bazel-artifacts/c-deps/20241202-211651/libjemalloc_foreign.linux.20241202-211651.tar.gz": "21059f2c065b35fa7cd39a19f882e03dbab24480d0eb787d03dd458bbba92b4a",
1200-
"https://storage.googleapis.com/public-bazel-artifacts/c-deps/20241202-211651/libjemalloc_foreign.linuxarm.20241202-211651.tar.gz": "745930cc073b09f5a25690e7b3a273a96dd6943402ba425ad916c9555a2a016c",
1201-
"https://storage.googleapis.com/public-bazel-artifacts/c-deps/20241202-211651/libjemalloc_foreign.macos.20241202-211651.tar.gz": "255632b4fddebd7cb4799f255251a8137256e207a402900ca7de7be496a1a238",
1202-
"https://storage.googleapis.com/public-bazel-artifacts/c-deps/20241202-211651/libjemalloc_foreign.macosarm.20241202-211651.tar.gz": "0a73f3f88183ce7aacb8a105077b32ff6ee77216adc776683cf64f75eb9a6513",
1203-
"https://storage.googleapis.com/public-bazel-artifacts/c-deps/20241202-211651/libjemalloc_foreign.windows.20241202-211651.tar.gz": "c13afc513257839762e423af9a52c3c9248657142ef25db0aad63e1a1a2a4ec9",
1204-
"https://storage.googleapis.com/public-bazel-artifacts/c-deps/20241202-211651/libkrb5_foreign.linux.20241202-211651.tar.gz": "06a6c93b677e79169ccf7532beabdeb863d0f57bb3db41796a75dbe47ff3bceb",
1205-
"https://storage.googleapis.com/public-bazel-artifacts/c-deps/20241202-211651/libkrb5_foreign.linuxarm.20241202-211651.tar.gz": "57dcd4f9d7ffdd5a03127aa7aa2c11a061b7ab457f0c4f717c65914c1aa8cb7d",
1206-
"https://storage.googleapis.com/public-bazel-artifacts/c-deps/20241202-211651/libproj_foreign.linux.20241202-211651.tar.gz": "6347a75c1e96e37466ad9442aeafc4f3df8aa56a1afcd006935735d4b62ef3c1",
1207-
"https://storage.googleapis.com/public-bazel-artifacts/c-deps/20241202-211651/libproj_foreign.linuxarm.20241202-211651.tar.gz": "129b381500e41126e0fcd0d169df8ec0625e2e6df13d5d10ee81f45312f6af74",
1208-
"https://storage.googleapis.com/public-bazel-artifacts/c-deps/20241202-211651/libproj_foreign.macos.20241202-211651.tar.gz": "b0a672f24748c24c941884c04413fd8e20afd6bca95e0451f3cfb15dd2cc1eb9",
1209-
"https://storage.googleapis.com/public-bazel-artifacts/c-deps/20241202-211651/libproj_foreign.macosarm.20241202-211651.tar.gz": "a35706bf0112e9652d6e41501113ee0f0f392b67e495979c867f71f17cf6ce7e",
1210-
"https://storage.googleapis.com/public-bazel-artifacts/c-deps/20241202-211651/libproj_foreign.windows.20241202-211651.tar.gz": "a33b64a784e856dbb3c84a52075227c48f0ff52a858639c3737a8911201d0c65",
1195+
"https://storage.googleapis.com/public-bazel-artifacts/c-deps/20250625-221227/libgeos_foreign.linux.20250625-221227.tar.gz": "b1f66ed0dad1d05037b540e543680c4013739f87a3ecd2726425ba9b488c7561",
1196+
"https://storage.googleapis.com/public-bazel-artifacts/c-deps/20250625-221227/libgeos_foreign.linuxarm.20250625-221227.tar.gz": "2dd4d906c15029b874576c0aaa6eaee04cedc9a20fdbd22abe64440ddb473475",
1197+
"https://storage.googleapis.com/public-bazel-artifacts/c-deps/20250625-221227/libgeos_foreign.macos.20250625-221227.tar.gz": "55088072ee49c948f38f6bbf2bb38d629aec66e72e1cff7c9e5440428280ffd9",
1198+
"https://storage.googleapis.com/public-bazel-artifacts/c-deps/20250625-221227/libgeos_foreign.macosarm.20250625-221227.tar.gz": "ecd6ea979ccc6f96464e3ecf28cc6b0dd2556862791a48d1ab4851d672d0322e",
1199+
"https://storage.googleapis.com/public-bazel-artifacts/c-deps/20250625-221227/libjemalloc_foreign.linux.20250625-221227.tar.gz": "5757c2aed7b45dc68e3c72b9a4ef611a74c9d1859ba670e63d5a81a2e0ea64aa",
1200+
"https://storage.googleapis.com/public-bazel-artifacts/c-deps/20250625-221227/libjemalloc_foreign.linuxarm.20250625-221227.tar.gz": "0f48b961ad3332a066eecbe759ee879561455e694a5b38d9f5ba0fa96e25cfad",
1201+
"https://storage.googleapis.com/public-bazel-artifacts/c-deps/20250625-221227/libjemalloc_foreign.macos.20250625-221227.tar.gz": "de256942fb37a818389f9c7c11da3eed105d34fcdd1012a2ca31e41acb1916a1",
1202+
"https://storage.googleapis.com/public-bazel-artifacts/c-deps/20250625-221227/libjemalloc_foreign.macosarm.20250625-221227.tar.gz": "fcfbcf0e39bb8b150cf432e82a9c84d24135e4ebab906dbc03bda2dc9d8215f3",
1203+
"https://storage.googleapis.com/public-bazel-artifacts/c-deps/20250625-221227/libjemalloc_foreign.windows.20250625-221227.tar.gz": "bee18cc0640c8f0bd204f649e60e04066709ab6b282c6d4e63eebee7956b70ca",
1204+
"https://storage.googleapis.com/public-bazel-artifacts/c-deps/20250625-221227/libkrb5_foreign.linux.20250625-221227.tar.gz": "c171ae3c4ed091e566f1c3bacc91b025242ad22970461a87245c780934240c07",
1205+
"https://storage.googleapis.com/public-bazel-artifacts/c-deps/20250625-221227/libkrb5_foreign.linuxarm.20250625-221227.tar.gz": "36f0c4881c89dea7630c946ef258446830d29d4082bf8ba2fd75124f3f822542",
1206+
"https://storage.googleapis.com/public-bazel-artifacts/c-deps/20250625-221227/libproj_foreign.linux.20250625-221227.tar.gz": "86156882ac66841d8ede581d441f331582354e9cf6c7b62699c4669a8cda4c1b",
1207+
"https://storage.googleapis.com/public-bazel-artifacts/c-deps/20250625-221227/libproj_foreign.linuxarm.20250625-221227.tar.gz": "6a4d8ca691cafc0906e6b8c1945223f05ee25fda537131d6e8346942d8896122",
1208+
"https://storage.googleapis.com/public-bazel-artifacts/c-deps/20250625-221227/libproj_foreign.macos.20250625-221227.tar.gz": "84f0c3218994bc88fe27bd8a48180b50f3c6b26ff0ebc2c4741f111f46d2a327",
1209+
"https://storage.googleapis.com/public-bazel-artifacts/c-deps/20250625-221227/libproj_foreign.macosarm.20250625-221227.tar.gz": "7bcd450bb15c7f9e9332f0dfd0cff895ffbbd26b21d7a52d1d67e38bd5910523",
1210+
"https://storage.googleapis.com/public-bazel-artifacts/c-deps/20250625-221227/libproj_foreign.windows.20250625-221227.tar.gz": "75e66ae5995a413ba3f37a479efd5673cac4e2821070976e12541692cda2a3f9",
12111211
"https://storage.googleapis.com/public-bazel-artifacts/go/20250714-192942/go1.23.7.darwin-amd64.tar.gz": "d26ec0c7ce5975a334b1c343de8eb7aa8777fac278440cc2204b76eab867b3ef",
12121212
"https://storage.googleapis.com/public-bazel-artifacts/go/20250714-192942/go1.23.7.darwin-arm64.tar.gz": "3c1ab410d0828951cddde4959b72ef33aedbce8e3c8aa9c76cc4a094043fef43",
12131213
"https://storage.googleapis.com/public-bazel-artifacts/go/20250714-192942/go1.23.7.linux-amd64.tar.gz": "b69a06004491883f176b0ec600a7efbb3ec9450561653d8f509fc10d43176492",

c-deps/BUILD.bazel

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -193,21 +193,21 @@ cmake(
193193
}),
194194
postfix_script = "mkdir -p libgeos/lib\n" + select({
195195
"//build/toolchains:is_cross_macos": (
196-
"cp -L lib/libgeos.3.11.2.dylib $INSTALLDIR/lib/libgeos.dylib\n" +
196+
"cp -L lib/libgeos.3.12.3.dylib $INSTALLDIR/lib/libgeos.dylib\n" +
197197
"PREFIX=$($OTOOL -D $INSTALLDIR/lib/libgeos_c.dylib | tail -n1 | rev | cut -d/ -f2- | rev)\n" +
198-
"$CMAKE_INSTALL_NAME_TOOL -id @rpath/libgeos.3.11.2.dylib $INSTALLDIR/lib/libgeos.dylib\n" +
198+
"$CMAKE_INSTALL_NAME_TOOL -id @rpath/libgeos.3.12.3.dylib $INSTALLDIR/lib/libgeos.dylib\n" +
199199
"$CMAKE_INSTALL_NAME_TOOL -id @rpath/libgeos_c.1.dylib $INSTALLDIR/lib/libgeos_c.dylib\n" +
200-
"$CMAKE_INSTALL_NAME_TOOL -change $PREFIX/libgeos.3.11.2.dylib @rpath/libgeos.3.11.2.dylib $INSTALLDIR/lib/libgeos_c.dylib\n"
200+
"$CMAKE_INSTALL_NAME_TOOL -change $PREFIX/libgeos.3.12.3.dylib @rpath/libgeos.3.12.3.dylib $INSTALLDIR/lib/libgeos_c.dylib\n"
201201
),
202-
"@io_bazel_rules_go//go/platform:darwin": "cp -L lib/libgeos.3.11.2.dylib $INSTALLDIR/lib/libgeos.dylib",
202+
"@io_bazel_rules_go//go/platform:darwin": "cp -L lib/libgeos.3.12.3.dylib $INSTALLDIR/lib/libgeos.dylib",
203203
"@io_bazel_rules_go//go/platform:windows": "",
204204
"//build/toolchains:is_cross_linux": (
205-
"cp -L lib/libgeos.so.3.11.2 $INSTALLDIR/lib/libgeos.so\n" +
205+
"cp -L lib/libgeos.so.3.12.3 $INSTALLDIR/lib/libgeos.so\n" +
206206
"patchelf --set-rpath /usr/local/lib/cockroach/ $INSTALLDIR/lib/libgeos_c.so\n" +
207207
"patchelf --set-soname libgeos.so $INSTALLDIR/lib/libgeos.so\n" +
208-
"patchelf --replace-needed libgeos.so.3.11.2 libgeos.so $INSTALLDIR/lib/libgeos_c.so\n"
208+
"patchelf --replace-needed libgeos.so.3.12.3 libgeos.so $INSTALLDIR/lib/libgeos_c.so\n"
209209
),
210-
"//conditions:default": "cp -L lib/libgeos.so.3.11.2 $INSTALLDIR/lib/libgeos.so",
210+
"//conditions:default": "cp -L lib/libgeos.so.3.12.3 $INSTALLDIR/lib/libgeos.so",
211211
}),
212212
targets = ["geos_c"],
213213
visibility = ["//visibility:public"],

c-deps/REPOSITORIES.bzl

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -39,80 +39,80 @@ def c_deps():
3939
archived_cdep_repository(
4040
lib = "libgeos",
4141
config = "linux",
42-
sha256 = "ae787cc08fdf6b511859c5c67e5b834a9f6cdb57aa49d32f9226a984bbeb2af5",
42+
sha256 = "b1f66ed0dad1d05037b540e543680c4013739f87a3ecd2726425ba9b488c7561",
4343
)
4444
archived_cdep_repository(
4545
lib = "libjemalloc",
4646
config = "linux",
47-
sha256 = "21059f2c065b35fa7cd39a19f882e03dbab24480d0eb787d03dd458bbba92b4a",
47+
sha256 = "5757c2aed7b45dc68e3c72b9a4ef611a74c9d1859ba670e63d5a81a2e0ea64aa",
4848
)
4949
archived_cdep_repository(
5050
lib = "libkrb5",
5151
config = "linux",
52-
sha256 = "06a6c93b677e79169ccf7532beabdeb863d0f57bb3db41796a75dbe47ff3bceb",
52+
sha256 = "c171ae3c4ed091e566f1c3bacc91b025242ad22970461a87245c780934240c07",
5353
)
5454
archived_cdep_repository(
5555
lib = "libproj",
5656
config = "linux",
57-
sha256 = "6347a75c1e96e37466ad9442aeafc4f3df8aa56a1afcd006935735d4b62ef3c1",
57+
sha256 = "86156882ac66841d8ede581d441f331582354e9cf6c7b62699c4669a8cda4c1b",
5858
)
5959
archived_cdep_repository(
6060
lib = "libgeos",
6161
config = "linuxarm",
62-
sha256 = "edaac8486c7da5a87c3857e52223a35e3533286786c0109847de1fd142884c2a",
62+
sha256 = "2dd4d906c15029b874576c0aaa6eaee04cedc9a20fdbd22abe64440ddb473475",
6363
)
6464
archived_cdep_repository(
6565
lib = "libjemalloc",
6666
config = "linuxarm",
67-
sha256 = "745930cc073b09f5a25690e7b3a273a96dd6943402ba425ad916c9555a2a016c",
67+
sha256 = "0f48b961ad3332a066eecbe759ee879561455e694a5b38d9f5ba0fa96e25cfad",
6868
)
6969
archived_cdep_repository(
7070
lib = "libkrb5",
7171
config = "linuxarm",
72-
sha256 = "57dcd4f9d7ffdd5a03127aa7aa2c11a061b7ab457f0c4f717c65914c1aa8cb7d",
72+
sha256 = "36f0c4881c89dea7630c946ef258446830d29d4082bf8ba2fd75124f3f822542",
7373
)
7474
archived_cdep_repository(
7575
lib = "libproj",
7676
config = "linuxarm",
77-
sha256 = "129b381500e41126e0fcd0d169df8ec0625e2e6df13d5d10ee81f45312f6af74",
77+
sha256 = "6a4d8ca691cafc0906e6b8c1945223f05ee25fda537131d6e8346942d8896122",
7878
)
7979
archived_cdep_repository(
8080
lib = "libgeos",
8181
config = "macos",
82-
sha256 = "2b762d57dd877e54fee402afbdebe433bbd4ee636accf782ec44633c6f1e380b",
82+
sha256 = "55088072ee49c948f38f6bbf2bb38d629aec66e72e1cff7c9e5440428280ffd9",
8383
)
8484
archived_cdep_repository(
8585
lib = "libjemalloc",
8686
config = "macos",
87-
sha256 = "255632b4fddebd7cb4799f255251a8137256e207a402900ca7de7be496a1a238",
87+
sha256 = "de256942fb37a818389f9c7c11da3eed105d34fcdd1012a2ca31e41acb1916a1",
8888
)
8989
archived_cdep_repository(
9090
lib = "libproj",
9191
config = "macos",
92-
sha256 = "b0a672f24748c24c941884c04413fd8e20afd6bca95e0451f3cfb15dd2cc1eb9",
92+
sha256 = "84f0c3218994bc88fe27bd8a48180b50f3c6b26ff0ebc2c4741f111f46d2a327",
9393
)
9494
archived_cdep_repository(
9595
lib = "libgeos",
9696
config = "macosarm",
97-
sha256 = "401252bba664cbbd9d9329fc068b04b0cc01e390e7c7f419a6cba081c6e950c2",
97+
sha256 = "ecd6ea979ccc6f96464e3ecf28cc6b0dd2556862791a48d1ab4851d672d0322e",
9898
)
9999
archived_cdep_repository(
100100
lib = "libjemalloc",
101101
config = "macosarm",
102-
sha256 = "0a73f3f88183ce7aacb8a105077b32ff6ee77216adc776683cf64f75eb9a6513",
102+
sha256 = "fcfbcf0e39bb8b150cf432e82a9c84d24135e4ebab906dbc03bda2dc9d8215f3",
103103
)
104104
archived_cdep_repository(
105105
lib = "libproj",
106106
config = "macosarm",
107-
sha256 = "a35706bf0112e9652d6e41501113ee0f0f392b67e495979c867f71f17cf6ce7e",
107+
sha256 = "7bcd450bb15c7f9e9332f0dfd0cff895ffbbd26b21d7a52d1d67e38bd5910523",
108108
)
109109
archived_cdep_repository(
110110
lib = "libjemalloc",
111111
config = "windows",
112-
sha256 = "c13afc513257839762e423af9a52c3c9248657142ef25db0aad63e1a1a2a4ec9",
112+
sha256 = "bee18cc0640c8f0bd204f649e60e04066709ab6b282c6d4e63eebee7956b70ca",
113113
)
114114
archived_cdep_repository(
115115
lib = "libproj",
116116
config = "windows",
117-
sha256 = "a33b64a784e856dbb3c84a52075227c48f0ff52a858639c3737a8911201d0c65",
117+
sha256 = "75e66ae5995a413ba3f37a479efd5673cac4e2821070976e12541692cda2a3f9",
118118
)

c-deps/archived.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ load("@rules_cc//cc:find_cc_toolchain.bzl", "find_cc_toolchain")
44

55
# NB: URL_TMPL and LOC are used by generate-distdir. Don't change the format or
66
# name of these definitions unless you update generate-distdir accordingly.
7-
LOC = "20241202-211651"
7+
LOC = "20250625-221227"
88
URL_TMPL = "https://storage.googleapis.com/public-bazel-artifacts/c-deps/{loc}/{lib}_foreign.{config}.{loc}.tar.gz"
99

1010
# NB: When we link with the krb5 libraries, we want the linker to see them in

c-deps/geos

Submodule geos updated 759 files

pkg/geo/geomfn/geomfn_test.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
"testing"
1111

1212
"github.com/cockroachdb/cockroach/pkg/geo"
13-
"github.com/stretchr/testify/assert"
1413
"github.com/stretchr/testify/require"
1514
"github.com/twpayne/go-geom"
1615
)
@@ -143,7 +142,3 @@ func mustConvertToEWKT(g geo.Geometry) string {
143142
func requireGeomEqual(t *testing.T, expected, got geo.Geometry) {
144143
require.Equalf(t, expected, got, "expected %s, got %s", mustConvertToEWKT(expected), mustConvertToEWKT(got))
145144
}
146-
147-
func assertGeomEqual(t *testing.T, expected, got geo.Geometry) {
148-
assert.Equalf(t, expected, got, "expected %s, got %s", mustConvertToEWKT(expected), mustConvertToEWKT(got))
149-
}

pkg/geo/geomfn/linestring_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,11 @@ func TestLineMerge(t *testing.T) {
9595
{"LINESTRING EMPTY", "LINESTRING EMPTY"},
9696
{"LINESTRING (1 2, 3 4)", "LINESTRING (1 2, 3 4)"},
9797
{"POLYGON EMPTY", "POLYGON EMPTY"},
98-
{"POLYGON ((1 2, 3 4, 5 6, 1 2))", "GEOMETRYCOLLECTION EMPTY"},
98+
{"POLYGON ((1 2, 3 4, 5 6, 1 2))", "LINESTRING (1 2, 3 4, 5 6, 1 2)"},
9999
{"MULTIPOLYGON EMPTY", "MULTIPOLYGON EMPTY"},
100-
{"MULTIPOLYGON (((1 2, 3 4, 5 6, 1 2)))", "GEOMETRYCOLLECTION EMPTY"},
100+
{"MULTIPOLYGON (((1 2, 3 4, 5 6, 1 2)))", "LINESTRING (1 2, 3 4, 5 6, 1 2)"},
101101
{"GEOMETRYCOLLECTION EMPTY", "GEOMETRYCOLLECTION EMPTY"},
102-
{"GEOMETRYCOLLECTION (MULTILINESTRING ((1 2, 2 3, 3 4)))", "GEOMETRYCOLLECTION EMPTY"},
102+
{"GEOMETRYCOLLECTION (MULTILINESTRING ((1 2, 2 3, 3 4)))", "LINESTRING (1 2, 2 3, 3 4)"},
103103
}
104104

105105
for _, tc := range testCases {

pkg/geo/geomfn/mvtgeom_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ func TestAsMVTGeometry(t *testing.T) {
449449
return
450450
}
451451
require.NoError(t, err)
452-
assertGeomEqual(t, tt.want, got)
452+
requireGeomEqual(t, tt.want, got)
453453
})
454454
}
455455
}

pkg/geo/geomfn/subdivide_test.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ func TestSubdivide(t *testing.T) {
4242
"Polygon, width > height",
4343
args{geo.MustParseGeometry("POLYGON((-1 -1,-1 -0.5, -1 0, 1 0.5, 1 -1,-1 -1))"), 5},
4444
[]geo.Geometry{
45-
geo.MustParseGeometry("POLYGON ((0 -1, -1 -1, -1 -0.5, 0 -0.5, 0 -1))"),
46-
geo.MustParseGeometry("POLYGON ((-1 0, 0 0.25, 0 -0.5, -1 -0.5, -1 0))"),
45+
geo.MustParseGeometry("POLYGON ((-1 0, 0 0.25, 0 -1, -1 -1, -1 0))"),
46+
geo.MustParseGeometry("POLYGON ((1 0.5, 1 -1, 0 -1, 0 0.25, 1 0.5))"),
4747
},
4848
},
4949
{
@@ -68,8 +68,8 @@ func TestSubdivide(t *testing.T) {
6868
"Polygon, 12 decimal points precision",
6969
args{geo.MustParseGeometry("POLYGON((-0.1 -0.1,-0.1 -0.000000000005, -0.1 0, 0.1 0.000000000005, 0.1 -0.1,-0.1 -0.1))"), 5},
7070
[]geo.Geometry{
71-
geo.MustParseGeometry("POLYGON ((0 -0.1, -0.1 -0.1, -0.1 -0.000000000005, 0 -0.000000000005, 0 -0.1))"),
72-
geo.MustParseGeometry("POLYGON ((-0.1 0, 0 0.0000000000025, 0 -0.000000000005, -0.1 -0.000000000005, -0.1 0))"),
71+
geo.MustParseGeometry("POLYGON ((-0.1 0, 0 0.0000000000025, 0 -0.1, -0.1 -0.1, -0.1 0))"),
72+
geo.MustParseGeometry("POLYGON ((0.1 0.000000000005, 0.1 -0.1, 0 -0.1, 0 0.0000000000025, 0.1 0.000000000005))"),
7373
},
7474
},
7575
{
@@ -85,11 +85,11 @@ func TestSubdivide(t *testing.T) {
8585
args{geo.MustParseGeometry("POLYGON((-1 -1, -1 1, 0 2, 1 1, 1 -1, 0 -2, -1 -1),(-0.5 -0.5, -0.5 0.5, 0.5 0.5, 0.5 -0.5, 0 -0.5, -0.5 -0.5))"), 5},
8686
[]geo.Geometry{
8787
geo.MustParseGeometry("POLYGON ((0 -2, -1 -1, 1 -1, 0 -2))"),
88-
geo.MustParseGeometry("POLYGON ((-1 -1, -1 0.5, -0.5 0.5, -0.5 -1, -1 -1))"),
89-
geo.MustParseGeometry("POLYGON ((-0.5 -0.5, 1 -0.5, 1 -1, -0.5 -1, -0.5 -0.5))"),
88+
geo.MustParseGeometry("POLYGON ((-1 0.5, -0.5 0.5, -0.5 -1, -1 -1, -1 0.5))"),
89+
geo.MustParseGeometry("POLYGON ((1 -1, -0.5 -1, -0.5 -0.5, 1 -0.5, 1 -1))"),
9090
geo.MustParseGeometry("POLYGON ((0.5 0.5, 1 0.5, 1 -0.5, 0.5 -0.5, 0.5 0.5))"),
91-
geo.MustParseGeometry("POLYGON ((-1 0.5, -1 1, 0 2, 0 0.5, -1 0.5))"),
92-
geo.MustParseGeometry("POLYGON ((1 1, 1 0.5, 0 0.5, 0 2, 1 1))"),
91+
geo.MustParseGeometry("POLYGON ((-1 1, 1 1, 1 0.5, -1 0.5, -1 1))"),
92+
geo.MustParseGeometry("POLYGON ((0 2, 1 1, -1 1, 0 2))"),
9393
},
9494
},
9595
{
@@ -160,8 +160,8 @@ func TestSubdivide(t *testing.T) {
160160
[]geo.Geometry{
161161
geo.MustParseGeometry("POLYGON ((-2 -1, -2 1, 0 0, -2 -1))"),
162162
geo.MustParseGeometry("POLYGON ((2 1, 2 -1, 0 0, 2 1))"),
163-
geo.MustParseGeometry("POLYGON ((0 -1, -1 -1, -1 -0.5, 0 -0.5, 0 -1))"),
164-
geo.MustParseGeometry("POLYGON ((-1 0, 0 0.25, 0 -0.5, -1 -0.5, -1 0))"),
163+
geo.MustParseGeometry("POLYGON ((-1 0, 0 0.25, 0 -1, -1 -1, -1 0))"),
164+
geo.MustParseGeometry("POLYGON ((1 0.5, 1 -1, 0 -1, 0 0.25, 1 0.5))"),
165165
},
166166
},
167167
}
@@ -170,7 +170,7 @@ func TestSubdivide(t *testing.T) {
170170
got, err := Subdivide(tt.args.g, tt.args.maxVertices)
171171
require.NoError(t, err)
172172
for i := range tt.want {
173-
assertGeomEqual(t, tt.want[i], got[i])
173+
requireGeomEqual(t, tt.want[i], got[i])
174174
}
175175
})
176176
}
@@ -202,12 +202,12 @@ func TestSubdivide(t *testing.T) {
202202
}
203203
want := []geo.Geometry{
204204
geo.MustParseGeometry("POLYGON ((0 -2, -1 -1, 1 -1, 0 -2))"),
205-
geo.MustParseGeometry("POLYGON ((-1 -1, -1 0.5, -0.5 0.5, -0.5 -1, -1 -1))"),
206-
geo.MustParseGeometry("POLYGON ((-0.5 -1, -0.5 -0.5, 0.5 -0.5, 0.5 0.5, 1 0.5, 1 -1, -0.5 -1))"),
207-
geo.MustParseGeometry("POLYGON ((-1 0.5, -1 1, 0 2, 0 0.5, -1 0.5))"),
205+
geo.MustParseGeometry("POLYGON ((-1 -1, -1 0.5, -0.5 0.5, -0.5 -0.5, 0.5 -0.5, 0.5 0.5, 1 0.5, 1 -1, -1 -1))"),
206+
geo.MustParseGeometry("POLYGON ((-1 1, 1 1, 1 0.5, -1 0.5, -1 1))"),
207+
geo.MustParseGeometry("POLYGON ((0 2, 1 1, -1 1, 0 2))"),
208208
}
209209
for i := range want {
210-
assertGeomEqual(t, want[i], got[i])
210+
requireGeomEqual(t, want[i], got[i])
211211
}
212212
})
213213
}

0 commit comments

Comments
 (0)