Skip to content

Commit 0380e14

Browse files
committed
Tries to fix tests
1 parent dd2933e commit 0380e14

File tree

2 files changed

+9
-1
lines changed
  • x-pack/plugin/esql

2 files changed

+9
-1
lines changed

x-pack/plugin/esql/qa/testFixtures/src/main/resources/spatial.csv-spec

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3031,6 +3031,7 @@ wkt:keyword |pt:cartesian_point
30313031

30323032
stSimplifyMultiRow
30333033
required_capability: st_simplify
3034+
required_capability: spatial_points_from_source
30343035

30353036
FROM airports
30363037
| SORT name
@@ -3049,6 +3050,7 @@ Abuja Int'l | POLYGON ((-10.0 -60.0, -10.0 60.0, 120.0 60.0, 120.0
30493050

30503051
stSimplifyMultiRowWithPoints
30513052
required_capability: st_simplify
3053+
required_capability: spatial_points_from_source
30523054

30533055
FROM airports
30543056
| SORT name
@@ -3067,6 +3069,7 @@ POINT (7.27025993974356 9.00437659781094) | POINT (7.27025993974356 9.004376597
30673069

30683070
stSimplifyNoSimplification
30693071
required_capability: st_simplify
3072+
required_capability: spatial_points_from_source
30703073

30713074
ROW geo_shape = TO_GEOSHAPE("POLYGON((0 0, 1 0.1, 2 0, 2 2, 1 1.9, 0 2, 0 0))")
30723075
| EVAL result = st_simplify(geo_shape, 0.01)
@@ -3079,6 +3082,7 @@ POLYGON ((0.0 0.0, 0.0 2.0, 1.0 1.9, 2.0 2.0, 2.0 0.0, 1.0 0.1, 0.0 0.0))
30793082

30803083
stSimplifyWithSimplification
30813084
required_capability: st_simplify
3085+
required_capability: spatial_points_from_source
30823086

30833087
ROW geo_shape = TO_GEOSHAPE("POLYGON((0 0, 1 0.1, 2 0, 2 2, 1 1.9, 0 2, 0 0))")
30843088
| EVAL result = st_simplify(geo_shape, 0.2)
@@ -3091,6 +3095,7 @@ POLYGON ((0.0 0.0, 0.0 2.0, 2.0 2.0, 2.0 0.0, 0.0 0.0))
30913095

30923096
stSimplifyEmptySimplification
30933097
required_capability: st_simplify
3098+
required_capability: spatial_points_from_source
30943099

30953100
ROW geo_shape = TO_GEOSHAPE("POLYGON((0 0, 1 0.1, 2 0, 2 2, 1 1.9, 0 2, 0 0))")
30963101
| EVAL result = st_simplify(geo_shape, 2.0)
@@ -3103,6 +3108,7 @@ POLYGON EMPTY
31033108

31043109
stSimplifyNull
31053110
required_capability: st_simplify
3111+
required_capability: spatial_points_from_source
31063112

31073113
ROW geo_shape = NULL
31083114
| EVAL result = st_simplify(geo_shape, 2.0)
@@ -3115,6 +3121,7 @@ NULL
31153121

31163122
stSimplifyCartesianPoint
31173123
required_capability: st_simplify
3124+
required_capability: spatial_points_from_source
31183125

31193126
# TODO Why cannot we use a latitud outside of -90, 90 when there are tests
31203127
# that use the TO_CARTESIANPOINT that are doing it already?
@@ -3132,6 +3139,7 @@ POINT (80.93 72.77)
31323139

31333140
stSimplifyCartesianShape
31343141
required_capability: st_simplify
3142+
required_capability: spatial_points_from_source
31353143

31363144
ROW wkt = ["POINT(97.11 75.53)", "POLYGON((0 0, 1 0.1, 2 0, 2 2, 1 1.9, 0 2, 0 0))"]
31373145
| MV_EXPAND wkt

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StSimplify.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ private static class GeoSimplifier {
9797
static WKTReader reader = new WKTReader();
9898
static WKTWriter writer = new WKTWriter();
9999

100-
public static BytesRef geoSourceAndConstantTolerance(BytesRef inputGeometry, @Fixed double inputTolerance) {
100+
public static BytesRef geoSourceAndConstantTolerance(BytesRef inputGeometry, double inputTolerance) {
101101
String wkt = UNSPECIFIED.wkbToWkt(inputGeometry);
102102
try {
103103
org.locationtech.jts.geom.Geometry jtsGeometry = reader.read(wkt);

0 commit comments

Comments
 (0)