{"id":34073343,"url":"https://github.com/alges/spatialize","last_synced_at":"2026-01-17T16:29:23.599Z","repository":{"id":271616566,"uuid":"621371639","full_name":"alges/spatialize","owner":"alges","description":"Spatialize: A Python/C++ Library for Ensemble Spatial Interpolation","archived":false,"fork":false,"pushed_at":"2026-01-12T20:13:47.000Z","size":103076,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-13T01:18:45.509Z","etag":null,"topics":["ensemble-spatial-interpolation","esi","estimation","geostatistics","idw","interpolation","kriging","python"],"latest_commit_sha":null,"homepage":"https://spatialize.readthedocs.io/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alges.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-03-30T14:27:11.000Z","updated_at":"2026-01-12T20:06:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"f38afd1a-c188-4206-b62e-d4cf7374bba6","html_url":"https://github.com/alges/spatialize","commit_stats":null,"previous_names":["alges/spatialize"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/alges/spatialize","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alges%2Fspatialize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alges%2Fspatialize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alges%2Fspatialize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alges%2Fspatialize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alges","download_url":"https://codeload.github.com/alges/spatialize/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alges%2Fspatialize/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28511865,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T13:38:16.342Z","status":"ssl_error","status_checked_at":"2026-01-17T13:37:44.060Z","response_time":85,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ensemble-spatial-interpolation","esi","estimation","geostatistics","idw","interpolation","kriging","python"],"created_at":"2025-12-14T08:49:39.859Z","updated_at":"2026-01-17T16:29:23.582Z","avatar_url":"https://github.com/alges.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spatialize: A Python/C++ library for Ensemble Spatial Analysis (ESA)\nAn open source library for spatial analysis that combines the simplicity of basic methods with the power of geostatistical tools.\n\n## Overview\nSpatialize implements **Ensemble Spatial Analysis (ESA)**, which encompasses two complementary approaches: **Ensemble Spatial Interpolation (ESI)** and **Ensemble Spatial Simulation (ESS)**. These novel methods address the limitations of traditional geostatistical approaches by leveraging ensemble learning techniques.\n\nESI works by generating multiple estimates for each target location by creating different spatial partitions of the sample data and applying an interpolation algorithm within each local subset. These local estimates are then aggregated to produce robust predictions. ESS extends this framework to provide stochastic simulation capabilities.\n\nDesigned to bridge the gap between expert and non-expert users of geostatistics, Spatialize provides automated tools that eliminate the need for manual spatial analysis and extensive domain expertise.\n\n## Main features:\n- **Automated Spatial Estimation**: Minimal user intervention required\n- **Stochastic Modelling \u0026 Ensemble Learning**: Robust, scalable and suitable for large datasets\n- **Uncertainty Quantification**: Provides both point estimates and empirical posterior distributions\n- **Flexible Data Support**: Works with both gridded and non-gridded data\n- **Hyperparameter Optimization**: Built-in grid search with cross-validation\n- **High Performance**: C++ core with Python interface\n\n## Installation\nThe source code is currently hosted on GitHub at:\nhttps://github.com/alges/spatialize\n\nDirect installers for the latest released version are available at the [Python\nPackage Index (PyPI)](https://pypi.org/project/spatialize).\n\n### PyPI\n```bash\npip install spatialize\n```\n\n### System Requirements\n- Python 3.8+\n- Compatible with Linux, macOS, and Windows\n\n### Dependencies\n- [NumPy: Powerful n-dimensional arrays and numerical computing tools](https://www.numpy.org)\n- [pandas: Fast, powerful, flexible and easy to use open source data analysis and manipulation tool](https://pandas.pydata.org)\n- [Matplotlib: Visualization with Python](https://matplotlib.org/)\n- [scikit-learn: Machine Learning in Python](https://scikit-learn.org/)\n- [SciPy: Fundamental algorithms for scientific computing in Python](https://scipy.org/)\n\n## Core Concepts\n| Function | Description |\n|----------|-------------|\n| `esi_griddata()` | Spatial interpolation for points on a regular grid |\n| `esi_nongriddata()` | Spatial interpolation for scattered points |\n| `esi_hparams_search()` | Automated hyperparameter optimization with cross-validation |\n\n### Local Interpolators\n- **IDW (Inverse Distance Weighting)**: Simple yet powerful with configurable distance exponent\n- **Kriging**: Geostatistical method with multiple variogram models (spherical, exponential, cubic and gaussian)\n\n### Partition Methods\n- **Mondrian Forests**: Uses recursive, axis-aligned partitions (supports up to 5D)\n- **Voronoi Forests**: Uses Voronoi diagram-based partitions (supports up to 2D)\n\n## Quick Start\nHere are a few examples to get you started.\n\n### Basic Gridded Data Estimation\n```python\nimport numpy as np\nfrom spatialize.gs.esi import esi_griddata\n\n# Generate sample data\ndef func(x, y):\t\t# a kind of \"cubic\" function\n    return x * (1 - x) * np.cos(4 * np.pi * x) * np.sin(4 * np.pi * y ** 2) ** 2\n\npoints = np.random.random((100, 2))\nvalues = func(points[:, 0], points[:, 1])\n\n# Define the estimation grid\ngrid_x, grid_y = np.mgrid[0:1:50j, 0:1:50j]\n\n# Perform ESI estimation\nresult = esi_griddata(points, values, (grid_x, grid_y),\n\t\t      local_interpolator=\"idw\",\n\t\t      p_process=\"mondrian\",\n\t\t      n_partitions=300,\n\t\t      alpha=0.8,\n\t\t      exponent=1.0\n\t\t      )\n\n# Get results\nestimation = result.estimation()\nprecision = result.precision()\n\n# Quick visualization\nresult.quick_plot()\n```\n\n### Non-gridded Data Estimation\n```python\nfrom spatialize.gs.esi import esi_nongriddata\n\n# Define target locations\ntarget_points = np.random.random((50, 2))\n\n# Perform estimation, using Kriging as local interpolator\nresult = esi_nongriddata(points, values, target_points,\n\t\t         local_interpolator=\"kriging\",\n\t\t         model=\"spherical\",\n\t\t         nugget=0.1,\n\t\t         range=10.0,\n\t\t         sill=1.0\n\t\t         )\n```\n\n### Automated Hyperparameter Search\n```python\nfrom spatialize.gs.esi import esi_hparams_search\n\n# Search for optimal parameters\nsearch_result = esi_hparams_search(points, values, (grid_x, grid_y),\n\t\t\t           local_interpolator=\"idw\",\n\t\t\t           griddata=True,\n\t\t\t           k=10,\n\t\t\t           exponent=[1.0, 2.0, 3.0, 4.0],\n\t\t\t           alpha=[0.7, 0.8, 0.9],\n\t\t\t           n_partitions=[100, 300, 500]\n\t\t\t           )\n\n# Perform estimation using best parameters found\nbest_result = esi_griddata(points, values, (grid_x, grid_y),\n\t\t\t   local_interpolator=\"idw\",\n\t\t\t   best_params_found=search_result.best_result()\n\t\t\t   )\n\n# Visualize search results\nsearch_result.plot_cv_error()\n```\n\n## License\n[Apache-2.0](LICENSE)\n\n## Citing Spatialize\nPlease refer to the following articles when publishing work relating to this library or the ESI model:\n\n\t@article{\n\t\ttitle = {Spatial distributional estimation via ensemble spatial analysis},\n\t\tjournal = {AIMS Mathematics},\n\t\tvolume = {10},\n\t\tnumber = {11},\n\t\tpages = {26351-26388},\n\t\tyear = {2025},\n\t\tissn = {2473-6988},\n\t\tdoi = {10.3934/math.20251159},\n\t\turl = {https://www.aimspress.com/article/doi/10.3934/math.20251159},\n\t\tauthor = {Alvaro F. Ega{\\~n}a and Gonzalo D{\\'i}az and Felipe Navarro and Mohammad Maleki and Juan F. S{\\'a}nchez-P{\\'e}rez},\n\t\tkeywords = {geostatistics, computational geostatistics, generative geostatistics, non-linear geostatistics, distributional geostatistics, geostatistical simulation, empirical copula, data-driven methods},\n\t\t}\n\n\t@article{spatialize2025,\n\t\tauthor  = {Navarro, Felipe and Ega{\\~n}a, {\\'A}lvaro F. and Ehrenfeld, Alejandro and Garrido, Felipe and Valenzuela, Mar{\\'i}a Jes{\\'u}s and S{\\'a}nchez-P{\\'e}rez, Juan F. },\n\t\ttitle   = {Spatialize v1.0: A Python/C++ Library for Ensemble Spatial Interpolation},\n\t\tjournal = {},\n\t\tyear    = {2025},\n\t\tvolume  = {},\n\t\tnumber  = {},\n\t\tpages   = {},\n\t\tdoi     = {https://doi.org/10.48550/arXiv.2507.17867},\n\t\turl     = {https://arxiv.org/abs/2507.17867},\n\t\tissn    = {}\n\t\t}\n\n\t@article{AdaptiveESI2025,\n\t\tauthor  = {Ega{\\~n}a, {\\'A}lvaro F. and Valenzuela, María Jesús and Maleki, Mohammad and S{\\'a}nchez-P{\\'e}rez, Juan F. and Díaz, Gonzalo},\n\t\ttitle   = {Adaptive ensemble spatial analysis},\n\t\tjournal = {Scientific Reports},\n\t\tyear    = {2025},\n\t\tvolume  = {15},\n\t\tnumber  = {1},\n\t\tpages   = {26599},\n\t\tdoi     = {10.1038/s41598-025-08844-z},\n\t\turl     = {https://doi.org/10.1038/s41598-025-08844-z},\n\t\tissn    = {2045-2322}\n\t\t}\n\n\t@article{ESI2021,\n\t\tauthor  = {Ega{\\~n}a, {\\'A}lvaro F. and Navarro, Felipe and Maleki, Mohammad and Grand{\\'o}n, Francisca and Carter, Francisco and Soto, Fabi{\\'a}n},\n\t\ttitle   = {Ensemble Spatial Interpolation: A New Approach to Natural or Anthropogenic Variable Assessment},\n\t\tjournal = {Natural Resources Research},\n\t\tvolume  = {30},\n\t\tnumber  = {5},\n\t\tpages   = {3777--3793},\n\t\tyear    = {2021},\n\t\tdoi     = {https://doi.org/10.1007/s11053-021-09860-2},\n\t\turl     = {https://link.springer.com/article/10.1007/s11053-021-09860-2}\n\t\t}\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falges%2Fspatialize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falges%2Fspatialize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falges%2Fspatialize/lists"}