Skip to content

Commit 28db804

Browse files
committed
fix st_intersectsextent/st_intersects_extent confusion and format
1 parent b5a017e commit 28db804

File tree

4 files changed

+32
-22
lines changed

4 files changed

+32
-22
lines changed

src/spatial/index/rtree/rtree_index_plan_scan.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ class RTreeIndexScanOptimizer : public OptimizerExtension {
218218

219219
unordered_set<string> spatial_predicates = {
220220
"ST_Equals", "ST_Intersects", "ST_Touches", "ST_Crosses", "ST_Within", "ST_Contains",
221-
"ST_Overlaps", "ST_Covers", "ST_CoveredBy", "ST_ContainsProperly", "&&", "ST_IntersectsExtent"};
221+
"ST_Overlaps", "ST_Covers", "ST_CoveredBy", "ST_ContainsProperly", "&&", "ST_Intersects_Extent"};
222222

223223
table_info.BindIndexes(context, RTreeIndex::TYPE_NAME);
224224

src/spatial/modules/main/spatial_functions_scalar.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6481,10 +6481,10 @@ struct ST_Intersects {
64816481
};
64826482

64836483
//======================================================================================================================
6484-
// ST_IntersectsExtent
6484+
// ST_Intersects_Extent
64856485
//======================================================================================================================
64866486

6487-
struct ST_IntersectsExtent {
6487+
struct ST_Intersects_Extent {
64886488

64896489
//------------------------------------------------------------------------------------------------------------------
64906490
// GEOMETRY
@@ -9527,7 +9527,7 @@ void RegisterSpatialScalarFunctions(ExtensionLoader &loader) {
95279527
ST_InteriorRingN::Register(loader);
95289528
ST_InterpolatePoint::Register(loader);
95299529
ST_Intersects::Register(loader);
9530-
ST_IntersectsExtent::Register(loader);
9530+
ST_Intersects_Extent::Register(loader);
95319531
ST_IsClosed::Register(loader);
95329532
ST_IsEmpty::Register(loader);
95339533
ST_Length::Register(loader);

src/spatial/modules/proj/proj_module.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ struct ST_Transform {
223223
}
224224

225225
static void Serialize(Serializer &serializer, const optional_ptr<FunctionData> bind_data_p,
226-
const ScalarFunction &function) {
226+
const ScalarFunction &function) {
227227
auto &bind_data = bind_data_p->Cast<TypedBindData>();
228228
serializer.WritePropertyWithDefault(100, "normalize", bind_data.normalize);
229229
serializer.WritePropertyWithDefault(101, "source", bind_data.source_crs);
@@ -325,7 +325,6 @@ struct ST_Transform {
325325
return std::move(result);
326326
}
327327

328-
329328
//------------------------------------------------------------------------------------------------------------------
330329
// Local State
331330
//------------------------------------------------------------------------------------------------------------------

src/spatial/operators/spatial_join_optimizer.cpp

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,37 @@ namespace duckdb {
1616

1717
// All of these imply bounding box intersection
1818
static const case_insensitive_set_t spatial_predicate_map = {
19-
"&&", "ST_IntersectsExtent", "ST_Equals", "ST_Intersects", "ST_Touches",
20-
"ST_Crosses", "ST_Within", "ST_Contains", "ST_Overlaps", "ST_Covers",
21-
"ST_CoveredBy", "ST_ContainsProperly", "ST_WithinProperly", "ST_DWithin",
19+
"&&",
20+
"ST_Intersects_Extent",
21+
"ST_Equals",
22+
"ST_Intersects",
23+
"ST_Touches",
24+
"ST_Crosses",
25+
"ST_Within",
26+
"ST_Contains",
27+
"ST_Overlaps",
28+
"ST_Covers",
29+
"ST_CoveredBy",
30+
"ST_ContainsProperly",
31+
"ST_WithinProperly",
32+
"ST_DWithin",
2233
};
2334

2435
static const case_insensitive_map_t<string> spatial_predicate_inverse_map = {
2536
{"ST_Equals", "ST_Equals"},
26-
{"&&", "&&"}, // Symmetric
27-
{"ST_IntersectsExtent", "ST_IntersectsExtent"}, // Symmetric
28-
{"ST_Intersects", "ST_Intersects"}, // Symmetric
29-
{"ST_Touches", "ST_Touches"}, // Symmetric
30-
{"ST_Crosses", "ST_Crosses"}, // Symmetric
31-
{"ST_Within", "ST_Contains"}, // Inverse
32-
{"ST_Contains", "ST_Within"}, // Inverse
33-
{"ST_Overlaps", "ST_Overlaps"}, // Symmetric
34-
{"ST_Covers", "ST_CoveredBy"}, // Inverse
35-
{"ST_CoveredBy", "ST_Covers"}, // Inverse
36-
{"ST_WithinProperly", "ST_ContainsProperly"}, // Inverse
37-
{"ST_ContainsProperly", "ST_WithinProperly"}, // Inverse
38-
{"ST_DWithin", "ST_DWithin"}, // Symmetric (when distance is constant)
37+
{"&&", "&&"}, // Symmetric
38+
{"ST_Intersects_Extent", "ST_Intersects_Extent"}, // Symmetric
39+
{"ST_Intersects", "ST_Intersects"}, // Symmetric
40+
{"ST_Touches", "ST_Touches"}, // Symmetric
41+
{"ST_Crosses", "ST_Crosses"}, // Symmetric
42+
{"ST_Within", "ST_Contains"}, // Inverse
43+
{"ST_Contains", "ST_Within"}, // Inverse
44+
{"ST_Overlaps", "ST_Overlaps"}, // Symmetric
45+
{"ST_Covers", "ST_CoveredBy"}, // Inverse
46+
{"ST_CoveredBy", "ST_Covers"}, // Inverse
47+
{"ST_WithinProperly", "ST_ContainsProperly"}, // Inverse
48+
{"ST_ContainsProperly", "ST_WithinProperly"}, // Inverse
49+
{"ST_DWithin", "ST_DWithin"}, // Symmetric (when distance is constant)
3950
};
4051

4152
static bool HasInversePredicate(const string &func_name) {

0 commit comments

Comments
 (0)