geoai-py 0.21.0__tar.gz → 0.23.0__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 (84) hide show
  1. {geoai_py-0.21.0 → geoai_py-0.23.0}/.gitignore +2 -0
  2. {geoai_py-0.21.0 → geoai_py-0.23.0}/PKG-INFO +5 -2
  3. {geoai_py-0.21.0 → geoai_py-0.23.0}/README.md +2 -1
  4. {geoai_py-0.21.0 → geoai_py-0.23.0}/geoai/__init__.py +1 -1
  5. {geoai_py-0.21.0 → geoai_py-0.23.0}/geoai/utils.py +67 -0
  6. {geoai_py-0.21.0 → geoai_py-0.23.0}/geoai_py.egg-info/PKG-INFO +5 -2
  7. {geoai_py-0.21.0 → geoai_py-0.23.0}/geoai_py.egg-info/SOURCES.txt +1 -0
  8. {geoai_py-0.21.0 → geoai_py-0.23.0}/geoai_py.egg-info/requires.txt +2 -0
  9. {geoai_py-0.21.0 → geoai_py-0.23.0}/mkdocs.yml +2 -0
  10. {geoai_py-0.21.0 → geoai_py-0.23.0}/pyproject.toml +3 -3
  11. geoai_py-0.23.0/qgis_plugin/README.md +483 -0
  12. {geoai_py-0.21.0 → geoai_py-0.23.0}/qgis_plugin/geoai_plugin/dialogs/__init__.py +2 -0
  13. {geoai_py-0.21.0 → geoai_py-0.23.0}/qgis_plugin/geoai_plugin/dialogs/samgeo.py +462 -72
  14. {geoai_py-0.21.0 → geoai_py-0.23.0}/qgis_plugin/geoai_plugin/dialogs/segmentation.py +133 -11
  15. geoai_py-0.23.0/qgis_plugin/geoai_plugin/dialogs/update_checker.py +495 -0
  16. {geoai_py-0.21.0 → geoai_py-0.23.0}/qgis_plugin/geoai_plugin/geoai_plugin.py +55 -2
  17. {geoai_py-0.21.0 → geoai_py-0.23.0}/qgis_plugin/geoai_plugin/metadata.txt +8 -2
  18. {geoai_py-0.21.0 → geoai_py-0.23.0}/requirements.txt +1 -0
  19. geoai_py-0.21.0/qgis_plugin/README.md +0 -256
  20. {geoai_py-0.21.0 → geoai_py-0.23.0}/.dockerignore +0 -0
  21. {geoai_py-0.21.0 → geoai_py-0.23.0}/.editorconfig +0 -0
  22. {geoai_py-0.21.0 → geoai_py-0.23.0}/.pre-commit-config.yaml +0 -0
  23. {geoai_py-0.21.0 → geoai_py-0.23.0}/CITATION.cff +0 -0
  24. {geoai_py-0.21.0 → geoai_py-0.23.0}/Dockerfile +0 -0
  25. {geoai_py-0.21.0 → geoai_py-0.23.0}/LICENSE +0 -0
  26. {geoai_py-0.21.0 → geoai_py-0.23.0}/MANIFEST.in +0 -0
  27. {geoai_py-0.21.0 → geoai_py-0.23.0}/geoai/agents/__init__.py +0 -0
  28. {geoai_py-0.21.0 → geoai_py-0.23.0}/geoai/agents/catalog_models.py +0 -0
  29. {geoai_py-0.21.0 → geoai_py-0.23.0}/geoai/agents/catalog_tools.py +0 -0
  30. {geoai_py-0.21.0 → geoai_py-0.23.0}/geoai/agents/geo_agents.py +0 -0
  31. {geoai_py-0.21.0 → geoai_py-0.23.0}/geoai/agents/map_tools.py +0 -0
  32. {geoai_py-0.21.0 → geoai_py-0.23.0}/geoai/agents/stac_models.py +0 -0
  33. {geoai_py-0.21.0 → geoai_py-0.23.0}/geoai/agents/stac_tools.py +0 -0
  34. {geoai_py-0.21.0 → geoai_py-0.23.0}/geoai/auto.py +0 -0
  35. {geoai_py-0.21.0 → geoai_py-0.23.0}/geoai/change_detection.py +0 -0
  36. {geoai_py-0.21.0 → geoai_py-0.23.0}/geoai/classify.py +0 -0
  37. {geoai_py-0.21.0 → geoai_py-0.23.0}/geoai/detectron2.py +0 -0
  38. {geoai_py-0.21.0 → geoai_py-0.23.0}/geoai/dinov3.py +0 -0
  39. {geoai_py-0.21.0 → geoai_py-0.23.0}/geoai/download.py +0 -0
  40. {geoai_py-0.21.0 → geoai_py-0.23.0}/geoai/extract.py +0 -0
  41. {geoai_py-0.21.0 → geoai_py-0.23.0}/geoai/geoai.py +0 -0
  42. {geoai_py-0.21.0 → geoai_py-0.23.0}/geoai/hf.py +0 -0
  43. {geoai_py-0.21.0 → geoai_py-0.23.0}/geoai/landcover_train.py +0 -0
  44. {geoai_py-0.21.0 → geoai_py-0.23.0}/geoai/landcover_utils.py +0 -0
  45. {geoai_py-0.21.0 → geoai_py-0.23.0}/geoai/map_widgets.py +0 -0
  46. {geoai_py-0.21.0 → geoai_py-0.23.0}/geoai/moondream.py +0 -0
  47. {geoai_py-0.21.0 → geoai_py-0.23.0}/geoai/sam.py +0 -0
  48. {geoai_py-0.21.0 → geoai_py-0.23.0}/geoai/segment.py +0 -0
  49. {geoai_py-0.21.0 → geoai_py-0.23.0}/geoai/segmentation.py +0 -0
  50. {geoai_py-0.21.0 → geoai_py-0.23.0}/geoai/timm_segment.py +0 -0
  51. {geoai_py-0.21.0 → geoai_py-0.23.0}/geoai/timm_train.py +0 -0
  52. {geoai_py-0.21.0 → geoai_py-0.23.0}/geoai/tools/__init__.py +0 -0
  53. {geoai_py-0.21.0 → geoai_py-0.23.0}/geoai/tools/cloudmask.py +0 -0
  54. {geoai_py-0.21.0 → geoai_py-0.23.0}/geoai/tools/multiclean.py +0 -0
  55. {geoai_py-0.21.0 → geoai_py-0.23.0}/geoai/tools/sr.py +0 -0
  56. {geoai_py-0.21.0 → geoai_py-0.23.0}/geoai/train.py +0 -0
  57. {geoai_py-0.21.0 → geoai_py-0.23.0}/geoai_py.egg-info/dependency_links.txt +0 -0
  58. {geoai_py-0.21.0 → geoai_py-0.23.0}/geoai_py.egg-info/entry_points.txt +0 -0
  59. {geoai_py-0.21.0 → geoai_py-0.23.0}/geoai_py.egg-info/top_level.txt +0 -0
  60. {geoai_py-0.21.0 → geoai_py-0.23.0}/pytest.ini +0 -0
  61. {geoai_py-0.21.0 → geoai_py-0.23.0}/qgis_plugin/geoai_plugin/LICENSE +0 -0
  62. {geoai_py-0.21.0 → geoai_py-0.23.0}/qgis_plugin/geoai_plugin/__init__.py +0 -0
  63. {geoai_py-0.21.0 → geoai_py-0.23.0}/qgis_plugin/geoai_plugin/_geoai_lib.py +0 -0
  64. {geoai_py-0.21.0 → geoai_py-0.23.0}/qgis_plugin/geoai_plugin/dialogs/map_tools.py +0 -0
  65. {geoai_py-0.21.0 → geoai_py-0.23.0}/qgis_plugin/geoai_plugin/dialogs/moondream.py +0 -0
  66. {geoai_py-0.21.0 → geoai_py-0.23.0}/qgis_plugin/geoai_plugin/icons/about.svg +0 -0
  67. {geoai_py-0.21.0 → geoai_py-0.23.0}/qgis_plugin/geoai_plugin/icons/gpu.svg +0 -0
  68. {geoai_py-0.21.0 → geoai_py-0.23.0}/qgis_plugin/geoai_plugin/icons/icon.png +0 -0
  69. {geoai_py-0.21.0 → geoai_py-0.23.0}/qgis_plugin/geoai_plugin/icons/moondream.svg +0 -0
  70. {geoai_py-0.21.0 → geoai_py-0.23.0}/qgis_plugin/geoai_plugin/icons/samgeo.png +0 -0
  71. {geoai_py-0.21.0 → geoai_py-0.23.0}/qgis_plugin/geoai_plugin/icons/segment.svg +0 -0
  72. {geoai_py-0.21.0 → geoai_py-0.23.0}/qgis_plugin/install.py +0 -0
  73. {geoai_py-0.21.0 → geoai_py-0.23.0}/qgis_plugin/install.sh +0 -0
  74. {geoai_py-0.21.0 → geoai_py-0.23.0}/requirements_docs.txt +0 -0
  75. {geoai_py-0.21.0 → geoai_py-0.23.0}/setup.cfg +0 -0
  76. {geoai_py-0.21.0 → geoai_py-0.23.0}/tests/__init__.py +0 -0
  77. {geoai_py-0.21.0 → geoai_py-0.23.0}/tests/create_test_data.py +0 -0
  78. {geoai_py-0.21.0 → geoai_py-0.23.0}/tests/test_classify.py +0 -0
  79. {geoai_py-0.21.0 → geoai_py-0.23.0}/tests/test_download.py +0 -0
  80. {geoai_py-0.21.0 → geoai_py-0.23.0}/tests/test_extract.py +0 -0
  81. {geoai_py-0.21.0 → geoai_py-0.23.0}/tests/test_fixtures.py +0 -0
  82. {geoai_py-0.21.0 → geoai_py-0.23.0}/tests/test_geoai.py +0 -0
  83. {geoai_py-0.21.0 → geoai_py-0.23.0}/tests/test_segment.py +0 -0
  84. {geoai_py-0.21.0 → geoai_py-0.23.0}/tests/test_utils.py +0 -0
