Skip to content

Actually merge with v1.2.1 stable branch #538

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 44 commits into from
Apr 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
cae7f48
Update year in license file to 2025
szarnyasg Jan 4, 2025
6b3d93c
update workflow, pin duckdb
Maxxen Feb 21, 2025
9f1689d
fix broken st_force
Maxxen Feb 24, 2025
b425f04
Merge pull request #504 from Maxxen/fix-stforce
Maxxen Feb 24, 2025
40cd439
fix spatial join optimizer types
Maxxen Feb 25, 2025
76dc6da
Merge pull request #505 from Maxxen/fix-spatial-join-types
Maxxen Feb 25, 2025
6dd8f9a
fix rtree index scan when filter is completely pruned out
Maxxen Feb 28, 2025
7a266e8
Merge pull request #509 from Maxxen/fix-rtree-index-prune
Maxxen Feb 28, 2025
bf3329c
fix forcing vertex layout for nested geometries, fix st_asgeojson
Maxxen Mar 4, 2025
9ebb79f
Merge pull request #512 from Maxxen/v1.2.0-dev
Maxxen Mar 4, 2025
c9f3e2f
make sgl::geometry non-copyable/moveable
Maxxen Mar 4, 2025
00aa7de
Merge pull request #513 from Maxxen/v1.2.0-dev
Maxxen Mar 4, 2025
17dbaed
replace filter projection map after filter pullup
Maxxen Mar 5, 2025
2905968
Merge pull request #515 from Maxxen/v1.2.0-dev
Maxxen Mar 5, 2025
685d95f
slap lock around proj initialization
Maxxen Mar 5, 2025
3fc509f
Add example from docs
szarnyasg Mar 7, 2025
3288760
Fix ST_DWithin_Spheroid function registration to match implementation
patrick-orennia Mar 12, 2025
aee6402
Fix typos
szarnyasg Mar 31, 2025
3ed8db2
Merge branch 'v1.2.0' into v1.2.0-dev
Maxxen Apr 2, 2025
6a7fb92
add ST_MaximumInscribedCircle, ST_Node, ST_BuildArea
Maxxen Apr 2, 2025
a86053a
add st_polygonize, adjust st_maximuminscribedcircle
Maxxen Apr 2, 2025
53c6ed8
add helper macros to st_affine
Maxxen Apr 2, 2025
38b424a
format
Maxxen Apr 2, 2025
7465e69
fix visiting nested polygons by surface
Maxxen Apr 2, 2025
9be8381
Merge remote-tracking branch 'patrick-orennia/fix-520' into v1.2.0-dev
Maxxen Apr 2, 2025
b4e9c4d
add st_coverage array agg functions
Maxxen Apr 2, 2025
b271b62
add aggregate coverage functions
Maxxen Apr 2, 2025
dc95ea5
fix aggregates
Maxxen Apr 2, 2025
8d320ee
Add vcpkg-cmake vcpkg-port
carlopi Apr 3, 2025
44716e3
Actually require cmake 3.20
carlopi Apr 3, 2025
edc9423
move expat port into subdir
Maxxen Apr 3, 2025
cd3be89
patch proj ccache module minimum version
Maxxen Apr 3, 2025
007102d
failed cherry-pick, set version
Maxxen Apr 3, 2025
3bb37f8
Merge pull request #532 from Maxxen/v1.2.0-dev
Maxxen Apr 3, 2025
9b6a58c
bump to v1.2.1
Maxxen Apr 3, 2025
34a69ff
Merge remote-tracking branch 'szarnyasg/bump-license-to-2025' into v1…
Maxxen Apr 3, 2025
9281e7e
Merge remote-tracking branch 'szarnyasg/docs-iss4794' into v1.2.1-dev
Maxxen Apr 3, 2025
27d01d3
Merge remote-tracking branch 'upstream/typos' into v1.2.1-dev
Maxxen Apr 3, 2025
99cedb2
reorder funcs
Maxxen Apr 3, 2025
fd5fd30
Merge pull request #535 from Maxxen/v1.2.1-dev
Maxxen Apr 3, 2025
db2f46f
update docs
Maxxen Apr 4, 2025
173b746
Merge pull request #536 from Maxxen/v1.2.1-dev
Maxxen Apr 4, 2025
c842ae7
merge with v1.2.1
Maxxen Apr 4, 2025
5756025
fix test
Maxxen Apr 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .github/workflows/StableDistributionPipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ name: Stable Extension Distribution Pipeline
on:
pull_request:
branches:
- v1.1.3
- v1.2.1
paths-ignore:
- '**/README.md'
- 'doc/**'
push:
branches:
- v1.1.3
- v1.2.1
paths-ignore:
- '**/README.md'
- 'doc/**'
Expand All @@ -24,23 +24,23 @@ concurrency:
jobs:
duckdb-stable-build:
name: Build extension binaries
uses: duckdb/extension-ci-tools/.github/workflows/_extension_distribution.yml@v1.1.3
uses: duckdb/extension-ci-tools/.github/workflows/_extension_distribution.yml@v1.2.1
with:
duckdb_version: v1.1.3
duckdb_version: v1.2.1
extension_name: spatial
ci_tools_version: v1.1.3
ci_tools_version: v1.2.1
vcpkg_commit: 5e5d0e1cd7785623065e77eff011afdeec1a3574
exclude_archs: linux_amd64_musl


