geoai-py 0.18.0__tar.gz → 0.18.1__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 (58) hide show
  1. {geoai_py-0.18.0 → geoai_py-0.18.1}/PKG-INFO +2 -2
  2. {geoai_py-0.18.0 → geoai_py-0.18.1}/geoai/__init__.py +1 -1
  3. {geoai_py-0.18.0 → geoai_py-0.18.1}/geoai/utils.py +59 -45
  4. {geoai_py-0.18.0 → geoai_py-0.18.1}/geoai_py.egg-info/PKG-INFO +2 -2
  5. {geoai_py-0.18.0 → geoai_py-0.18.1}/geoai_py.egg-info/requires.txt +1 -1
  6. {geoai_py-0.18.0 → geoai_py-0.18.1}/mkdocs.yml +1 -1
  7. {geoai_py-0.18.0 → geoai_py-0.18.1}/pyproject.toml +2 -2
  8. {geoai_py-0.18.0 → geoai_py-0.18.1}/requirements.txt +1 -1
  9. {geoai_py-0.18.0 → geoai_py-0.18.1}/.dockerignore +0 -0
  10. {geoai_py-0.18.0 → geoai_py-0.18.1}/.editorconfig +0 -0
  11. {geoai_py-0.18.0 → geoai_py-0.18.1}/.gitignore +0 -0
  12. {geoai_py-0.18.0 → geoai_py-0.18.1}/.pre-commit-config.yaml +0 -0
  13. {geoai_py-0.18.0 → geoai_py-0.18.1}/CITATION.cff +0 -0
  14. {geoai_py-0.18.0 → geoai_py-0.18.1}/Dockerfile +0 -0
  15. {geoai_py-0.18.0 → geoai_py-0.18.1}/LICENSE +0 -0
  16. {geoai_py-0.18.0 → geoai_py-0.18.1}/MANIFEST.in +0 -0
  17. {geoai_py-0.18.0 → geoai_py-0.18.1}/README.md +0 -0
  18. {geoai_py-0.18.0 → geoai_py-0.18.1}/geoai/agents/__init__.py +0 -0
  19. {geoai_py-0.18.0 → geoai_py-0.18.1}/geoai/agents/catalog_models.py +0 -0
  20. {geoai_py-0.18.0 → geoai_py-0.18.1}/geoai/agents/catalog_tools.py +0 -0
  21. {geoai_py-0.18.0 → geoai_py-0.18.1}/geoai/agents/geo_agents.py +0 -0
  22. {geoai_py-0.18.0 → geoai_py-0.18.1}/geoai/agents/map_tools.py +0 -0
  23. {geoai_py-0.18.0 → geoai_py-0.18.1}/geoai/agents/stac_models.py +0 -0
  24. {geoai_py-0.18.0 → geoai_py-0.18.1}/geoai/agents/stac_tools.py +0 -0
  25. {geoai_py-0.18.0 → geoai_py-0.18.1}/geoai/change_detection.py +0 -0
  26. {geoai_py-0.18.0 → geoai_py-0.18.1}/geoai/classify.py +0 -0
  27. {geoai_py-0.18.0 → geoai_py-0.18.1}/geoai/detectron2.py +0 -0
  28. {geoai_py-0.18.0 → geoai_py-0.18.1}/geoai/dinov3.py +0 -0
  29. {geoai_py-0.18.0 → geoai_py-0.18.1}/geoai/download.py +0 -0
  30. {geoai_py-0.18.0 → geoai_py-0.18.1}/geoai/extract.py +0 -0
  31. {geoai_py-0.18.0 → geoai_py-0.18.1}/geoai/geoai.py +0 -0
  32. {geoai_py-0.18.0 → geoai_py-0.18.1}/geoai/hf.py +0 -0
  33. {geoai_py-0.18.0 → geoai_py-0.18.1}/geoai/map_widgets.py +0 -0
  34. {geoai_py-0.18.0 → geoai_py-0.18.1}/geoai/sam.py +0 -0
  35. {geoai_py-0.18.0 → geoai_py-0.18.1}/geoai/segment.py +0 -0
  36. {geoai_py-0.18.0 → geoai_py-0.18.1}/geoai/segmentation.py +0 -0
  37. {geoai_py-0.18.0 → geoai_py-0.18.1}/geoai/timm_segment.py +0 -0
  38. {geoai_py-0.18.0 → geoai_py-0.18.1}/geoai/timm_train.py +0 -0
  39. {geoai_py-0.18.0 → geoai_py-0.18.1}/geoai/tools/__init__.py +0 -0
  40. {geoai_py-0.18.0 → geoai_py-0.18.1}/geoai/tools/cloudmask.py +0 -0
  41. {geoai_py-0.18.0 → geoai_py-0.18.1}/geoai/tools/multiclean.py +0 -0
  42. {geoai_py-0.18.0 → geoai_py-0.18.1}/geoai/train.py +0 -0
  43. {geoai_py-0.18.0 → geoai_py-0.18.1}/geoai_py.egg-info/SOURCES.txt +0 -0
  44. {geoai_py-0.18.0 → geoai_py-0.18.1}/geoai_py.egg-info/dependency_links.txt +0 -0
  45. {geoai_py-0.18.0 → geoai_py-0.18.1}/geoai_py.egg-info/entry_points.txt +0 -0
  46. {geoai_py-0.18.0 → geoai_py-0.18.1}/geoai_py.egg-info/top_level.txt +0 -0
  47. {geoai_py-0.18.0 → geoai_py-0.18.1}/pytest.ini +0 -0
  48. {geoai_py-0.18.0 → geoai_py-0.18.1}/requirements_docs.txt +0 -0
  49. {geoai_py-0.18.0 → geoai_py-0.18.1}/setup.cfg +0 -0
  50. {geoai_py-0.18.0 → geoai_py-0.18.1}/tests/__init__.py +0 -0
  51. {geoai_py-0.18.0 → geoai_py-0.18.1}/tests/create_test_data.py +0 -0
  52. {geoai_py-0.18.0 → geoai_py-0.18.1}/tests/test_classify.py +0 -0
  53. {geoai_py-0.18.0 → geoai_py-0.18.1}/tests/test_download.py +0 -0
  54. {geoai_py-0.18.0 → geoai_py-0.18.1}/tests/test_extract.py +0 -0
  55. {geoai_py-0.18.0 → geoai_py-0.18.1}/tests/test_fixtures.py +0 -0
  56. {geoai_py-0.18.0 → geoai_py-0.18.1}/tests/test_geoai.py +0 -0
  57. {geoai_py-0.18.0 → geoai_py-0.18.1}/tests/test_segment.py +0 -0
  58. {geoai_py-0.18.0 → geoai_py-0.18.1}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: geoai-py
