geoai-py 0.2.0__tar.gz → 0.2.2__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 (73) hide show
  1. {geoai_py-0.2.0 → geoai_py-0.2.2}/PKG-INFO +11 -3
  2. {geoai_py-0.2.0 → geoai_py-0.2.2}/README.md +8 -0
  3. geoai_py-0.2.2/docs/examples/view_metadata.ipynb +203 -0
  4. {geoai_py-0.2.0 → geoai_py-0.2.2}/docs/index.md +8 -0
  5. {geoai_py-0.2.0 → geoai_py-0.2.2}/docs/installation.md +22 -7
  6. {geoai_py-0.2.0 → geoai_py-0.2.2}/geoai/__init__.py +4 -2
  7. {geoai_py-0.2.0 → geoai_py-0.2.2}/geoai/common.py +2 -0
  8. geoai_py-0.2.2/geoai/geoai.py +4 -0
  9. {geoai_py-0.2.0 → geoai_py-0.2.2}/geoai/preprocess.py +687 -0
  10. {geoai_py-0.2.0 → geoai_py-0.2.2}/geoai_py.egg-info/PKG-INFO +11 -3
  11. {geoai_py-0.2.0 → geoai_py-0.2.2}/geoai_py.egg-info/SOURCES.txt +1 -0
  12. {geoai_py-0.2.0 → geoai_py-0.2.2}/geoai_py.egg-info/requires.txt +2 -2
  13. {geoai_py-0.2.0 → geoai_py-0.2.2}/mkdocs.yml +10 -2
  14. {geoai_py-0.2.0 → geoai_py-0.2.2}/pyproject.toml +2 -2
  15. {geoai_py-0.2.0 → geoai_py-0.2.2}/requirements.txt +2 -2
  16. geoai_py-0.2.0/geoai/geoai.py +0 -3
  17. {geoai_py-0.2.0 → geoai_py-0.2.2}/.editorconfig +0 -0
  18. {geoai_py-0.2.0 → geoai_py-0.2.2}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  19. {geoai_py-0.2.0 → geoai_py-0.2.2}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  20. {geoai_py-0.2.0 → geoai_py-0.2.2}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  21. {geoai_py-0.2.0 → geoai_py-0.2.2}/.github/dependabot.yml +0 -0
  22. {geoai_py-0.2.0 → geoai_py-0.2.2}/.github/workflows/docs-build.yml +0 -0
  23. {geoai_py-0.2.0 → geoai_py-0.2.2}/.github/workflows/docs.yml +0 -0
  24. {geoai_py-0.2.0 → geoai_py-0.2.2}/.github/workflows/macos.yml +0 -0
  25. {geoai_py-0.2.0 → geoai_py-0.2.2}/.github/workflows/pypi.yml +0 -0
  26. {geoai_py-0.2.0 → geoai_py-0.2.2}/.github/workflows/ubuntu.yml +0 -0
  27. {geoai_py-0.2.0 → geoai_py-0.2.2}/.github/workflows/windows.yml +0 -0
  28. {geoai_py-0.2.0 → geoai_py-0.2.2}/.gitignore +0 -0
  29. {geoai_py-0.2.0 → geoai_py-0.2.2}/.pre-commit-config.yaml +0 -0
  30. {geoai_py-0.2.0 → geoai_py-0.2.2}/LICENSE +0 -0
  31. {geoai_py-0.2.0 → geoai_py-0.2.2}/MANIFEST.in +0 -0
  32. {geoai_py-0.2.0 → geoai_py-0.2.2}/docs/CNAME +0 -0
  33. {geoai_py-0.2.0 → geoai_py-0.2.2}/docs/changelog.md +0 -0
  34. {geoai_py-0.2.0 → geoai_py-0.2.2}/docs/common.md +0 -0
  35. {geoai_py-0.2.0 → geoai_py-0.2.2}/docs/contributing.md +0 -0
  36. {geoai_py-0.2.0 → geoai_py-0.2.2}/docs/download.md +0 -0
  37. {geoai_py-0.2.0 → geoai_py-0.2.2}/docs/examples/data_visualization.ipynb +0 -0
  38. {geoai_py-0.2.0 → geoai_py-0.2.2}/docs/examples/dataviz/lidar_viz.ipynb +0 -0
  39. {geoai_py-0.2.0 → geoai_py-0.2.2}/docs/examples/dataviz/raster_viz.ipynb +0 -0
  40. {geoai_py-0.2.0 → geoai_py-0.2.2}/docs/examples/dataviz/vector_viz.ipynb +0 -0
  41. {geoai_py-0.2.0 → geoai_py-0.2.2}/docs/examples/download_data.ipynb +0 -0
  42. {geoai_py-0.2.0 → geoai_py-0.2.2}/docs/examples/jupytext.toml +0 -0
  43. {geoai_py-0.2.0 → geoai_py-0.2.2}/docs/examples/rastervision/semantic_segmentation.ipynb +0 -0
  44. {geoai_py-0.2.0 → geoai_py-0.2.2}/docs/examples/samgeo/arcgis.ipynb +0 -0
  45. {geoai_py-0.2.0 → geoai_py-0.2.2}/docs/examples/samgeo/automatic_mask_generator.ipynb +0 -0
  46. {geoai_py-0.2.0 → geoai_py-0.2.2}/docs/examples/samgeo/automatic_mask_generator_hq.ipynb +0 -0
  47. {geoai_py-0.2.0 → geoai_py-0.2.2}/docs/examples/samgeo/box_prompts.ipynb +0 -0
  48. {geoai_py-0.2.0 → geoai_py-0.2.2}/docs/examples/samgeo/fast_sam.ipynb +0 -0
  49. {geoai_py-0.2.0 → geoai_py-0.2.2}/docs/examples/samgeo/input_prompts.ipynb +0 -0
  50. {geoai_py-0.2.0 → geoai_py-0.2.2}/docs/examples/samgeo/input_prompts_hq.ipynb +0 -0
  51. {geoai_py-0.2.0 → geoai_py-0.2.2}/docs/examples/samgeo/maxar_open_data.ipynb +0 -0
  52. {geoai_py-0.2.0 → geoai_py-0.2.2}/docs/examples/samgeo/satellite-predictor.ipynb +0 -0
  53. {geoai_py-0.2.0 → geoai_py-0.2.2}/docs/examples/samgeo/satellite.ipynb +0 -0
  54. {geoai_py-0.2.0 → geoai_py-0.2.2}/docs/examples/samgeo/swimming_pools.ipynb +0 -0
  55. {geoai_py-0.2.0 → geoai_py-0.2.2}/docs/examples/samgeo/text_prompts.ipynb +0 -0
  56. {geoai_py-0.2.0 → geoai_py-0.2.2}/docs/examples/samgeo/text_prompts_batch.ipynb +0 -0
  57. {geoai_py-0.2.0 → geoai_py-0.2.2}/docs/extract.md +0 -0
  58. {geoai_py-0.2.0 → geoai_py-0.2.2}/docs/faq.md +0 -0
  59. {geoai_py-0.2.0 → geoai_py-0.2.2}/docs/geoai.md +0 -0
  60. {geoai_py-0.2.0 → geoai_py-0.2.2}/docs/overrides/main.html +0 -0
  61. {geoai_py-0.2.0 → geoai_py-0.2.2}/docs/preprocess.md +0 -0
  62. {geoai_py-0.2.0 → geoai_py-0.2.2}/docs/segmentation.md +0 -0
  63. {geoai_py-0.2.0 → geoai_py-0.2.2}/docs/usage.md +0 -0
  64. {geoai_py-0.2.0 → geoai_py-0.2.2}/geoai/download.py +0 -0
  65. {geoai_py-0.2.0 → geoai_py-0.2.2}/geoai/extract.py +0 -0
  66. {geoai_py-0.2.0 → geoai_py-0.2.2}/geoai/segmentation.py +0 -0
  67. {geoai_py-0.2.0 → geoai_py-0.2.2}/geoai_py.egg-info/dependency_links.txt +0 -0
  68. {geoai_py-0.2.0 → geoai_py-0.2.2}/geoai_py.egg-info/entry_points.txt +0 -0
  69. {geoai_py-0.2.0 → geoai_py-0.2.2}/geoai_py.egg-info/top_level.txt +0 -0
  70. {geoai_py-0.2.0 → geoai_py-0.2.2}/requirements_docs.txt +0 -0
  71. {geoai_py-0.2.0 → geoai_py-0.2.2}/setup.cfg +0 -0
  72. {geoai_py-0.2.0 → geoai_py-0.2.2}/tests/__init__.py +0 -0
  73. {geoai_py-0.2.0 → geoai_py-0.2.2}/tests/test_geoai.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: geoai-py