duckdb-stable-deploy:
name: Deploy extension binaries
needs: duckdb-stable-build
uses: duckdb/extension-ci-tools/.github/workflows/_extension_deploy.yml@v1.1.3
uses: duckdb/extension-ci-tools/.github/workflows/_extension_deploy.yml@v1.2.1
secrets: inherit
with:
duckdb_version: v1.1.3
ci_tools_version: v1.1.3
duckdb_version: v1.2.1
ci_tools_version: v1.2.1
extension_name: spatial
deploy_latest: ${{ startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/v1.1.3' }}
deploy_latest: ${{ startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/v1.2.1' }}
exclude_archs: linux_amd64_musl
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0 +0,0 @@
cmake_minimum_required(VERSION 3.2)
Expand Up @@ -2,3 +1,4 @@
cmake_minimum_required(VERSION 3.5)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

# Set extension name here
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2018-2024 Stichting DuckDB Foundation
Copyright 2018-2025 Stichting DuckDB Foundation

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
PROJ_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))

# Configuration of extension
EXT_NAME=excel
EXT_NAME=spatial
EXT_CONFIG=${PROJ_DIR}extension_config.cmake

CORE_EXTENSIONS='httpfs'

# Include the Makefile from extension-ci-tools
include extension-ci-tools/makefiles/duckdb_extension.Makefile

Expand Down
11 changes: 11 additions & 0 deletions deps/patches/proj.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/cmake/Ccache.cmake
+++ b/cmake/Ccache.cmake
@@ -7,7 +7,7 @@
# Add "include(Ccache)" to CMakeLists.txt and enable
# using the option -D USE_CCACHE=ON

-cmake_minimum_required(VERSION 3.4)
+cmake_minimum_required(VERSION 3.5)


option(USE_CCACHE
11 changes: 11 additions & 0 deletions deps/patches/proj_wasm.patch
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,14 @@

# If unsuitable, append the reason to the package version so that it's
# visible to the user.
--- a/cmake/Ccache.cmake
+++ b/cmake/Ccache.cmake
@@ -7,7 +7,7 @@
# Add "include(Ccache)" to CMakeLists.txt and enable
# using the option -D USE_CCACHE=ON

-cmake_minimum_required(VERSION 3.4)
+cmake_minimum_required(VERSION 3.5)


option(USE_CCACHE
1,267 changes: 836 additions & 431 deletions docs/functions.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion duckdb
Submodule duckdb updated 1483 files
80 changes: 41 additions & 39 deletions src/sgl/sgl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,22 @@ bool interpolate(const sgl::geometry *geom, double frac, vertex_xyzm *out) {
return false;
}

sgl::geometry interpolate_points(sgl::allocator *alloc, const sgl::geometry *geom, double frac) {
void interpolate_points(sgl::geometry *result, sgl::allocator *alloc, const sgl::geometry *geom, double frac) {

SGL_ASSERT(geom);
if(geom->get_type() != sgl::geometry_type::LINESTRING) {
return point::make_empty(geom->has_z(), geom->has_m());
point::init_empty(result, geom->has_z(), geom->has_m());
return;
}
if(geom->is_empty()) {
return point::make_empty(geom->has_z(), geom->has_m());
point::init_empty(result, geom->has_z(), geom->has_m());
return;
}

if(geom->get_count() == 1) {
auto point = point::make_empty(geom->has_z(), geom->has_m());
point.set_vertex_data(geom->get_vertex_data(), 1);
return point;
point::init_empty(result, geom->has_z(), geom->has_m());
result->set_vertex_data(geom->get_vertex_data(), 1);
return;
}

// Clamp the fraction to [0, 1]
Expand All @@ -100,17 +102,20 @@ sgl::geometry interpolate_points(sgl::allocator *alloc, const sgl::geometry *geo

// Special cases
if(frac == 0) {
auto point = point::make_empty(geom->has_z(), geom->has_m());
point.set_vertex_data(vertex_data, 1);
point::init_empty(result, geom->has_z(), geom->has_m());
result->set_vertex_data(vertex_data, 1);
return;
}

if(frac == 1) {
auto point = point::make_empty(geom->has_z(), geom->has_m());
point.set_vertex_data(vertex_data + (vertex_count - 1) * vertex_stride, 1);
point::init_empty(result, geom->has_z(), geom->has_m());
result->set_vertex_data(vertex_data + (vertex_count - 1) * vertex_stride, 1);
return;
}


auto mpoint = multi_point::make_empty(geom->has_z(), geom->has_m());
// Make a multi-point
multi_point::init_empty(result, geom->has_z(), geom->has_m());

const auto actual_length = linestring::length(geom);
double total_length = 0.0;
Expand Down Expand Up @@ -151,32 +156,31 @@ sgl::geometry interpolate_points(sgl::allocator *alloc, const sgl::geometry *geo

// Set the vertex data and append it to the multi-point
point_ptr->set_vertex_data(data_mem, 1);
mpoint.append_part(point_ptr);
result->append_part(point_ptr);

// Update the target length
next_target += frac * actual_length;
}
total_length += segment_length;
prev = next;
}

return mpoint;
}

sgl::geometry substring(sgl::allocator *alloc, const sgl::geometry *geom, double beg_frac, double end_frac) {
auto line = linestring::make_empty(geom->has_z(), geom->has_m());
void substring(sgl::geometry *line, sgl::allocator *alloc, const sgl::geometry *geom, double beg_frac, double end_frac) {
linestring::init_empty(line, geom->has_z(), geom->has_m());

if(geom->get_type() != sgl::geometry_type::LINESTRING) {
return line;
return;
}
if(geom->is_empty()) {
if(beg_frac == end_frac) {
line.set_type(geometry_type::POINT);
line->set_type(geometry_type::POINT);
}
return line;
return;
}

if(beg_frac > end_frac) {
return line;
return;
}

beg_frac = std::min(std::max(beg_frac, 0.0), 1.0);
Expand All @@ -188,24 +192,24 @@ sgl::geometry substring(sgl::allocator *alloc, const sgl::geometry *geom, double

// Reference the whole line
if(beg_frac == 0 && end_frac == 1) {
line.set_vertex_data(vertex_data, vertex_count);
return line;
line->set_vertex_data(vertex_data, vertex_count);
return;
}

if(beg_frac == end_frac) {
// Just interpolate once
vertex_xyzm point = {};

// Make it a point instead!
line.set_type(geometry_type::POINT);
line->set_type(geometry_type::POINT);

if(interpolate(geom, beg_frac, &point)) {
const auto mem = static_cast<char *>(alloc->alloc(vertex_size));
memcpy(mem, &point, vertex_size);
line.set_vertex_data(mem, 1);
line->set_vertex_data(mem, 1);
}

return line;
return;
}

vertex_xyzm beg = {};
Expand Down Expand Up @@ -281,8 +285,7 @@ sgl::geometry substring(sgl::allocator *alloc, const sgl::geometry *geom, double
// Copy the end point
memcpy(new_vertex_data + (new_vertex_count - 1) * vertex_size, &end, vertex_size);

line.set_vertex_data(new_vertex_data, new_vertex_count);
return line;
line->set_vertex_data(new_vertex_data, new_vertex_count);
}


Expand Down Expand Up @@ -545,6 +548,8 @@ void force_zm(allocator &alloc, geometry *geom, bool set_z, bool set_m, double d
part->set_m(set_m);
if (!part->is_empty()) {
part = part->get_first_part();
// Continue to the next iteration in the outer loop
continue;
}
} break;
default:
Expand Down Expand Up @@ -1827,22 +1832,19 @@ static void handle_polygons(void *state, sgl::geometry *geom) {
}
}

geometry extract_points(sgl::geometry *geom) {
auto points = sgl::geometry(sgl::geometry_type::MULTI_POINT, geom->has_z(), geom->has_m());
geom->filter_parts(&points, select_points, handle_points);
return points;
void extract_points(sgl::geometry *result, sgl::geometry *geom) {
multi_point::init_empty(result, geom->has_z(), geom->has_m());
geom->filter_parts(result, select_points, handle_points);
}

geometry extract_linestrings(sgl::geometry *geom) {
auto lines = sgl::geometry(sgl::geometry_type::MULTI_LINESTRING, geom->has_z(), geom->has_m());
geom->filter_parts(&lines, select_lines, handle_lines);
return lines;
void extract_linestrings(sgl::geometry *result, sgl::geometry *geom) {
multi_linestring::init_empty(result, geom->has_z(), geom->has_m());
geom->filter_parts(result, select_lines, handle_lines);
}

geometry extract_polygons(sgl::geometry *geom) {
auto polygons = sgl::geometry(sgl::geometry_type::MULTI_POLYGON, geom->has_z(), geom->has_m());
geom->filter_parts(&polygons, select_polygons, handle_polygons);
return polygons;
void extract_polygons(sgl::geometry *result, sgl::geometry *geom) {
multi_polygon::init_empty(result, geom->has_z(), geom->has_m());
geom->filter_parts(result, select_polygons, handle_polygons);
}


Expand Down
Loading
Loading