3
- Version: 0.18.0
3
+ Version: 0.18.1
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
@@ -24,7 +24,7 @@ Requires-Dist: ever-beta
24
24
  Requires-Dist: geopandas
25
25
  Requires-Dist: huggingface_hub
26
26
  Requires-Dist: jupyter-server-proxy
27
- Requires-Dist: leafmap
27
+ Requires-Dist: leafmap>=0.57.1
28
28
  Requires-Dist: localtileserver
29
29
  Requires-Dist: mapclassify
30
30
  Requires-Dist: maplibre
@@ -2,7 +2,7 @@
2
2
 
3
3
  __author__ = """Qiusheng Wu"""
4
4
  __email__ = "giswqs@gmail.com"
5
- __version__ = "0.18.0"
5
+ __version__ = "0.18.1"
6
6
 
7
7
 
8
8
  import os
@@ -64,7 +64,7 @@ def view_raster(
64
64
  client_args: Optional[Dict] = {"cors_all": False},
65
65
  basemap: Optional[str] = "OpenStreetMap",
66
66
  basemap_args: Optional[Dict] = None,
67
- backend: Optional[str] = "ipyleaflet",
67
+ backend: Optional[str] = "folium",
68
68
  **kwargs: Any,
69
69
  ) -> Any:
70
70
  """
@@ -87,7 +87,7 @@ def view_raster(
87
87
  client_args (Optional[Dict], optional): Additional arguments for the client. Defaults to {"cors_all": False}.
88
88
  basemap (Optional[str], optional): The basemap to use. Defaults to "OpenStreetMap".
89
89
  basemap_args (Optional[Dict], optional): Additional arguments for the basemap. Defaults to None.
90
- backend (Optional[str], optional): The backend to use. Defaults to "ipyleaflet".
90
+ backend (Optional[str], optional): The backend to use. Defaults to "folium".
91
91
  **kwargs (Any): Additional keyword arguments.
92
92
 
93
93
  Returns:
@@ -123,26 +123,39 @@ def view_raster(
123
123
  if isinstance(source, dict):
124
124
  source = dict_to_image(source)
125
125
 
126
- if (
127
- isinstance(source, str)
128
- and source.lower().endswith(".tif")
129
- and source.startswith("http")
130
- ):
131
- if indexes is not None:
132
- kwargs["bidx"] = indexes
133
- if colormap is not None:
134
- kwargs["colormap_name"] = colormap
135
- if attribution is None:
136
- attribution = "TiTiler"
137
-
138
- m.add_cog_layer(
139
- source,
140
- name=layer_name,
141
- opacity=opacity,
142
- attribution=attribution,
143
- zoom_to_layer=zoom_to_layer,
144
- **kwargs,
145
- )
126
+ if isinstance(source, str) and source.startswith("http"):
127
+ if backend == "folium":
128
+
129
+ m.add_geotiff(
130
+ url=source,
131
+ name=layer_name,
132
+ opacity=opacity,
133
+ attribution=attribution,
134
+ fit_bounds=zoom_to_layer,
135
+ palette=colormap,
136
+ vmin=vmin,
137
+ vmax=vmax,
138
+ **kwargs,
139
+ )
140
+ m.add_layer_control()
141
+ m.add_opacity_control()
142
+
143
+ else:
144
+ if indexes is not None:
145
+ kwargs["bidx"] = indexes
146
+ if colormap is not None:
147
+ kwargs["colormap_name"] = colormap
148
+ if attribution is None:
149
+ attribution = "TiTiler"
150
+
151
+ m.add_cog_layer(
152
+ source,
153
+ name=layer_name,
154
+ opacity=opacity,
155
+ attribution=attribution,
156
+ zoom_to_layer=zoom_to_layer,
157
+ **kwargs,
158
+ )
146
159
  else:
147
160
  m.add_raster(
148
161
  source=source,
@@ -1081,8 +1094,9 @@ def view_vector(
1081
1094
 
1082
1095
  def view_vector_interactive(
1083
1096
  vector_data: Union[str, gpd.GeoDataFrame],
1084
- layer_name: str = "Vector Layer",
1097
+ layer_name: str = "Vector",
1085
1098
  tiles_args: Optional[Dict] = None,
1099
+ opacity: float = 0.7,
1086
1100
  **kwargs: Any,
1087
1101
  ) -> Any:
1088
1102
  """