3
- Version: 0.2.0
3
+ Version: 0.2.2
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,8 +24,8 @@ Requires-Dist: jupyter-server-proxy
24
24
  Requires-Dist: leafmap
25
25
  Requires-Dist: localtileserver
26
26
  Requires-Dist: overturemaps
27
- Requires-Dist: planetary_computer
28
- Requires-Dist: pystac_client
27
+ Requires-Dist: planetary-computer
28
+ Requires-Dist: pystac-client
29
29
  Requires-Dist: rasterio
30
30
  Requires-Dist: rioxarray
31
31
  Requires-Dist: scikit-learn
@@ -62,6 +62,8 @@ GeoAI bridges the gap between AI and geospatial analysis, providing tools for pr
62
62
 
63
63
  ## 🚀 Key Features
64
64
 
65
+ ❗ **Important notes:** The GeoAI package is under active development and new features are being added regularly. Not all features listed below are available in the current release. If you have a feature request or would like to contribute, please let us know!
66
+
65
67
  ### 📊 Advanced Geospatial Data Visualization
66
68
 
67
69
  - Interactive multi-layer visualization of vector, raster, and point cloud data
@@ -112,6 +114,12 @@ pip install geoai-py
112
114
  conda install -c conda-forge geoai
113
115
  ```
114
116
 
117
+ ### Using mamba
118
+
119
+ ```bash
120
+ mamba install -c conda-forge geoai
121
+ ```
122
+
115
123
  ## 📋 Documentation
116
124
 
117
125
  Comprehensive documentation is available at [https://geoai.gishub.org](https://geoai.gishub.org), including:
@@ -18,6 +18,8 @@ GeoAI bridges the gap between AI and geospatial analysis, providing tools for pr
18
18
 
19
19
  ## 🚀 Key Features
20
20
 
21
+ ❗ **Important notes:** The GeoAI package is under active development and new features are being added regularly. Not all features listed below are available in the current release. If you have a feature request or would like to contribute, please let us know!
22
+
21
23
  ### 📊 Advanced Geospatial Data Visualization
22
24
 
23
25
  - Interactive multi-layer visualization of vector, raster, and point cloud data
@@ -68,6 +70,12 @@ pip install geoai-py
68
70
  conda install -c conda-forge geoai
69
71
  ```
70
72
 
73
+ ### Using mamba
74
+
75
+ ```bash
76
+ mamba install -c conda-forge geoai
77
+ ```
78
+
71
79
  ## 📋 Documentation
72
80
 
73
81
  Comprehensive documentation is available at [https://geoai.gishub.org](https://geoai.gishub.org), including:
@@ -0,0 +1,203 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "metadata": {},
6
+ "source": [
7
+ "# View Metadata\n",
8
+ "\n",
9
+ "[![image](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/opengeos/geoai/blob/main/docs/examples/metadata.ipynb)\n",
10
+ "\n",
11
+ "Install Package\n",
12
+ "\n",
13
+ "To use the `geoai-py` package, ensure it is installed in your environment. Uncomment the command below if needed."
14
+ ]
15
+ },
16
+ {
17
+ "cell_type": "code",
18
+ "execution_count": null,
19
+ "metadata": {},
20
+ "outputs": [],
21
+ "source": [
22
+ "# %pip install geoai-py"
23
+ ]
24
+ },
25
+ {
26
+ "cell_type": "markdown",
27
+ "metadata": {},
28
+ "source": [
29
+ "Import the package"
30
+ ]
31
+ },
32
+ {
33
+ "cell_type": "code",
34
+ "execution_count": null,
35
+ "metadata": {},
36
+ "outputs": [],
37
+ "source": [
38
+ "import geoai"
39
+ ]
40
+ },
41
+ {
42
+ "cell_type": "markdown",
43
+ "metadata": {},
44
+ "source": [
45
+ "Define URLs for sample datasets: a NAIP imagery raster file and a building footprints vector file"
46
+ ]
47
+ },
48
+ {
49
+ "cell_type": "code",
50
+ "execution_count": null,
51
+ "metadata": {},
52
+ "outputs": [],
53
+ "source": [
54
+ "raster_url = (\n",
55
+ " \"https://huggingface.co/datasets/giswqs/geospatial/resolve/main/naip_train.tif\"\n",
56
+ ")\n",
57
+ "vector_url = \"https://huggingface.co/datasets/giswqs/geospatial/resolve/main/naip_train_buildings.geojson\""
58
+ ]
59
+ },
60
+ {
61
+ "cell_type": "markdown",
62
+ "metadata": {},
63
+ "source": [
64
+ "Download the raster file (NAIP imagery) and save it locally"
65
+ ]
66
+ },
67
+ {
68
+ "cell_type": "code",
69
+ "execution_count": null,
70
+ "metadata": {},
71
+ "outputs": [],
72
+ "source": [
73
+ "raster_path = geoai.download_file(raster_url)"
74
+ ]
75
+ },
76
+ {
77
+ "cell_type": "markdown",
78
+ "metadata": {},
79
+ "source": [
80
+ "Download the vector file (building footprints) and save it locally"
81
+ ]
82
+ },
83
+ {
84
+ "cell_type": "code",
85
+ "execution_count": null,
86
+ "metadata": {},
87
+ "outputs": [],
88
+ "source": [
89
+ "vector_path = geoai.download_file(vector_url)"
90
+ ]
91
+ },
92
+ {
93
+ "cell_type": "markdown",
94
+ "metadata": {},
95
+ "source": [
96
+ "Display metadata about the raster file, including dimensions, resolution, projection, and bands"
97
+ ]
98
+ },
99
+ {
100
+ "cell_type": "code",
101
+ "execution_count": null,
102
+ "metadata": {},
103
+ "outputs": [],
104
+ "source": [
105
+ "geoai.print_raster_info(raster_path)"
106
+ ]
107
+ },
108
+ {
109
+ "cell_type": "markdown",
110
+ "metadata": {},
111
+ "source": [
112
+ "Display metadata about the vector file, including geometry type, feature count, extent, and attributes"
113
+ ]
114
+ },
115
+ {
116
+ "cell_type": "code",
117
+ "execution_count": null,
118
+ "metadata": {},
119
+ "outputs": [],
120
+ "source": [
121
+ "geoai.print_vector_info(vector_path)"
122
+ ]
123
+ },
124
+ {
125
+ "cell_type": "markdown",
126
+ "metadata": {},
127
+ "source": [
128
+ "Analyze the \"height\" attribute of buildings to obtain statistical information"
129
+ ]
130
+ },
131
+ {
132
+ "cell_type": "code",
133
+ "execution_count": null,
134
+ "metadata": {},
135
+ "outputs": [],
136
+ "source": [
137
+ "geoai.analyze_vector_attributes(vector_path, \"height\")"
138
+ ]
139
+ },
140
+ {
141
+ "cell_type": "markdown",
142
+ "metadata": {},
143
+ "source": [
144
+ "Create a visualization of building footprints colored by their height values"
145
+ ]
146
+ },
147
+ {
148
+ "cell_type": "code",
149
+ "execution_count": null,
150
+ "metadata": {},
151
+ "outputs": [],
152
+ "source": [
153
+ "geoai.visualize_vector_by_attribute(vector_path, \"height\")"
154
+ ]
155
+ },
156
+ {
157
+ "cell_type": "code",
158
+ "execution_count": null,
159
+ "metadata": {},
160
+ "outputs": [],
161
+ "source": [
162
+ "clip_raster_path = \"naip_clip.tif\"\n",
163
+ "geoai.clip_raster_by_bbox(\n",
164
+ " raster_path,\n",
165
+ " clip_raster_path,\n",
166
+ " bbox=(0, 0, 1000, 1000),\n",
167
+ " bands=[4, 1, 2],\n",
168
+ " bbox_type=\"pixel\",\n",
169
+ ")"
170
+ ]
171
+ },
172
+ {
173
+ "cell_type": "code",
174
+ "execution_count": null,
175
+ "metadata": {},
176
+ "outputs": [],
177
+ "source": [
178
+ "geoai.viz_image(clip_raster_path)"
179
+ ]
180
+ }
181
+ ],
182
+ "metadata": {
183
+ "kernelspec": {
184
+ "display_name": "Python 3 (ipykernel)",
185
+ "language": "python",
186
+ "name": "python3"
187
+ },
188
+ "language_info": {
189
+ "codemirror_mode": {
190
+ "name": "ipython",
191
+ "version": 3
192
+ },
193
+ "file_extension": ".py",
194
+ "mimetype": "text/x-python",
195
+ "name": "python",
196
+ "nbconvert_exporter": "python",
197
+ "pygments_lexer": "ipython3",
198
+ "version": "3.11.8"
199
+ }
200
+ },
201
+ "nbformat": 4,
202
+ "nbformat_minor": 4
203
+ }
@@ -18,6 +18,8 @@ GeoAI bridges the gap between AI and geospatial analysis, providing tools for pr
18
18
 
19
19
  ## 🚀 Key Features
20
20
 
21
+ ❗ **Important notes:** The GeoAI package is under active development and new features are being added regularly. Not all features listed below are available in the current release. If you have a feature request or would like to contribute, please let us know!
22
+
21
23
  ### 📊 Advanced Geospatial Data Visualization
22
24
 
23
25
  - Interactive multi-layer visualization of vector, raster, and point cloud data
@@ -68,6 +70,12 @@ pip install geoai-py
68
70
  conda install -c conda-forge geoai
69
71
  ```
70
72
 
73
+ ### Using mamba
74
+
75
+ ```bash
76
+ mamba install -c conda-forge geoai
77
+ ```
78
+
71
79
  ## 📋 Documentation
72
80
 
73
81
  Comprehensive documentation is available at [https://geoai.gishub.org](https://geoai.gishub.org), including:
@@ -25,27 +25,30 @@ To install GeoAI with all optional dependencies for additional features:
25
25
  pip install "geoai-py[all]"
26
26
  ```
27
27
 
28
- ### 🐼 Using conda
28
+ ### 🐍 Using uv
29
29
 
30
- For Anaconda/Miniconda users, we recommend installing GeoAI via conda-forge, which handles dependencies like GDAL more elegantly:
30
+ To install the latest stable release of GeoAI with [uv](https://docs.astral.sh/uv), a faster alternative to pip:
31
31
 
32
32
  ```bash
33
- conda install -c conda-forge geoai
33
+ uv pip install geoai-py
34
34
  ```
35
35
 
36
- Consider creating a dedicated environment for your GeoAI projects:
36
+ ### 🐼 Using conda
37
+
38
+ For Anaconda/Miniconda users, we recommend installing GeoAI via conda-forge, which handles dependencies like GDAL more elegantly:
37
39
 
38
40
  ```bash
39
- conda create -n geo python=3.12
40
- conda activate geo
41
41
  conda install -c conda-forge geoai
42
42
  ```
43
43
 
44
44
  ### 🦡 Using mamba
45
45
 
46
- Mamba provides faster dependency resolution compared to conda:
46
+ Mamba provides faster dependency resolution compared to conda. This is especially useful for large packages like GeoAI:
47
47
 
48
48
  ```bash
49
+ conda create -n geo python=3.12
50
+ conda activate geo
51
+ conda install -c conda-forge mamba
49
52
  mamba install -c conda-forge geoai
50
53
  ```
51
54
 
@@ -61,6 +64,18 @@ mamba install -c conda-forge geoai "pytorch=*=cuda*"
61
64
 
62
65
  This will install the appropriate PyTorch version with CUDA support.
63
66
 
67
+ If you run into issues with the ipympl package, you can install it using the following command:
68
+
69
+ ```bash
70
+ mamba install -c conda-forge geoai "pytorch=*=cuda*" jupyterlab ipympl
71
+ ```
72
+
73
+ If you encounter issues with the sqlite package, you can update it using the following command:
74
+
75
+ ```bash
76
+ mamba update -c conda-forge sqlite
77
+ ```
78
+
64
79
  ### 👩‍💻 Development Installation
65
80
 
66
81
  For contributing to GeoAI development, install directly from the source repository:
@@ -2,7 +2,7 @@
2
2
 
3
3
  __author__ = """Qiusheng Wu"""
4
4
  __email__ = "giswqs@gmail.com"
5
- __version__ = "0.2.0"
5
+ __version__ = "0.2.2"
6
6
 
7
7
 
8
8
  import os
@@ -29,5 +29,7 @@ def set_proj_lib_path():
29
29
  return
30
30
 
31
31
 
32
- set_proj_lib_path()
32
+ if "google.colab" not in sys.modules:
33
+ set_proj_lib_path()
34
+
33
35
  from .geoai import *
@@ -114,6 +114,8 @@ def viz_image(
114
114
 
115
115
  if isinstance(image, torch.Tensor):
116
116
  image = image.cpu().numpy()
117
+ elif isinstance(image, str):
118
+ image = rio.open(image).read().transpose(1, 2, 0)
117
119
 
118
120
  plt.figure(figsize=figsize)
119
121
 
@@ -0,0 +1,4 @@
1
+ """Main module."""
2
+
3
+ from .common import *
4
+ from .preprocess import *