@@ -21,6 +21,8 @@ docs/workshops/**/*.txt
21
21
  *.geojson
22
22
  *.gpkg
23
23
  *.csv
24
+ *.mp4
25
+ *.gif
24
26
  docs/examples/*.md
25
27
  *.xml
26
28
  docs/examples/output/
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: geoai-py
3
- Version: 0.21.0
3
+ Version: 0.23.0
4
4
  Summary: A Python package for using Artificial Intelligence (AI) with geospatial data
5
5
  Author-email: Qiusheng Wu <giswqs@gmail.com>
6
6
  License: MIT License
@@ -38,6 +38,7 @@ Requires-Dist: rasterio
38
38
  Requires-Dist: rioxarray
39
39
  Requires-Dist: scikit-image
40
40
  Requires-Dist: scikit-learn
41
+ Requires-Dist: smoothify
41
42
  Requires-Dist: timm
42
43
  Requires-Dist: tokenizers>=0.22.1
43
44
  Requires-Dist: torch
@@ -51,6 +52,7 @@ Requires-Dist: torchange; extra == "extra"
51
52
  Requires-Dist: lightly-train; extra == "extra"
52
53
  Requires-Dist: multiclean; extra == "extra"
53
54
  Requires-Dist: omnicloudmask; extra == "extra"
55
+ Requires-Dist: smoothify; extra == "extra"
54
56
  Provides-Extra: agents
55
57
  Requires-Dist: strands-agents; extra == "agents"
56
58
  Requires-Dist: strands-agents-tools; extra == "agents"
@@ -70,6 +72,7 @@ Dynamic: license-file
70
72
  [![Conda Recipe](https://img.shields.io/badge/recipe-geoai-green.svg)](https://github.com/conda-forge/geoai-py-feedstock)
71
73
  [![image](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
72
74
  [![image](https://img.shields.io/badge/YouTube-Tutorials-red)](https://tinyurl.com/GeoAI-Tutorials)
75
+ [![QGIS](https://img.shields.io/badge/QGIS-plugin-orange.svg)](https://opengeoai.org/qgis_plugin)
73
76
 
74
77
  [![logo](https://raw.githubusercontent.com/opengeos/geoai/master/docs/assets/logo_rect.png)](https://github.com/opengeos/geoai/blob/master/docs/assets/logo.png)
75
78
 
@@ -166,7 +169,7 @@ mamba install -c conda-forge geoai
166
169
 
167
170
  Check out the [QGIS Plugin](https://opengeoai.org/qgis_plugin/) page if you are interested in using GeoAI with QGIS.
168
171
 
169
- [![demo](https://github.com/user-attachments/assets/557feb58-ca58-4e27-800f-f3e8a8d3d362)](https://github.com/user-attachments/assets/557feb58-ca58-4e27-800f-f3e8a8d3d362)
172
+ [![demo](https://github.com/user-attachments/assets/5aabc3d3-efd1-4011-ab31-2b3f11aab3ed)](https://youtu.be/8-OhlqeoyiY)
170
173
 
171
174
  ## 📋 Documentation
172
175
 
@@ -7,6 +7,7 @@
7
7
  [![Conda Recipe](https://img.shields.io/badge/recipe-geoai-green.svg)](https://github.com/conda-forge/geoai-py-feedstock)
8
8
  [![image](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
9
9
  [![image](https://img.shields.io/badge/YouTube-Tutorials-red)](https://tinyurl.com/GeoAI-Tutorials)
10
+ [![QGIS](https://img.shields.io/badge/QGIS-plugin-orange.svg)](https://opengeoai.org/qgis_plugin)
10
11
 
11
12
  [![logo](https://raw.githubusercontent.com/opengeos/geoai/master/docs/assets/logo_rect.png)](https://github.com/opengeos/geoai/blob/master/docs/assets/logo.png)
12
13
 
@@ -103,7 +104,7 @@ mamba install -c conda-forge geoai
103
104
 
104
105
  Check out the [QGIS Plugin](https://opengeoai.org/qgis_plugin/) page if you are interested in using GeoAI with QGIS.
105
106
 
106
- [![demo](https://github.com/user-attachments/assets/557feb58-ca58-4e27-800f-f3e8a8d3d362)](https://github.com/user-attachments/assets/557feb58-ca58-4e27-800f-f3e8a8d3d362)
107
+ [![demo](https://github.com/user-attachments/assets/5aabc3d3-efd1-4011-ab31-2b3f11aab3ed)](https://youtu.be/8-OhlqeoyiY)
107
108
 
108
109
  ## 📋 Documentation
109
110
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  __author__ = """Qiusheng Wu"""
4
4
  __email__ = "giswqs@gmail.com"
5
- __version__ = "0.21.0"
5
+ __version__ = "0.23.0"
6
6
 
7
7
 
8
8
  import os
@@ -7848,3 +7848,70 @@ def empty_cache() -> None:
7848
7848
  torch.cuda.empty_cache()
7849
7849
  elif getattr(torch.backends, "mps", None) and torch.backends.mps.is_available():
7850
7850
  torch.mps.empty_cache()
7851
+
7852
+
7853
+ def smooth_vector(
7854
+ vector_data: Union[str, gpd.GeoDataFrame],
7855
+ output_path: str = None,
7856
+ segment_length: float = None,
7857
+ smooth_iterations: int = 3,
7858
+ num_cores: int = 0,
7859
+ merge_collection: bool = True,
7860
+ merge_field: str = None,
7861
+ merge_multipolygons: bool = True,
7862
+ preserve_area: bool = True,
7863
+ area_tolerance: float = 0.01,
7864
+ **kwargs: Any,
7865
+ ) -> gpd.GeoDataFrame:
7866
+ """Smooth a vector data using the smoothify library.
7867
+ See https://github.com/DPIRD-DMA/Smoothify for more details.
7868
+
7869
+ Args:
7870
+ vector_data: The vector data to smooth.
7871
+ output_path: The path to save the smoothed vector data. If None, returns the smoothed vector data.
7872
+ segment_length: Resolution of the original raster data in map units. If None (default), automatically
7873
+ detects by finding the minimum segment length (from a data sample). Recommended to specify explicitly when known.
7874
+ smooth_iterations: The number of iterations to smooth the vector data.
7875
+ num_cores: Number of cores to use for parallel processing. If 0 (default), uses all available cores.
7876
+ merge_collection: Whether to merge/dissolve adjacent geometries in collections before smoothing.
7877
+ merge_field: Column name to use for dissolving geometries. Only valid when merge_collection=True.
7878
+ If None, dissolves all geometries together. If specified, dissolves geometries grouped by the column values.
7879
+ merge_multipolygons: Whether to merge adjacent polygons within MultiPolygons before smoothing
7880
+ preserve_area: Whether to restore original area after smoothing via buffering (applies to Polygons only)
7881
+ area_tolerance: Percentage of original area allowed as error (e.g., 0.01 = 0.01% error = 99.99% preservation).
7882
+ Only affects Polygons when preserve_area=True
7883
+
7884
+ Returns:
7885
+ gpd.GeoDataFrame: The smoothed vector data.
7886
+
7887
+ Examples:
7888
+ >>> import geoai
7889
+ >>> gdf = geoai.read_vector("path/to/vector.geojson")
7890
+ >>> smoothed_gdf = geoai.smooth_vector(gdf, smooth_iterations=3, output_path="path/to/smoothed_vector.geojson")
7891
+ >>> smoothed_gdf.head()
7892
+ >>> smoothed_gdf.explore()
7893
+ """
7894
+ try:
7895
+ from smoothify import smoothify
7896
+ except ImportError:
7897
+ install_package("smoothify")
7898
+ from smoothify import smoothify
7899
+
7900
+ if isinstance(vector_data, str):
7901
+ vector_data = leafmap.read_vector(vector_data)
7902
+
7903
+ smoothed_vector_data = smoothify(
7904
+ geom=vector_data,
7905
+ segment_length=segment_length,
7906
+ smooth_iterations=smooth_iterations,
7907
+ num_cores=num_cores,
7908
+ merge_collection=merge_collection,
7909
+ merge_field=merge_field,
7910
+ merge_multipolygons=merge_multipolygons,
7911
+ preserve_area=preserve_area,
7912
+ area_tolerance=area_tolerance,
7913
+ **kwargs,
7914
+ )
7915
+ if output_path is not None:
7916
+ smoothed_vector_data.to_file(output_path)
7917
+ return smoothed_vector_data
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: geoai-py
3
- Version: 0.21.0
3
+ Version: 0.23.0
4
4
  Summary: A Python package for using Artificial Intelligence (AI) with geospatial data
5
5
  Author-email: Qiusheng Wu <giswqs@gmail.com>
6
6
  License: MIT License
@@ -38,6 +38,7 @@ Requires-Dist: rasterio
38
38
  Requires-Dist: rioxarray
39
39
  Requires-Dist: scikit-image
40
40
  Requires-Dist: scikit-learn
41
+ Requires-Dist: smoothify
41
42
  Requires-Dist: timm
42
43
  Requires-Dist: tokenizers>=0.22.1
43
44
  Requires-Dist: torch
@@ -51,6 +52,7 @@ Requires-Dist: torchange; extra == "extra"
51
52
  Requires-Dist: lightly-train; extra == "extra"
52
53
  Requires-Dist: multiclean; extra == "extra"
53
54
  Requires-Dist: omnicloudmask; extra == "extra"
55
+ Requires-Dist: smoothify; extra == "extra"
54
56
  Provides-Extra: agents
55
57
  Requires-Dist: strands-agents; extra == "agents"
56
58
  Requires-Dist: strands-agents-tools; extra == "agents"
@@ -70,6 +72,7 @@ Dynamic: license-file
70
72
  [![Conda Recipe](https://img.shields.io/badge/recipe-geoai-green.svg)](https://github.com/conda-forge/geoai-py-feedstock)
71
73
  [![image](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
72
74
  [![image](https://img.shields.io/badge/YouTube-Tutorials-red)](https://tinyurl.com/GeoAI-Tutorials)
75
+ [![QGIS](https://img.shields.io/badge/QGIS-plugin-orange.svg)](https://opengeoai.org/qgis_plugin)
73
76
 
74
77
  [![logo](https://raw.githubusercontent.com/opengeos/geoai/master/docs/assets/logo_rect.png)](https://github.com/opengeos/geoai/blob/master/docs/assets/logo.png)
75
78
 
@@ -166,7 +169,7 @@ mamba install -c conda-forge geoai
166
169
 
167
170
  Check out the [QGIS Plugin](https://opengeoai.org/qgis_plugin/) page if you are interested in using GeoAI with QGIS.
168
171
 
169
- [![demo](https://github.com/user-attachments/assets/557feb58-ca58-4e27-800f-f3e8a8d3d362)](https://github.com/user-attachments/assets/557feb58-ca58-4e27-800f-f3e8a8d3d362)
172
+ [![demo](https://github.com/user-attachments/assets/5aabc3d3-efd1-4011-ab31-2b3f11aab3ed)](https://youtu.be/8-OhlqeoyiY)
170
173
 
171
174
  ## 📋 Documentation
172
175
 
@@ -63,6 +63,7 @@ qgis_plugin/geoai_plugin/dialogs/map_tools.py
63
63
  qgis_plugin/geoai_plugin/dialogs/moondream.py
64
64
  qgis_plugin/geoai_plugin/dialogs/samgeo.py
65
65
  qgis_plugin/geoai_plugin/dialogs/segmentation.py
66
+ qgis_plugin/geoai_plugin/dialogs/update_checker.py
66
67
  qgis_plugin/geoai_plugin/icons/about.svg
67
68
  qgis_plugin/geoai_plugin/icons/gpu.svg
68
69
  qgis_plugin/geoai_plugin/icons/icon.png
@@ -20,6 +20,7 @@ rasterio
20
20
  rioxarray
21
21
  scikit-image
22
22
  scikit-learn
23
+ smoothify
23
24
  timm
24
25
  tokenizers>=0.22.1
25
26
  torch
@@ -41,6 +42,7 @@ torchange
41
42
  lightly-train
42
43
  multiclean
43
44
  omnicloudmask
45
+ smoothify
44
46
 
45
47
  [sr]
46
48
  opensr-model
@@ -163,6 +163,8 @@ nav:
163
163
  - examples/moondream.ipynb
164
164
  - examples/moondream_gui.ipynb
165
165
  - examples/AutoModel.ipynb
166
+ - examples/smooth_vector.ipynb
167
+ - examples/timelapse.ipynb
166
168
  - Workshops:
167
169
  - workshops/GeoAI_Workshop_2025.ipynb
168
170
  - workshops/AWS_2025.ipynb
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "geoai-py"
3
- version = "0.21.0"
3
+ version = "0.23.0"
4
4
  dynamic = [
5
5
  "dependencies",
6
6
  ]
@@ -36,7 +36,7 @@ exclude = ["docs*"]
36
36
  dependencies = {file = ["requirements.txt"]}
37
37
 
38
38
  [project.optional-dependencies]
39
- extra = ["overturemaps", "torchange", "lightly-train", "multiclean", "omnicloudmask"]
39
+ extra = ["overturemaps", "torchange", "lightly-train", "multiclean", "omnicloudmask", "smoothify"]
40
40
  agents = ["strands-agents", "strands-agents-tools", "strands-agents[ollama]", "strands-agents[anthropic]", "strands-agents[openai]"]
41
41
  sr = ["opensr-model"]
42
42
 
@@ -45,7 +45,7 @@ universal = true
45
45
 
46
46
 
47
47
  [tool.bumpversion]
48
- current_version = "0.21.0"
48
+ current_version = "0.23.0"
49
49
  commit = true
50
50
  tag = true
51
51