@@ -1097,6 +1111,7 @@ def view_vector_interactive(
1097
1111
  layer_name (str, optional): The name of the layer. Defaults to "Vector Layer".
1098
1112
  tiles_args (dict, optional): Additional arguments for the localtileserver client.
1099
1113
  get_folium_tile_layer function. Defaults to None.
1114
+ opacity (float, optional): The opacity of the layer. Defaults to 0.7.
1100
1115
  **kwargs: Additional keyword arguments to pass to GeoDataFrame.explore() function.
1101
1116
  See https://geopandas.org/en/stable/docs/reference/api/geopandas.GeoDataFrame.explore.html
1102
1117
 
@@ -1111,9 +1126,8 @@ def view_vector_interactive(
1111
1126
  >>> roads = gpd.read_file("roads.shp")
1112
1127
  >>> view_vector_interactive(roads, figsize=(12, 8))
1113
1128
  """
1114
- import folium
1115
- import folium.plugins as plugins
1116
- from leafmap import cog_tile
1129
+
1130
+ from leafmap.foliumap import Map
1117
1131
  from localtileserver import TileClient, get_folium_tile_layer
1118
1132
 
1119
1133
  google_tiles = {
@@ -1148,6 +1162,8 @@ def view_vector_interactive(
1148
1162
  basemap_layer_name = None
1149
1163
  raster_layer = None
1150
1164
 
1165
+ m = Map()
1166
+
1151
1167
  if "tiles" in kwargs and isinstance(kwargs["tiles"], str):
1152
1168
  if kwargs["tiles"].title() in google_tiles:
1153
1169
  basemap_layer_name = google_tiles[kwargs["tiles"].title()]["name"]
@@ -1158,14 +1174,17 @@ def view_vector_interactive(
1158
1174
  tiles_args = {}
1159
1175
  if kwargs["tiles"].lower().startswith("http"):
1160
1176
  basemap_layer_name = "Remote Raster"
1161
- kwargs["tiles"] = cog_tile(kwargs["tiles"], **tiles_args)
1162
- kwargs["attr"] = "TiTiler"
1177
+ m.add_geotiff(kwargs["tiles"], name=basemap_layer_name, **tiles_args)
1163
1178
  else:
1164
1179
  basemap_layer_name = "Local Raster"
1165
1180
  client = TileClient(kwargs["tiles"])
1166
1181
  raster_layer = get_folium_tile_layer(client, **tiles_args)
1167
- kwargs["tiles"] = raster_layer.tiles
1168
- kwargs["attr"] = "localtileserver"
1182
+ m.add_tile_layer(
1183
+ raster_layer.tiles,
1184
+ name=basemap_layer_name,
1185
+ attribution="localtileserver",
1186
+ **tiles_args,
1187
+ )
1169
1188
 
1170
1189
  if "max_zoom" not in kwargs:
1171
1190
  kwargs["max_zoom"] = 30
@@ -1180,23 +1199,18 @@ def view_vector_interactive(
1180
1199
  if not isinstance(vector_data, gpd.GeoDataFrame):
1181
1200
  raise TypeError("Input data must be a GeoDataFrame")
1182
1201
 
1183
- layer_control = kwargs.pop("layer_control", True)
1184
- fullscreen_control = kwargs.pop("fullscreen_control", True)
1185
-
1186
- m = vector_data.explore(**kwargs)
1202
+ if "column" in kwargs:
1203
+ if "legend_position" not in kwargs:
1204
+ kwargs["legend_position"] = "bottomleft"
1205
+ if "cmap" not in kwargs:
1206
+ kwargs["cmap"] = "viridis"
1207
+ m.add_data(vector_data, layer_name=layer_name, opacity=opacity, **kwargs)
1187
1208
 
1188
- # Change the layer name
1189
- for layer in m._children.values():
1190
- if isinstance(layer, folium.GeoJson):
1191
- layer.layer_name = layer_name
1192
- if isinstance(layer, folium.TileLayer) and basemap_layer_name:
1193
- layer.layer_name = basemap_layer_name
1194
-
1195
- if layer_control:
1196
- m.add_child(folium.LayerControl())
1209
+ else:
1210
+ m.add_gdf(vector_data, layer_name=layer_name, opacity=opacity, **kwargs)
1197
1211
 
1198
- if fullscreen_control:
1199
- plugins.Fullscreen().add_to(m)
1212
+ m.add_layer_control()
1213
+ m.add_opacity_control()
1200
1214
 
1201
1215
  return m
1202
1216
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: geoai-py
3
- Version: 0.18.0
3
+ Version: 0.18.1
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
@@ -24,7 +24,7 @@ Requires-Dist: ever-beta
24
24
  Requires-Dist: geopandas
25
25
  Requires-Dist: huggingface_hub
26
26
  Requires-Dist: jupyter-server-proxy
27
- Requires-Dist: leafmap
27
+ Requires-Dist: leafmap>=0.57.1
28
28
  Requires-Dist: localtileserver
29
29
  Requires-Dist: mapclassify
30
30
  Requires-Dist: maplibre
@@ -6,7 +6,7 @@ ever-beta
6
6
  geopandas
7
7
  huggingface_hub
8
8
  jupyter-server-proxy
9
- leafmap
9
+ leafmap>=0.57.1
10
10
  localtileserver
11
11
  mapclassify
12
12
  maplibre
@@ -161,7 +161,7 @@ nav:
161
161
  - workshops/GeoAI_Workshop_2025.ipynb
162
162
  - workshops/AWS_2025.ipynb
163
163
  - workshops/TNView_2025.ipynb
164
- - workshops/ASA_2025.ipynb
164
+ - workshops/CANVAS_2025.ipynb
165
165
  - API Reference:
166
166
  - change_detection module: change_detection.md
167
167
  - classify module: classify.md
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "geoai-py"
3
- version = "0.18.0"
3
+ version = "0.18.1"
4
4
  dynamic = [
5
5
  "dependencies",
6
6
  ]
@@ -44,7 +44,7 @@ universal = true
44
44
 
45
45
 
46
46
  [tool.bumpversion]
47
- current_version = "0.18.0"
47
+ current_version = "0.18.1"
48
48
  commit = true
49
49
  tag = true
50
50
 
@@ -6,7 +6,7 @@ ever-beta
6
6
  geopandas
7
7
  huggingface_hub
8
8
  jupyter-server-proxy
9
- leafmap
9
+ leafmap>=0.57.1
10
10
  localtileserver
11
11
  mapclassify
12
12
  maplibre
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes