gdalcubes 0.1.0.dev0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. gdalcubes-0.1.0.dev0/.github/workflows/test.yml +37 -0
  2. gdalcubes-0.1.0.dev0/.github/workflows/wheels.yml +176 -0
  3. gdalcubes-0.1.0.dev0/.gitignore +222 -0
  4. gdalcubes-0.1.0.dev0/CMakeLists.txt +125 -0
  5. gdalcubes-0.1.0.dev0/LICENSE +21 -0
  6. gdalcubes-0.1.0.dev0/PKG-INFO +388 -0
  7. gdalcubes-0.1.0.dev0/README.md +332 -0
  8. gdalcubes-0.1.0.dev0/examples/local-files.py +132 -0
  9. gdalcubes-0.1.0.dev0/examples/regularize-l8.py +123 -0
  10. gdalcubes-0.1.0.dev0/examples/regularize-s2.py +113 -0
  11. gdalcubes-0.1.0.dev0/examples/stac-mpc.py +91 -0
  12. gdalcubes-0.1.0.dev0/gdalcubes/__init__.py +234 -0
  13. gdalcubes-0.1.0.dev0/gdalcubes/chunks.py +371 -0
  14. gdalcubes-0.1.0.dev0/gdalcubes/collection.py +177 -0
  15. gdalcubes-0.1.0.dev0/gdalcubes/config.py +174 -0
  16. gdalcubes-0.1.0.dev0/gdalcubes/cube.py +1270 -0
  17. gdalcubes-0.1.0.dev0/gdalcubes/dataset.py +747 -0
  18. gdalcubes-0.1.0.dev0/gdalcubes/formats/CHIRPS_v2_0_daily_p05_tif.json +18 -0
  19. gdalcubes-0.1.0.dev0/gdalcubes/formats/CHIRPS_v2_0_monthly_p05_tif.json +18 -0
  20. gdalcubes-0.1.0.dev0/gdalcubes/formats/L8_L1TP.json +61 -0
  21. gdalcubes-0.1.0.dev0/gdalcubes/formats/L8_SR.json +80 -0
  22. gdalcubes-0.1.0.dev0/gdalcubes/formats/MCD64A1.json +34 -0
  23. gdalcubes-0.1.0.dev0/gdalcubes/formats/MxD10A2.json +23 -0
  24. gdalcubes-0.1.0.dev0/gdalcubes/formats/MxD11A1.json +37 -0
  25. gdalcubes-0.1.0.dev0/gdalcubes/formats/MxD11A2.json +45 -0
  26. gdalcubes-0.1.0.dev0/gdalcubes/formats/MxD13A2.json +43 -0
  27. gdalcubes-0.1.0.dev0/gdalcubes/formats/MxD13A3.json +43 -0
  28. gdalcubes-0.1.0.dev0/gdalcubes/formats/MxD13Q1.json +53 -0
  29. gdalcubes-0.1.0.dev0/gdalcubes/formats/MxD14A2.json +22 -0
  30. gdalcubes-0.1.0.dev0/gdalcubes/formats/PlanetScope_3B_AnalyticMS_SR.json +37 -0
  31. gdalcubes-0.1.0.dev0/gdalcubes/formats/Sentinel1_IW_GRD.json +23 -0
  32. gdalcubes-0.1.0.dev0/gdalcubes/formats/Sentinel2_L1C.json +80 -0
  33. gdalcubes-0.1.0.dev0/gdalcubes/formats/Sentinel2_L1C_AWS.json +81 -0
  34. gdalcubes-0.1.0.dev0/gdalcubes/formats/Sentinel2_L2A.json +83 -0
  35. gdalcubes-0.1.0.dev0/gdalcubes/formats/Sentinel2_L2A_THEIA.json +60 -0
  36. gdalcubes-0.1.0.dev0/gdalcubes/stac/__init__.py +39 -0
  37. gdalcubes-0.1.0.dev0/gdalcubes/stac/adapter.py +232 -0
  38. gdalcubes-0.1.0.dev0/gdalcubes/stac/collection.py +575 -0
  39. gdalcubes-0.1.0.dev0/gdalcubes/stac/registry.py +87 -0
  40. gdalcubes-0.1.0.dev0/gdalcubes/stac/sources/__init__.py +21 -0
  41. gdalcubes-0.1.0.dev0/gdalcubes/stac/sources/default.py +30 -0
  42. gdalcubes-0.1.0.dev0/gdalcubes/stac/sources/earth_search.py +16 -0
  43. gdalcubes-0.1.0.dev0/gdalcubes/stac/sources/planetary_computer.py +52 -0
  44. gdalcubes-0.1.0.dev0/gdalcubes/storage.py +212 -0
  45. gdalcubes-0.1.0.dev0/gdalcubes/view.py +156 -0
  46. gdalcubes-0.1.0.dev0/pyproject.toml +81 -0
  47. gdalcubes-0.1.0.dev0/src/bindings/.clang-format +24 -0
  48. gdalcubes-0.1.0.dev0/src/bindings/bindings.cpp +139 -0
  49. gdalcubes-0.1.0.dev0/src/bindings/bindings.h +33 -0
  50. gdalcubes-0.1.0.dev0/src/bindings/conversions.cpp +237 -0
  51. gdalcubes-0.1.0.dev0/src/bindings/conversions.h +45 -0
  52. gdalcubes-0.1.0.dev0/src/bindings/progress.cpp +96 -0
  53. gdalcubes-0.1.0.dev0/src/bindings/progress.h +26 -0
  54. gdalcubes-0.1.0.dev0/src/bindings/register_chunks.cpp +142 -0
  55. gdalcubes-0.1.0.dev0/src/bindings/register_collections.cpp +132 -0
  56. gdalcubes-0.1.0.dev0/src/bindings/register_config.cpp +98 -0
  57. gdalcubes-0.1.0.dev0/src/bindings/register_cubes.cpp +187 -0
  58. gdalcubes-0.1.0.dev0/src/bindings/register_export.cpp +230 -0
  59. gdalcubes-0.1.0.dev0/src/bindings/register_operations.cpp +264 -0
  60. gdalcubes-0.1.0.dev0/src/bindings/register_view.cpp +31 -0
  61. gdalcubes-0.1.0.dev0/src/gdalcubes/aggregate_space.cpp +472 -0
  62. gdalcubes-0.1.0.dev0/src/gdalcubes/aggregate_space.h +144 -0
  63. gdalcubes-0.1.0.dev0/src/gdalcubes/aggregate_time.cpp +431 -0
  64. gdalcubes-0.1.0.dev0/src/gdalcubes/aggregate_time.h +187 -0
  65. gdalcubes-0.1.0.dev0/src/gdalcubes/apply_pixel.cpp +211 -0
  66. gdalcubes-0.1.0.dev0/src/gdalcubes/apply_pixel.h +174 -0
  67. gdalcubes-0.1.0.dev0/src/gdalcubes/build_info.h +15 -0
  68. gdalcubes-0.1.0.dev0/src/gdalcubes/build_info.h.in +15 -0
  69. gdalcubes-0.1.0.dev0/src/gdalcubes/collection_format.cpp +85 -0
  70. gdalcubes-0.1.0.dev0/src/gdalcubes/collection_format.h +78 -0
  71. gdalcubes-0.1.0.dev0/src/gdalcubes/config.cpp +213 -0
  72. gdalcubes-0.1.0.dev0/src/gdalcubes/config.h +222 -0
  73. gdalcubes-0.1.0.dev0/src/gdalcubes/coord_types.h +147 -0
  74. gdalcubes-0.1.0.dev0/src/gdalcubes/crop.cpp +120 -0
  75. gdalcubes-0.1.0.dev0/src/gdalcubes/crop.h +287 -0
  76. gdalcubes-0.1.0.dev0/src/gdalcubes/cube.cpp +1928 -0
  77. gdalcubes-0.1.0.dev0/src/gdalcubes/cube.h +735 -0
  78. gdalcubes-0.1.0.dev0/src/gdalcubes/cube_factory.cpp +448 -0
  79. gdalcubes-0.1.0.dev0/src/gdalcubes/cube_factory.h +90 -0
  80. gdalcubes-0.1.0.dev0/src/gdalcubes/datetime.cpp +368 -0
  81. gdalcubes-0.1.0.dev0/src/gdalcubes/datetime.h +415 -0
  82. gdalcubes-0.1.0.dev0/src/gdalcubes/dummy.cpp +63 -0
  83. gdalcubes-0.1.0.dev0/src/gdalcubes/dummy.h +151 -0
  84. gdalcubes-0.1.0.dev0/src/gdalcubes/error.cpp +118 -0
  85. gdalcubes-0.1.0.dev0/src/gdalcubes/error.h +134 -0
  86. gdalcubes-0.1.0.dev0/src/gdalcubes/external/date.h +7080 -0
  87. gdalcubes-0.1.0.dev0/src/gdalcubes/external/json11/CMakeLists.txt +58 -0
  88. gdalcubes-0.1.0.dev0/src/gdalcubes/external/json11/LICENSE.txt +19 -0
  89. gdalcubes-0.1.0.dev0/src/gdalcubes/external/json11/Makefile +15 -0
  90. gdalcubes-0.1.0.dev0/src/gdalcubes/external/json11/README.md +45 -0
  91. gdalcubes-0.1.0.dev0/src/gdalcubes/external/json11/json11.cpp +791 -0
  92. gdalcubes-0.1.0.dev0/src/gdalcubes/external/json11/json11.hpp +232 -0
  93. gdalcubes-0.1.0.dev0/src/gdalcubes/external/json11/json11.pc.in +9 -0
  94. gdalcubes-0.1.0.dev0/src/gdalcubes/external/json11/test.cpp +286 -0
  95. gdalcubes-0.1.0.dev0/src/gdalcubes/external/tiny-process-library/CMakeLists.txt +66 -0
  96. gdalcubes-0.1.0.dev0/src/gdalcubes/external/tiny-process-library/LICENSE +22 -0
  97. gdalcubes-0.1.0.dev0/src/gdalcubes/external/tiny-process-library/examples.cpp +234 -0
  98. gdalcubes-0.1.0.dev0/src/gdalcubes/external/tiny-process-library/process.cpp +55 -0
  99. gdalcubes-0.1.0.dev0/src/gdalcubes/external/tiny-process-library/process.hpp +169 -0
  100. gdalcubes-0.1.0.dev0/src/gdalcubes/external/tiny-process-library/process_unix.cpp +386 -0
  101. gdalcubes-0.1.0.dev0/src/gdalcubes/external/tiny-process-library/process_win.cpp +350 -0
  102. gdalcubes-0.1.0.dev0/src/gdalcubes/external/tinyexpr/tinyexpr.c +939 -0
  103. gdalcubes-0.1.0.dev0/src/gdalcubes/external/tinyexpr/tinyexpr.h +94 -0
  104. gdalcubes-0.1.0.dev0/src/gdalcubes/extract_geom.cpp +522 -0
  105. gdalcubes-0.1.0.dev0/src/gdalcubes/extract_geom.h +99 -0
  106. gdalcubes-0.1.0.dev0/src/gdalcubes/filesystem.cpp +201 -0
  107. gdalcubes-0.1.0.dev0/src/gdalcubes/filesystem.h +71 -0
  108. gdalcubes-0.1.0.dev0/src/gdalcubes/fill_time.cpp +229 -0
  109. gdalcubes-0.1.0.dev0/src/gdalcubes/fill_time.h +71 -0
  110. gdalcubes-0.1.0.dev0/src/gdalcubes/filter_geom.cpp +308 -0
  111. gdalcubes-0.1.0.dev0/src/gdalcubes/filter_geom.h +85 -0
  112. gdalcubes-0.1.0.dev0/src/gdalcubes/filter_pixel.cpp +141 -0
  113. gdalcubes-0.1.0.dev0/src/gdalcubes/filter_pixel.h +104 -0
  114. gdalcubes-0.1.0.dev0/src/gdalcubes/gdalcubes.h +68 -0
  115. gdalcubes-0.1.0.dev0/src/gdalcubes/image_collection.cpp +1800 -0
  116. gdalcubes-0.1.0.dev0/src/gdalcubes/image_collection.h +329 -0
  117. gdalcubes-0.1.0.dev0/src/gdalcubes/image_collection_cube.cpp +804 -0
  118. gdalcubes-0.1.0.dev0/src/gdalcubes/image_collection_cube.h +328 -0
  119. gdalcubes-0.1.0.dev0/src/gdalcubes/image_collection_ops.cpp +248 -0
  120. gdalcubes-0.1.0.dev0/src/gdalcubes/image_collection_ops.h +39 -0
  121. gdalcubes-0.1.0.dev0/src/gdalcubes/join_bands.cpp +80 -0
  122. gdalcubes-0.1.0.dev0/src/gdalcubes/join_bands.h +172 -0
  123. gdalcubes-0.1.0.dev0/src/gdalcubes/license/LICENSE +21 -0
  124. gdalcubes-0.1.0.dev0/src/gdalcubes/license/LICENSE_THIRDPARTY +344 -0
  125. gdalcubes-0.1.0.dev0/src/gdalcubes/ncdf_cube.cpp +548 -0
  126. gdalcubes-0.1.0.dev0/src/gdalcubes/ncdf_cube.h +119 -0
  127. gdalcubes-0.1.0.dev0/src/gdalcubes/progress.cpp +100 -0
  128. gdalcubes-0.1.0.dev0/src/gdalcubes/progress.h +90 -0
  129. gdalcubes-0.1.0.dev0/src/gdalcubes/progress_virt.h +76 -0
  130. gdalcubes-0.1.0.dev0/src/gdalcubes/reduce_space.cpp +443 -0
  131. gdalcubes-0.1.0.dev0/src/gdalcubes/reduce_space.h +154 -0
  132. gdalcubes-0.1.0.dev0/src/gdalcubes/reduce_time.cpp +628 -0
  133. gdalcubes-0.1.0.dev0/src/gdalcubes/reduce_time.h +162 -0
  134. gdalcubes-0.1.0.dev0/src/gdalcubes/rename_bands.cpp +34 -0
  135. gdalcubes-0.1.0.dev0/src/gdalcubes/rename_bands.h +100 -0
  136. gdalcubes-0.1.0.dev0/src/gdalcubes/select_bands.cpp +67 -0
  137. gdalcubes-0.1.0.dev0/src/gdalcubes/select_bands.h +154 -0
  138. gdalcubes-0.1.0.dev0/src/gdalcubes/select_time.cpp +72 -0
  139. gdalcubes-0.1.0.dev0/src/gdalcubes/select_time.h +120 -0
  140. gdalcubes-0.1.0.dev0/src/gdalcubes/simple_cube.cpp +372 -0
  141. gdalcubes-0.1.0.dev0/src/gdalcubes/simple_cube.h +162 -0
  142. gdalcubes-0.1.0.dev0/src/gdalcubes/slice_space.cpp +40 -0
  143. gdalcubes-0.1.0.dev0/src/gdalcubes/slice_space.h +169 -0
  144. gdalcubes-0.1.0.dev0/src/gdalcubes/slice_time.cpp +39 -0
  145. gdalcubes-0.1.0.dev0/src/gdalcubes/slice_time.h +139 -0
  146. gdalcubes-0.1.0.dev0/src/gdalcubes/stream.cpp +160 -0
  147. gdalcubes-0.1.0.dev0/src/gdalcubes/stream.h +158 -0
  148. gdalcubes-0.1.0.dev0/src/gdalcubes/stream_apply_pixel.cpp +158 -0
  149. gdalcubes-0.1.0.dev0/src/gdalcubes/stream_apply_pixel.h +102 -0
  150. gdalcubes-0.1.0.dev0/src/gdalcubes/stream_apply_time.cpp +199 -0
  151. gdalcubes-0.1.0.dev0/src/gdalcubes/stream_apply_time.h +106 -0
  152. gdalcubes-0.1.0.dev0/src/gdalcubes/stream_reduce_space.cpp +200 -0
  153. gdalcubes-0.1.0.dev0/src/gdalcubes/stream_reduce_space.h +102 -0
  154. gdalcubes-0.1.0.dev0/src/gdalcubes/stream_reduce_time.cpp +197 -0
  155. gdalcubes-0.1.0.dev0/src/gdalcubes/stream_reduce_time.h +103 -0
  156. gdalcubes-0.1.0.dev0/src/gdalcubes/timer.h +66 -0
  157. gdalcubes-0.1.0.dev0/src/gdalcubes/utils.cpp +184 -0
  158. gdalcubes-0.1.0.dev0/src/gdalcubes/utils.h +118 -0
  159. gdalcubes-0.1.0.dev0/src/gdalcubes/view.cpp +686 -0
  160. gdalcubes-0.1.0.dev0/src/gdalcubes/view.h +414 -0
  161. gdalcubes-0.1.0.dev0/src/gdalcubes/warp.cpp +700 -0
  162. gdalcubes-0.1.0.dev0/src/gdalcubes/warp.h +156 -0
  163. gdalcubes-0.1.0.dev0/src/gdalcubes/window_space.cpp +721 -0
  164. gdalcubes-0.1.0.dev0/src/gdalcubes/window_space.h +223 -0
  165. gdalcubes-0.1.0.dev0/src/gdalcubes/window_time.cpp +258 -0
  166. gdalcubes-0.1.0.dev0/src/gdalcubes/window_time.h +160 -0
  167. gdalcubes-0.1.0.dev0/tests/test_chunks.py +260 -0
  168. gdalcubes-0.1.0.dev0/tests/test_dataset.py +460 -0
  169. gdalcubes-0.1.0.dev0/tests/test_expression.py +113 -0
  170. gdalcubes-0.1.0.dev0/tests/test_extract.py +199 -0
  171. gdalcubes-0.1.0.dev0/tests/test_smoke.py +320 -0
  172. gdalcubes-0.1.0.dev0/tests/test_stac.py +431 -0
  173. gdalcubes-0.1.0.dev0/tests/test_threads.py +110 -0
  174. gdalcubes-0.1.0.dev0/tools/patches/README.md +39 -0
  175. gdalcubes-0.1.0.dev0/tools/patches/tinyexpr-precedence-and-allocation.patch +189 -0
  176. gdalcubes-0.1.0.dev0/tools/patches/warp-failure.patch +57 -0
  177. gdalcubes-0.1.0.dev0/tools/sync_core.sh +41 -0
  178. gdalcubes-0.1.0.dev0/tools/wasm/README.md +23 -0
  179. gdalcubes-0.1.0.dev0/tools/wasm/build.sh +199 -0
  180. gdalcubes-0.1.0.dev0/uv.lock +2080 -0
  181. gdalcubes-0.1.0.dev0/vcpkg.json +16 -0
@@ -0,0 +1,37 @@
1
+ name: tests
2
+
3
+ on:
4
+ push:
5
+ branches: [main, master]
6
+ pull_request:
7
+
8
+ jobs:
9
+ test:
10
+ name: ${{ matrix.os }}
11
+ runs-on: ${{ matrix.os }}
12
+ strategy:
13
+ fail-fast: false
14
+ matrix:
15
+ os: [ubuntu-latest, macos-latest]
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Install native dependencies (Linux)
20
+ if: runner.os == 'Linux'
21
+ run: |
22
+ sudo apt-get update
23
+ sudo apt-get install -y libgdal-dev libnetcdf-dev libsqlite3-dev libcurl4-openssl-dev
24
+
25
+ - name: Install native dependencies (macOS)
26
+ if: runner.os == 'macOS'
27
+ run: brew install gdal netcdf
28
+
29
+ - uses: actions/setup-python@v5
30
+ with:
31
+ python-version: "3.12"
32
+
33
+ - name: Build and install
34
+ run: pip install -v .[test,xarray,tif,stac]
35
+
36
+ - name: Run tests
37
+ run: pytest -v
@@ -0,0 +1,176 @@
1
+ # Binary wheels with the full GDAL stack vendored (no system dependencies for
2
+ # users), following the pyogrio/rasterio approach: native libraries come from
3
+ # vcpkg (see vcpkg.json), wheels are repaired with auditwheel / delocate /
4
+ # delvewheel to bundle the shared libraries, and GDAL/PROJ data files are
5
+ # installed into the package (see GDALCUBES_*_DATA in CMakeLists.txt).
6
+ #
7
+ # NOTE: this workflow is the heavy part of the project and is expected to need
8
+ # iteration in CI (GDAL feature flags, library search paths per platform).
9
+
10
+ name: wheels
11
+
12
+ on:
13
+ push:
14
+ tags: ["v*"]
15
+ workflow_dispatch:
16
+
17
+ env:
18
+ VCPKG_COMMIT: "1de2026f28ead93ff1773e6e680387643e914ea1" # pin; update deliberately
19
+
20
+ jobs:
21
+ build_wheels:
22
+ name: ${{ matrix.os }}-${{ matrix.arch }}
23
+ runs-on: ${{ matrix.os }}
24
+ strategy:
25
+ fail-fast: false
26
+ matrix:
27
+ include:
28
+ - os: ubuntu-latest
29
+ arch: x86_64
30
+ triplet: x64-linux-dynamic
31
+ - os: ubuntu-24.04-arm
32
+ arch: aarch64
33
+ triplet: arm64-linux-dynamic
34
+ - os: macos-13
35
+ arch: x86_64
36
+ triplet: x64-osx-dynamic
37
+ - os: macos-14
38
+ arch: arm64
39
+ triplet: arm64-osx-dynamic
40
+ - os: windows-latest
41
+ arch: AMD64
42
+ triplet: x64-windows
43
+
44
+ steps:
45
+ - uses: actions/checkout@v4
46
+
47
+ - name: Cache vcpkg
48
+ uses: actions/cache@v4
49
+ with:
50
+ path: |
51
+ vcpkg
52
+ vcpkg_installed
53
+ key: vcpkg-${{ env.VCPKG_COMMIT }}-${{ matrix.os }}-${{ matrix.triplet }}-${{ hashFiles('vcpkg.json') }}
54
+
55
+ - name: Bootstrap vcpkg and install dependencies (macOS / Windows)
56
+ if: runner.os != 'Linux'
57
+ shell: bash
58
+ run: |
59
+ if [ ! -d vcpkg ]; then
60
+ git clone https://github.com/microsoft/vcpkg.git
61
+ git -C vcpkg checkout ${{ env.VCPKG_COMMIT }}
62
+ ./vcpkg/bootstrap-vcpkg.sh -disableMetrics
63
+ fi
64
+ ./vcpkg/vcpkg install --triplet ${{ matrix.triplet }}
65
+
66
+ - name: Build wheels
67
+ uses: pypa/cibuildwheel@v2
68
+ env:
69
+ CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-*"
70
+ CIBW_ARCHS: ${{ matrix.arch }}
71
+ CIBW_SKIP: "*-musllinux*"
72
+
73
+ # Linux builds run inside the manylinux container: bootstrap vcpkg there
74
+ CIBW_BEFORE_ALL_LINUX: >
75
+ yum install -y curl zip unzip tar perl-IPC-Cmd flex bison &&
76
+ git clone https://github.com/microsoft/vcpkg.git /opt/vcpkg &&
77
+ git -C /opt/vcpkg checkout ${{ env.VCPKG_COMMIT }} &&
78
+ /opt/vcpkg/bootstrap-vcpkg.sh -disableMetrics &&
79
+ VCPKG_FORCE_SYSTEM_BINARIES=1 /opt/vcpkg/vcpkg install
80
+ --x-manifest-root=/project --triplet ${{ matrix.triplet }}
81
+ --x-install-root=/project/vcpkg_installed
82
+
83
+ CIBW_ENVIRONMENT_LINUX: >
84
+ VCPKG_ROOT=/opt/vcpkg
85
+ VCPKG_PREFIX=/project/vcpkg_installed/${{ matrix.triplet }}
86
+ CMAKE_PREFIX_PATH=/project/vcpkg_installed/${{ matrix.triplet }}
87
+ LD_LIBRARY_PATH=/project/vcpkg_installed/${{ matrix.triplet }}/lib
88
+ CIBW_ENVIRONMENT_MACOS: >
89
+ VCPKG_PREFIX=$PWD/vcpkg_installed/${{ matrix.triplet }}
90
+ CMAKE_PREFIX_PATH=$PWD/vcpkg_installed/${{ matrix.triplet }}
91
+ DYLD_LIBRARY_PATH=$PWD/vcpkg_installed/${{ matrix.triplet }}/lib
92
+ MACOSX_DEPLOYMENT_TARGET=${{ matrix.os == 'macos-14' && '14.0' || '13.0' }}
93
+ CIBW_ENVIRONMENT_WINDOWS: >
94
+ VCPKG_PREFIX=$GITHUB_WORKSPACE/vcpkg_installed/${{ matrix.triplet }}
95
+ CMAKE_PREFIX_PATH=$GITHUB_WORKSPACE/vcpkg_installed/${{ matrix.triplet }}
96
+
97
+ CIBW_CONFIG_SETTINGS: >
98
+ cmake.define.GDALCUBES_GDAL_DATA=${VCPKG_PREFIX}/share/gdal
99
+ cmake.define.GDALCUBES_PROJ_DATA=${VCPKG_PREFIX}/share/proj
100
+
101
+ # bundle shared libraries into the wheel
102
+ CIBW_REPAIR_WHEEL_COMMAND_LINUX: >
103
+ LD_LIBRARY_PATH=/project/vcpkg_installed/${{ matrix.triplet }}/lib
104
+ auditwheel repair -w {dest_dir} {wheel}
105
+ CIBW_REPAIR_WHEEL_COMMAND_MACOS: >
106
+ DYLD_LIBRARY_PATH=$PWD/vcpkg_installed/${{ matrix.triplet }}/lib
107
+ delocate-wheel --require-archs {delocate_archs} -w {dest_dir} {wheel}
108
+ CIBW_BEFORE_BUILD_WINDOWS: pip install delvewheel
109
+ CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: >
110
+ delvewheel repair
111
+ --add-path %VCPKG_PREFIX%\bin
112
+ -w {dest_dir} {wheel}
113
+
114
+ CIBW_TEST_REQUIRES: pytest numpy
115
+ CIBW_TEST_COMMAND: pytest {project}/tests -v
116
+
117
+ - uses: actions/upload-artifact@v4
118
+ with:
119
+ name: wheels-${{ matrix.os }}-${{ matrix.arch }}
120
+ path: wheelhouse/*.whl
121
+
122
+ # WebAssembly wheel for Pyodide (see tools/wasm/README.md)
123
+ build_pyodide:
124
+ name: pyodide
125
+ runs-on: ubuntu-latest
126
+ env:
127
+ PYODIDE_VERSION: "314.0.7"
128
+ steps:
129
+ - uses: actions/checkout@v4
130
+
131
+ # the Pyodide build tools must run on the Python the release targets
132
+ - uses: actions/setup-python@v5
133
+ with:
134
+ python-version: "3.14"
135
+
136
+ # cmake and ninja from PyPI, so the job does not depend on the runner image
137
+ - name: Prepare native dependencies
138
+ run: |
139
+ pip install pyodide-cli pyodide-build cmake ninja
140
+ tools/wasm/build.sh --deps-only
141
+
142
+ - name: Build wheel
143
+ uses: pypa/cibuildwheel@v4.3.1
144
+ env:
145
+ CIBW_PLATFORM: pyodide
146
+ CIBW_BUILD: "cp314-*"
147
+ CIBW_PYODIDE_VERSION: ${{ env.PYODIDE_VERSION }}
148
+
149
+ # global data in the bundled libraries is only reachable when exported
150
+ CIBW_ENVIRONMENT_PYODIDE: PYODIDE_BUILD_EXPORTS=requested
151
+
152
+ # bundle libgdal, libproj and libgeos into the wheel
153
+ CIBW_REPAIR_WHEEL_COMMAND_PYODIDE: >
154
+ pyodide auditwheel repair {wheel}
155
+ --libdir {project}/build/wasm/deps/lib
156
+ --output-dir {dest_dir}
157
+
158
+ # the test data is DEFLATE-compressed, which Pyodide GDAL cannot
159
+ # decode, so only the tests on synthetic cubes run here
160
+ CIBW_TEST_REQUIRES: pytest numpy
161
+ CIBW_TEST_COMMAND: python -m pytest {project}/tests/test_chunks.py -k "not unreadable"
162
+
163
+ - uses: actions/upload-artifact@v4
164
+ with:
165
+ name: wheels-pyodide
166
+ path: wheelhouse/*.whl
167
+
168
+ build_sdist:
169
+ runs-on: ubuntu-latest
170
+ steps:
171
+ - uses: actions/checkout@v4
172
+ - run: pipx run build --sdist
173
+ - uses: actions/upload-artifact@v4
174
+ with:
175
+ name: sdist
176
+ path: dist/*.tar.gz
@@ -0,0 +1,222 @@
1
+ ### C++ ###
2
+ # Prerequisites
3
+ *.d
4
+
5
+ # Compiled Object files
6
+ *.slo
7
+ *.lo
8
+ *.o
9
+ *.obj
10
+
11
+ # Precompiled Headers
12
+ *.gch
13
+ *.pch
14
+
15
+ # Compiled Dynamic libraries
16
+ *.so
17
+ *.dylib
18
+ *.dll
19
+
20
+ # Fortran module files
21
+ *.mod
22
+ *.smod
23
+
24
+ # Compiled Static libraries
25
+ *.lai
26
+ *.la
27
+ *.a
28
+ *.lib
29
+
30
+ # Executables
31
+ *.exe
32
+ *.out
33
+ *.app
34
+
35
+ ### Python ###
36
+ # Byte-compiled / optimized / DLL files
37
+ __pycache__/
38
+ *.py[cod]
39
+ *$py.class
40
+
41
+ # C extensions
42
+
43
+ # Distribution / packaging
44
+ .Python
45
+ build/
46
+ develop-eggs/
47
+ dist/
48
+ downloads/
49
+ eggs/
50
+ .eggs/
51
+ lib/
52
+ lib64/
53
+ parts/
54
+ sdist/
55
+ var/
56
+ wheels/
57
+ share/python-wheels/
58
+ *.egg-info/
59
+ .installed.cfg
60
+ *.egg
61
+ MANIFEST
62
+
63
+ # PyInstaller
64
+ # Usually these files are written by a python script from a template
65
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
66
+ *.manifest
67
+ *.spec
68
+
69
+ # Installer logs
70
+ pip-log.txt
71
+ pip-delete-this-directory.txt
72
+
73
+ # Unit test / coverage reports
74
+ htmlcov/
75
+ .tox/
76
+ .nox/
77
+ .coverage
78
+ .coverage.*
79
+ .cache
80
+ nosetests.xml
81
+ coverage.xml
82
+ *.cover
83
+ *.py,cover
84
+ .hypothesis/
85
+ .pytest_cache/
86
+ cover/
87
+
88
+ # Translations
89
+ *.mo
90
+ *.pot
91
+
92
+ # Django stuff:
93
+ *.log
94
+ local_settings.py
95
+ db.sqlite3
96
+ db.sqlite3-journal
97
+
98
+ # Flask stuff:
99
+ instance/
100
+ .webassets-cache
101
+
102
+ # Scrapy stuff:
103
+ .scrapy
104
+
105
+ # Sphinx documentation
106
+ docs/_build/
107
+
108
+ # PyBuilder
109
+ .pybuilder/
110
+ target/
111
+
112
+ # Jupyter Notebook
113
+ .ipynb_checkpoints
114
+
115
+ # IPython
116
+ profile_default/
117
+ ipython_config.py
118
+
119
+ # pyenv
120
+ # For a library or package, you might want to ignore these files since the code is
121
+ # intended to run in multiple environments; otherwise, check them in:
122
+ # .python-version
123
+
124
+ # pipenv
125
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
126
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
127
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
128
+ # install all needed dependencies.
129
+ #Pipfile.lock
130
+
131
+ # poetry
132
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
133
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
134
+ # commonly ignored for libraries.
135
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
136
+ #poetry.lock
137
+
138
+ # pdm
139
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
140
+ #pdm.lock
141
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
142
+ # in version control.
143
+ # https://pdm.fming.dev/#use-with-ide
144
+ .pdm.toml
145
+
146
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
147
+ __pypackages__/
148
+
149
+ # Celery stuff
150
+ celerybeat-schedule
151
+ celerybeat.pid
152
+
153
+ # SageMath parsed files
154
+ *.sage.py
155
+
156
+ # Environments
157
+ .env
158
+ .venv
159
+ env/
160
+ venv/
161
+ ENV/
162
+ env.bak/
163
+ venv.bak/
164
+
165
+ # Spyder project settings
166
+ .spyderproject
167
+ .spyproject
168
+
169
+ # Rope project settings
170
+ .ropeproject
171
+
172
+ # mkdocs documentation
173
+ /site
174
+
175
+ # mypy
176
+ .mypy_cache/
177
+ .dmypy.json
178
+ dmypy.json
179
+
180
+ # Pyre type checker
181
+ .pyre/
182
+
183
+ # pytype static type analyzer
184
+ .pytype/
185
+
186
+ # Cython debug symbols
187
+ cython_debug/
188
+
189
+ # PyCharm
190
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
191
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
192
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
193
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
194
+ #.idea/
195
+
196
+ ### Python Patch ###
197
+ # Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
198
+ poetry.toml
199
+
200
+ # ruff
201
+ .ruff_cache/
202
+
203
+ # LSP config files
204
+ pyrightconfig.json
205
+
206
+ # Extras
207
+ wheelhouse/
208
+ compile_commands.json
209
+ .DS_Store
210
+ _resources/
211
+
212
+ # Outputs produced by the example scripts in examples/
213
+ L8_Amazon.zip
214
+ L8_Amazon/
215
+ L8.db
216
+ ndvi.nc
217
+ ndvi_tifs/
218
+ rgb_median.nc
219
+ rgb_composite.png
220
+ s2_ndvi.nc
221
+ s2_regularized/
222
+ l8_regularized/
@@ -0,0 +1,125 @@
1
+ cmake_minimum_required(VERSION 3.18)
2
+ project(gdalcubes_py LANGUAGES CXX C)
3
+
4
+ set(CMAKE_CXX_STANDARD 17)
5
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
6
+ if(NOT CMAKE_BUILD_TYPE)
7
+ set(CMAKE_BUILD_TYPE Release)
8
+ endif()
9
+
10
+ find_package(Python 3.10 COMPONENTS Interpreter Development.Module REQUIRED)
11
+
12
+ execute_process(
13
+ COMMAND "${Python_EXECUTABLE}" -m nanobind --cmake_dir
14
+ OUTPUT_STRIP_TRAILING_WHITESPACE
15
+ OUTPUT_VARIABLE nanobind_ROOT
16
+ )
17
+ find_package(nanobind CONFIG REQUIRED)
18
+
19
+ # native dependencies (same set as the core's own build) ---
20
+ if(EMSCRIPTEN)
21
+ # Pyodide: GDAL is the libgdal shared library Pyodide ships, with headers
22
+ # generated from the same GDAL release. SQLite comes from libgdal, curl is a stub
23
+ # (the browser has no sockets), and netcdf is a static classic-format build
24
+ set(WASM_DEPS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/build/wasm/deps"
25
+ CACHE PATH "include/, lib/ and share/ prepared by tools/wasm/build.sh")
26
+
27
+ if(NOT EXISTS "${WASM_DEPS_DIR}/lib/libgdal.so")
28
+ message(FATAL_ERROR "no dependencies in ${WASM_DEPS_DIR}: run tools/wasm/build.sh --deps-only")
29
+ endif()
30
+
31
+ # the GDAL and PROJ data the script prepared go into the wheel by default
32
+ set(GDALCUBES_GDAL_DATA "${WASM_DEPS_DIR}/share/gdal" CACHE PATH "GDAL data directory to bundle into the wheel")
33
+ set(GDALCUBES_PROJ_DATA "${WASM_DEPS_DIR}/share/proj" CACHE PATH "PROJ data directory to bundle into the wheel")
34
+ add_library(wasm_deps INTERFACE)
35
+
36
+ # Boost.Regex is header-only, and standalone mode needs no other Boost
37
+ # netcdf is classic-only here (no HDF5), so the core writes classic files
38
+ target_compile_definitions(wasm_deps INTERFACE BOOST_REGEX_STANDALONE USE_NCDF4=0)
39
+ target_include_directories(wasm_deps INTERFACE
40
+ ${WASM_DEPS_DIR}/include
41
+ ${WASM_DEPS_DIR}/include/gdal
42
+ )
43
+ target_link_libraries(wasm_deps INTERFACE
44
+ ${WASM_DEPS_DIR}/lib/libgdal.so
45
+ ${WASM_DEPS_DIR}/lib/libnetcdf.a
46
+ )
47
+
48
+ set(NETCDF_INCLUDE_DIR ${WASM_DEPS_DIR}/include)
49
+
50
+ else()
51
+ find_package(GDAL REQUIRED)
52
+ find_package(CURL REQUIRED)
53
+ find_package(SQLite3 REQUIRED)
54
+
55
+ find_path(NETCDF_INCLUDE_DIR "netcdf.h" HINTS $ENV{NETCDF_INCLUDEDIR})
56
+ find_library(NETCDF_LIBRARY netcdf HINTS $ENV{NETCDF_LIBDIR})
57
+ if(NOT NETCDF_INCLUDE_DIR OR NOT NETCDF_LIBRARY)
58
+ message(FATAL_ERROR "netcdf C library not found (set NETCDF_INCLUDEDIR / NETCDF_LIBDIR)")
59
+ endif()
60
+ endif()
61
+
62
+ # vendored gdalcubes core
63
+ set(CORE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/gdalcubes)
64
+ file(GLOB CORE_SOURCES ${CORE_DIR}/*.cpp)
65
+
66
+ list(APPEND CORE_SOURCES
67
+ ${CORE_DIR}/external/tinyexpr/tinyexpr.c
68
+ ${CORE_DIR}/external/json11/json11.cpp
69
+ ${CORE_DIR}/external/tiny-process-library/process.cpp
70
+ )
71
+
72
+ if(WIN32)
73
+ list(APPEND CORE_SOURCES ${CORE_DIR}/external/tiny-process-library/process_win.cpp)
74
+ else()
75
+ list(APPEND CORE_SOURCES ${CORE_DIR}/external/tiny-process-library/process_unix.cpp)
76
+ endif()
77
+
78
+ # the binding layer is split by concern into several translation units
79
+ file(GLOB BINDING_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/bindings/*.cpp)
80
+ nanobind_add_module(_core ${BINDING_SOURCES} ${CORE_SOURCES})
81
+
82
+ target_compile_definitions(_core PRIVATE GDALCUBES_NO_SWARM)
83
+
84
+ # The vendored core uses std::shared_ptr in some headers (e.g. progress_virt.h)
85
+ # without including <memory>. libc++ (macOS) pulls it in transitively, but
86
+ # libstdc++ (Linux/GCC) does not, so those translation units fail to compile.
87
+ # Force-include <memory> for every C++ unit (not the C sources like tinyexpr.c,
88
+ # where <memory> does not exist) instead of patching the vendored sources, which
89
+ # tools/sync_core.sh would overwrite on the next re-vendor.
90
+ if(MSVC)
91
+ target_compile_options(_core PRIVATE $<$<COMPILE_LANGUAGE:CXX>:/FImemory>)
92
+ else()
93
+ target_compile_options(_core PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:SHELL:-include memory>")
94
+ endif()
95
+
96
+ target_include_directories(_core PRIVATE
97
+ ${CMAKE_CURRENT_SOURCE_DIR}/src
98
+ ${NETCDF_INCLUDE_DIR}
99
+ )
100
+
101
+ if(EMSCRIPTEN)
102
+ # SQLite is not compiled in: libgdal and libproj each export one, and the
103
+ # loader binds symbols across modules, so a second copy here gets mixed with
104
+ # theirs. The core uses the copy they export.
105
+ target_link_libraries(_core PRIVATE wasm_deps)
106
+ else()
107
+ target_link_libraries(
108
+ _core PRIVATE GDAL::GDAL CURL::libcurl SQLite::SQLite3 ${NETCDF_LIBRARY}
109
+ )
110
+ endif()
111
+
112
+ install(TARGETS _core LIBRARY DESTINATION gdalcubes)
113
+
114
+ # wheel builds bundle the GDAL/PROJ runtime data files into the package.
115
+ # gdalcubes/__init__.py points GDAL_DATA / PROJ_DATA at them when present
116
+ set(GDALCUBES_GDAL_DATA "" CACHE PATH "GDAL data directory to bundle into the wheel")
117
+ set(GDALCUBES_PROJ_DATA "" CACHE PATH "PROJ data directory to bundle into the wheel")
118
+
119
+ if(GDALCUBES_GDAL_DATA)
120
+ install(DIRECTORY ${GDALCUBES_GDAL_DATA}/ DESTINATION gdalcubes/gdal_data)
121
+ endif()
122
+
123
+ if(GDALCUBES_PROJ_DATA)
124
+ install(DIRECTORY ${GDALCUBES_PROJ_DATA}/ DESTINATION gdalcubes/proj_data)
125
+ endif()
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Felipe Carlos
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.