geoai-py 0.3.1__tar.gz → 0.3.3__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.
- {geoai_py-0.3.1 → geoai_py-0.3.3}/PKG-INFO +11 -5
- {geoai_py-0.3.1 → geoai_py-0.3.3}/README.md +9 -3
- {geoai_py-0.3.1 → geoai_py-0.3.3}/docs/examples/building_footprints_usa.ipynb +4 -3
- {geoai_py-0.3.1 → geoai_py-0.3.3}/docs/examples/building_regularization.ipynb +97 -10
- geoai_py-0.3.3/docs/examples/geometric_properties.ipynb +199 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/docs/index.md +9 -3
- {geoai_py-0.3.1 → geoai_py-0.3.3}/geoai/__init__.py +1 -1
- {geoai_py-0.3.1 → geoai_py-0.3.3}/geoai/extract.py +275 -143
- {geoai_py-0.3.1 → geoai_py-0.3.3}/geoai/geoai.py +0 -1
- {geoai_py-0.3.1 → geoai_py-0.3.3}/geoai/preprocess.py +20 -6
- geoai_py-0.3.3/geoai/utils.py +4951 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/geoai_py.egg-info/PKG-INFO +11 -5
- {geoai_py-0.3.1 → geoai_py-0.3.3}/geoai_py.egg-info/SOURCES.txt +1 -1
- {geoai_py-0.3.1 → geoai_py-0.3.3}/geoai_py.egg-info/requires.txt +1 -1
- {geoai_py-0.3.1 → geoai_py-0.3.3}/mkdocs.yml +1 -1
- {geoai_py-0.3.1 → geoai_py-0.3.3}/pyproject.toml +2 -2
- {geoai_py-0.3.1 → geoai_py-0.3.3}/requirements.txt +2 -1
- geoai_py-0.3.1/docs/preprocess.md +0 -3
- geoai_py-0.3.1/geoai/utils.py +0 -1082
- {geoai_py-0.3.1 → geoai_py-0.3.3}/.editorconfig +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/.github/dependabot.yml +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/.github/workflows/docs-build.yml +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/.github/workflows/docs.yml +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/.github/workflows/macos.yml +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/.github/workflows/pypi.yml +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/.github/workflows/ubuntu.yml +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/.github/workflows/windows.yml +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/.gitignore +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/.pre-commit-config.yaml +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/LICENSE +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/MANIFEST.in +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/docs/CNAME +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/docs/changelog.md +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/docs/contributing.md +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/docs/download.md +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/docs/examples/data_visualization.ipynb +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/docs/examples/dataviz/lidar_viz.ipynb +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/docs/examples/dataviz/raster_viz.ipynb +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/docs/examples/dataviz/vector_viz.ipynb +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/docs/examples/download_data.ipynb +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/docs/examples/image_chips.ipynb +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/docs/examples/jupytext.toml +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/docs/examples/rastervision/semantic_segmentation.ipynb +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/docs/examples/samgeo/arcgis.ipynb +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/docs/examples/samgeo/automatic_mask_generator.ipynb +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/docs/examples/samgeo/automatic_mask_generator_hq.ipynb +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/docs/examples/samgeo/box_prompts.ipynb +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/docs/examples/samgeo/fast_sam.ipynb +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/docs/examples/samgeo/input_prompts.ipynb +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/docs/examples/samgeo/input_prompts_hq.ipynb +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/docs/examples/samgeo/maxar_open_data.ipynb +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/docs/examples/samgeo/satellite-predictor.ipynb +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/docs/examples/samgeo/satellite.ipynb +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/docs/examples/samgeo/swimming_pools.ipynb +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/docs/examples/samgeo/text_prompts.ipynb +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/docs/examples/samgeo/text_prompts_batch.ipynb +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/docs/examples/view_metadata.ipynb +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/docs/extract.md +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/docs/faq.md +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/docs/geoai.md +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/docs/installation.md +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/docs/overrides/main.html +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/docs/segmentation.md +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/docs/usage.md +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/docs/utils.md +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/geoai/download.py +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/geoai/segmentation.py +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/geoai_py.egg-info/dependency_links.txt +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/geoai_py.egg-info/entry_points.txt +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/geoai_py.egg-info/top_level.txt +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/requirements_docs.txt +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/setup.cfg +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/tests/__init__.py +0 -0
- {geoai_py-0.3.1 → geoai_py-0.3.3}/tests/test_geoai.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: geoai-py
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.3
|
|
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
|
|
@@ -30,8 +30,8 @@ Requires-Dist: planetary-computer
|
|
|
30
30
|
Requires-Dist: pystac-client
|
|
31
31
|
Requires-Dist: rasterio
|
|
32
32
|
Requires-Dist: rioxarray
|
|
33
|
+
Requires-Dist: scikit-image
|
|
33
34
|
Requires-Dist: scikit-learn
|
|
34
|
-
Requires-Dist: segment-geospatial
|
|
35
35
|
Requires-Dist: torch
|
|
36
36
|
Requires-Dist: torchgeo
|
|
37
37
|
Requires-Dist: tqdm
|
|
@@ -50,9 +50,9 @@ Requires-Dist: geoai[download]; extra == "all"
|
|
|
50
50
|
[](https://pepy.tech/project/geoai-py)
|
|
51
51
|
[](https://anaconda.org/conda-forge/geoai)
|
|
52
52
|
[](https://anaconda.org/conda-forge/geoai)
|
|
53
|
-
[](https://github.com/
|
|
53
|
+
[](https://github.com/giswqs/geoai-py-feedstock)
|
|
54
54
|
[](https://opensource.org/licenses/MIT)
|
|
55
|
-
[](https://bit.ly/GeoAI-Tutorials)
|
|
56
56
|
|
|
57
57
|
**A powerful Python package for integrating Artificial Intelligence with geospatial data analysis and visualization**
|
|
58
58
|
|
|
@@ -86,7 +86,7 @@ GeoAI bridges the gap between AI and geospatial analysis, providing tools for pr
|
|
|
86
86
|
- Integration with Meta's Segment Anything Model (SAM) for automatic feature extraction
|
|
87
87
|
- Specialized segmentation algorithms optimized for satellite and aerial imagery
|
|
88
88
|
- Streamlined workflows for segmenting buildings, roads, vegetation, and water bodies
|
|
89
|
-
- Export capabilities to standard geospatial formats (GeoJSON, Shapefile, GeoPackage)
|
|
89
|
+
- Export capabilities to standard geospatial formats (GeoJSON, Shapefile, GeoPackage, GeoParquet)
|
|
90
90
|
|
|
91
91
|
### 🔍 Image Classification
|
|
92
92
|
|
|
@@ -131,6 +131,12 @@ Comprehensive documentation is available at [https://geoai.gishub.org](https://g
|
|
|
131
131
|
- Explanation of algorithms and models
|
|
132
132
|
- Best practices for geospatial AI
|
|
133
133
|
|
|
134
|
+
## 📺 Video Tutorials
|
|
135
|
+
|
|
136
|
+
Check out our [YouTube channel](https://bit.ly/GeoAI-Tutorials) for video tutorials on using GeoAI for geospatial data analysis and visualization.
|
|
137
|
+
|
|
138
|
+
[](https://bit.ly/GeoAI-Tutorials)
|
|
139
|
+
|
|
134
140
|
## 🤝 Contributing
|
|
135
141
|
|
|
136
142
|
We welcome contributions of all kinds! See our [contributing guide](https://geoai.gishub.org/contributing) for ways to get started.
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
[](https://pepy.tech/project/geoai-py)
|
|
5
5
|
[](https://anaconda.org/conda-forge/geoai)
|
|
6
6
|
[](https://anaconda.org/conda-forge/geoai)
|
|
7
|
-
[](https://github.com/
|
|
7
|
+
[](https://github.com/giswqs/geoai-py-feedstock)
|
|
8
8
|
[](https://opensource.org/licenses/MIT)
|
|
9
|
-
[](https://bit.ly/GeoAI-Tutorials)
|
|
10
10
|
|
|
11
11
|
**A powerful Python package for integrating Artificial Intelligence with geospatial data analysis and visualization**
|
|
12
12
|
|
|
@@ -40,7 +40,7 @@ GeoAI bridges the gap between AI and geospatial analysis, providing tools for pr
|
|
|
40
40
|
- Integration with Meta's Segment Anything Model (SAM) for automatic feature extraction
|
|
41
41
|
- Specialized segmentation algorithms optimized for satellite and aerial imagery
|
|
42
42
|
- Streamlined workflows for segmenting buildings, roads, vegetation, and water bodies
|
|
43
|
-
- Export capabilities to standard geospatial formats (GeoJSON, Shapefile, GeoPackage)
|
|
43
|
+
- Export capabilities to standard geospatial formats (GeoJSON, Shapefile, GeoPackage, GeoParquet)
|
|
44
44
|
|
|
45
45
|
### 🔍 Image Classification
|
|
46
46
|
|
|
@@ -85,6 +85,12 @@ Comprehensive documentation is available at [https://geoai.gishub.org](https://g
|
|
|
85
85
|
- Explanation of algorithms and models
|
|
86
86
|
- Best practices for geospatial AI
|
|
87
87
|
|
|
88
|
+
## 📺 Video Tutorials
|
|
89
|
+
|
|
90
|
+
Check out our [YouTube channel](https://bit.ly/GeoAI-Tutorials) for video tutorials on using GeoAI for geospatial data analysis and visualization.
|
|
91
|
+
|
|
92
|
+
[](https://bit.ly/GeoAI-Tutorials)
|
|
93
|
+
|
|
88
94
|
## 🤝 Contributing
|
|
89
95
|
|
|
90
96
|
We welcome contributions of all kinds! See our [contributing guide](https://geoai.gishub.org/contributing) for ways to get started.
|
|
@@ -156,7 +156,8 @@
|
|
|
156
156
|
" confidence_threshold=0.5,\n",
|
|
157
157
|
" overlap=0.25,\n",
|
|
158
158
|
" nms_iou_threshold=0.5,\n",
|
|
159
|
-
"
|
|
159
|
+
" min_object_area=100,\n",
|
|
160
|
+
" max_object_area=None,\n",
|
|
160
161
|
" mask_threshold=0.5,\n",
|
|
161
162
|
" simplify_tolerance=1.0,\n",
|
|
162
163
|
")"
|
|
@@ -256,7 +257,7 @@
|
|
|
256
257
|
],
|
|
257
258
|
"metadata": {
|
|
258
259
|
"kernelspec": {
|
|
259
|
-
"display_name": "
|
|
260
|
+
"display_name": "geo",
|
|
260
261
|
"language": "python",
|
|
261
262
|
"name": "python3"
|
|
262
263
|
},
|
|
@@ -270,7 +271,7 @@
|
|
|
270
271
|
"name": "python",
|
|
271
272
|
"nbconvert_exporter": "python",
|
|
272
273
|
"pygments_lexer": "ipython3",
|
|
273
|
-
"version": "3.
|
|
274
|
+
"version": "3.12.2"
|
|
274
275
|
}
|
|
275
276
|
},
|
|
276
277
|
"nbformat": 4,
|
|
@@ -50,7 +50,20 @@
|
|
|
50
50
|
"metadata": {},
|
|
51
51
|
"outputs": [],
|
|
52
52
|
"source": [
|
|
53
|
-
"
|
|
53
|
+
"naip_url = (\n",
|
|
54
|
+
" \"https://huggingface.co/datasets/giswqs/geospatial/resolve/main/naip_train.tif\"\n",
|
|
55
|
+
")\n",
|
|
56
|
+
"masks_url = \"https://huggingface.co/datasets/giswqs/geospatial/resolve/main/naip_building_masks.tif\""
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"cell_type": "code",
|
|
61
|
+
"execution_count": null,
|
|
62
|
+
"metadata": {},
|
|
63
|
+
"outputs": [],
|
|
64
|
+
"source": [
|
|
65
|
+
"masks_path = geoai.download_file(masks_url)\n",
|
|
66
|
+
"naip_path = geoai.download_file(naip_url)"
|
|
54
67
|
]
|
|
55
68
|
},
|
|
56
69
|
{
|
|
@@ -59,7 +72,7 @@
|
|
|
59
72
|
"metadata": {},
|
|
60
73
|
"outputs": [],
|
|
61
74
|
"source": [
|
|
62
|
-
"
|
|
75
|
+
"geoai.view_image(masks_path, figsize=(18, 10))"
|
|
63
76
|
]
|
|
64
77
|
},
|
|
65
78
|
{
|
|
@@ -68,7 +81,17 @@
|
|
|
68
81
|
"metadata": {},
|
|
69
82
|
"outputs": [],
|
|
70
83
|
"source": [
|
|
71
|
-
"geoai.
|
|
84
|
+
"geoai.create_split_map(\n",
|
|
85
|
+
" left_layer=masks_url,\n",
|
|
86
|
+
" right_layer=naip_url,\n",
|
|
87
|
+
" left_label=\"Building Masks\",\n",
|
|
88
|
+
" right_label=\"NAIP Imagery\",\n",
|
|
89
|
+
" left_args={\n",
|
|
90
|
+
" \"colormap\": {\"255\": \"#0000ff\"},\n",
|
|
91
|
+
" \"opacity\": 0.5,\n",
|
|
92
|
+
" },\n",
|
|
93
|
+
" basemap=naip_url,\n",
|
|
94
|
+
")"
|
|
72
95
|
]
|
|
73
96
|
},
|
|
74
97
|
{
|
|
@@ -84,7 +107,7 @@
|
|
|
84
107
|
"metadata": {},
|
|
85
108
|
"outputs": [],
|
|
86
109
|
"source": [
|
|
87
|
-
"gdf = geoai.raster_to_vector(
|
|
110
|
+
"gdf = geoai.raster_to_vector(masks_path, output_path=\"naip_building_masks.geojson\")"
|
|
88
111
|
]
|
|
89
112
|
},
|
|
90
113
|
{
|
|
@@ -94,7 +117,23 @@
|
|
|
94
117
|
"outputs": [],
|
|
95
118
|
"source": [
|
|
96
119
|
"geoai.view_vector_interactive(\n",
|
|
97
|
-
" gdf, style_kwds={\"color\": \"blue\", \"fillOpacity\": 0}, tiles
|
|
120
|
+
" gdf, style_kwds={\"color\": \"blue\", \"fillOpacity\": 0.4}, tiles=naip_url\n",
|
|
121
|
+
")"
|
|
122
|
+
]
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"cell_type": "code",
|
|
126
|
+
"execution_count": null,
|
|
127
|
+
"metadata": {},
|
|
128
|
+
"outputs": [],
|
|
129
|
+
"source": [
|
|
130
|
+
"geoai.create_split_map(\n",
|
|
131
|
+
" left_layer=gdf,\n",
|
|
132
|
+
" right_layer=naip_url,\n",
|
|
133
|
+
" left_label=\"Buildings\",\n",
|
|
134
|
+
" right_label=\"NAIP Imagery\",\n",
|
|
135
|
+
" left_args={\"style\": {\"color\": \"blue\"}, \"fillOpacity\": 0.4},\n",
|
|
136
|
+
" basemap=naip_url,\n",
|
|
98
137
|
")"
|
|
99
138
|
]
|
|
100
139
|
},
|
|
@@ -127,7 +166,23 @@
|
|
|
127
166
|
"outputs": [],
|
|
128
167
|
"source": [
|
|
129
168
|
"geoai.view_vector_interactive(\n",
|
|
130
|
-
" gdf_regularized, style_kwds={\"color\": \"red\", \"fillOpacity\": 0}, tiles
|
|
169
|
+
" gdf_regularized, style_kwds={\"color\": \"red\", \"fillOpacity\": 0.4}, tiles=naip_url\n",
|
|
170
|
+
")"
|
|
171
|
+
]
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"cell_type": "code",
|
|
175
|
+
"execution_count": null,
|
|
176
|
+
"metadata": {},
|
|
177
|
+
"outputs": [],
|
|
178
|
+
"source": [
|
|
179
|
+
"geoai.create_split_map(\n",
|
|
180
|
+
" left_layer=gdf_regularized,\n",
|
|
181
|
+
" right_layer=naip_url,\n",
|
|
182
|
+
" left_label=\"Regularized Buildings\",\n",
|
|
183
|
+
" right_label=\"NAIP Imagery\",\n",
|
|
184
|
+
" left_args={\"style\": {\"color\": \"red\"}, \"fillOpacity\": 0.4},\n",
|
|
185
|
+
" basemap=naip_url,\n",
|
|
131
186
|
")"
|
|
132
187
|
]
|
|
133
188
|
},
|
|
@@ -154,7 +209,23 @@
|
|
|
154
209
|
"outputs": [],
|
|
155
210
|
"source": [
|
|
156
211
|
"geoai.view_vector_interactive(\n",
|
|
157
|
-
" gdf_hybrid, style_kwds={\"color\": \"green\", \"fillOpacity\": 0}, tiles
|
|
212
|
+
" gdf_hybrid, style_kwds={\"color\": \"green\", \"fillOpacity\": 0.4}, tiles=naip_url\n",
|
|
213
|
+
")"
|
|
214
|
+
]
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
"cell_type": "code",
|
|
218
|
+
"execution_count": null,
|
|
219
|
+
"metadata": {},
|
|
220
|
+
"outputs": [],
|
|
221
|
+
"source": [
|
|
222
|
+
"geoai.create_split_map(\n",
|
|
223
|
+
" left_layer=gdf_regularized,\n",
|
|
224
|
+
" right_layer=naip_url,\n",
|
|
225
|
+
" left_label=\"Regularized Buildings\",\n",
|
|
226
|
+
" right_label=\"NAIP Imagery\",\n",
|
|
227
|
+
" left_args={\"style\": {\"color\": \"green\", \"fillOpacity\": 0.4}},\n",
|
|
228
|
+
" basemap=naip_url,\n",
|
|
158
229
|
")"
|
|
159
230
|
]
|
|
160
231
|
},
|
|
@@ -186,7 +257,23 @@
|
|
|
186
257
|
"outputs": [],
|
|
187
258
|
"source": [
|
|
188
259
|
"geoai.view_vector_interactive(\n",
|
|
189
|
-
" gdf_adaptive, style_kwds={\"color\": \"yellow\", \"fillOpacity\": 0}, tiles
|
|
260
|
+
" gdf_adaptive, style_kwds={\"color\": \"yellow\", \"fillOpacity\": 0.4}, tiles=naip_url\n",
|
|
261
|
+
")"
|
|
262
|
+
]
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
"cell_type": "code",
|
|
266
|
+
"execution_count": null,
|
|
267
|
+
"metadata": {},
|
|
268
|
+
"outputs": [],
|
|
269
|
+
"source": [
|
|
270
|
+
"geoai.create_split_map(\n",
|
|
271
|
+
" left_layer=gdf_adaptive,\n",
|
|
272
|
+
" right_layer=naip_url,\n",
|
|
273
|
+
" left_label=\"Adaptive Regularization Buildings\",\n",
|
|
274
|
+
" right_label=\"NAIP Imagery\",\n",
|
|
275
|
+
" left_args={\"style\": {\"color\": \"yellow\", \"fillOpacity\": 0.4}},\n",
|
|
276
|
+
" basemap=naip_url,\n",
|
|
190
277
|
")"
|
|
191
278
|
]
|
|
192
279
|
},
|
|
@@ -235,7 +322,7 @@
|
|
|
235
322
|
],
|
|
236
323
|
"metadata": {
|
|
237
324
|
"kernelspec": {
|
|
238
|
-
"display_name": "
|
|
325
|
+
"display_name": "geo",
|
|
239
326
|
"language": "python",
|
|
240
327
|
"name": "python3"
|
|
241
328
|
},
|
|
@@ -249,7 +336,7 @@
|
|
|
249
336
|
"name": "python",
|
|
250
337
|
"nbconvert_exporter": "python",
|
|
251
338
|
"pygments_lexer": "ipython3",
|
|
252
|
-
"version": "3.
|
|
339
|
+
"version": "3.12.2"
|
|
253
340
|
}
|
|
254
341
|
},
|
|
255
342
|
"nbformat": 4,
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cells": [
|
|
3
|
+
{
|
|
4
|
+
"cell_type": "markdown",
|
|
5
|
+
"metadata": {},
|
|
6
|
+
"source": [
|
|
7
|
+
"# Geometric Properties\n",
|
|
8
|
+
"\n",
|
|
9
|
+
"[](https://colab.research.google.com/github/opengeos/geoai/blob/main/docs/examples/geometric_properties.ipynb)\n",
|
|
10
|
+
"\n",
|
|
11
|
+
"This notebook demonstrates how to calculate geometric properties of objects in a vector dataset and filter out unwanted objects based on these properties.\n",
|
|
12
|
+
"\n",
|
|
13
|
+
"## Install package\n",
|
|
14
|
+
"To use the `geoai-py` package, ensure it is installed in your environment. Uncomment the command below if needed."
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"cell_type": "code",
|
|
19
|
+
"execution_count": null,
|
|
20
|
+
"metadata": {},
|
|
21
|
+
"outputs": [],
|
|
22
|
+
"source": [
|
|
23
|
+
"# %pip install geoai-py"
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"cell_type": "markdown",
|
|
28
|
+
"metadata": {},
|
|
29
|
+
"source": [
|
|
30
|
+
"## Import package"
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"cell_type": "code",
|
|
35
|
+
"execution_count": null,
|
|
36
|
+
"metadata": {},
|
|
37
|
+
"outputs": [],
|
|
38
|
+
"source": [
|
|
39
|
+
"import geoai"
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"cell_type": "markdown",
|
|
44
|
+
"metadata": {},
|
|
45
|
+
"source": [
|
|
46
|
+
"## Load data"
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"cell_type": "code",
|
|
51
|
+
"execution_count": null,
|
|
52
|
+
"metadata": {},
|
|
53
|
+
"outputs": [],
|
|
54
|
+
"source": [
|
|
55
|
+
"vector_url = \"https://huggingface.co/datasets/giswqs/geospatial/resolve/main/naip_buildings_masks.geojson\"\n",
|
|
56
|
+
"raster_url = (\n",
|
|
57
|
+
" \"https://huggingface.co/datasets/giswqs/geospatial/resolve/main/naip_train.tif\"\n",
|
|
58
|
+
")"
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"cell_type": "code",
|
|
63
|
+
"execution_count": null,
|
|
64
|
+
"metadata": {},
|
|
65
|
+
"outputs": [],
|
|
66
|
+
"source": [
|
|
67
|
+
"gdf = geoai.read_vector(vector_url)"
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"cell_type": "code",
|
|
72
|
+
"execution_count": null,
|
|
73
|
+
"metadata": {},
|
|
74
|
+
"outputs": [],
|
|
75
|
+
"source": [
|
|
76
|
+
"gdf.head()"
|
|
77
|
+
]
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"cell_type": "markdown",
|
|
81
|
+
"metadata": {},
|
|
82
|
+
"source": [
|
|
83
|
+
"## Visualize data"
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"cell_type": "code",
|
|
88
|
+
"execution_count": null,
|
|
89
|
+
"metadata": {},
|
|
90
|
+
"outputs": [],
|
|
91
|
+
"source": [
|
|
92
|
+
"geoai.view_vector_interactive(gdf, column=\"confidence\", tiles=raster_url)"
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"cell_type": "markdown",
|
|
97
|
+
"metadata": {},
|
|
98
|
+
"source": [
|
|
99
|
+
"## Add geometric properties"
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"cell_type": "code",
|
|
104
|
+
"execution_count": null,
|
|
105
|
+
"metadata": {},
|
|
106
|
+
"outputs": [],
|
|
107
|
+
"source": [
|
|
108
|
+
"gdf_props = geoai.add_geometric_properties(gdf, area_unit=\"m2\", length_unit=\"m\")"
|
|
109
|
+
]
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"cell_type": "code",
|
|
113
|
+
"execution_count": null,
|
|
114
|
+
"metadata": {},
|
|
115
|
+
"outputs": [],
|
|
116
|
+
"source": [
|
|
117
|
+
"gdf_props.head()"
|
|
118
|
+
]
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"cell_type": "markdown",
|
|
122
|
+
"metadata": {},
|
|
123
|
+
"source": [
|
|
124
|
+
"## Visualize geometric properties"
|
|
125
|
+
]
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"cell_type": "code",
|
|
129
|
+
"execution_count": null,
|
|
130
|
+
"metadata": {},
|
|
131
|
+
"outputs": [],
|
|
132
|
+
"source": [
|
|
133
|
+
"geoai.view_vector_interactive(gdf_props, column=\"area_m2\", tiles=raster_url)"
|
|
134
|
+
]
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"cell_type": "code",
|
|
138
|
+
"execution_count": null,
|
|
139
|
+
"metadata": {},
|
|
140
|
+
"outputs": [],
|
|
141
|
+
"source": [
|
|
142
|
+
"geoai.view_vector_interactive(gdf_props, column=\"elongation\", tiles=raster_url)"
|
|
143
|
+
]
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"cell_type": "markdown",
|
|
147
|
+
"metadata": {},
|
|
148
|
+
"source": [
|
|
149
|
+
"## Filter objects based on geometric properties"
|
|
150
|
+
]
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"cell_type": "code",
|
|
154
|
+
"execution_count": null,
|
|
155
|
+
"metadata": {},
|
|
156
|
+
"outputs": [],
|
|
157
|
+
"source": [
|
|
158
|
+
"gdf_filtered = gdf_props[(gdf_props[\"area_m2\"] < 2000) & (gdf_props[\"elongation\"] < 5)]"
|
|
159
|
+
]
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"cell_type": "markdown",
|
|
163
|
+
"metadata": {},
|
|
164
|
+
"source": [
|
|
165
|
+
"## Visualize filtered objects"
|
|
166
|
+
]
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"cell_type": "code",
|
|
170
|
+
"execution_count": null,
|
|
171
|
+
"metadata": {},
|
|
172
|
+
"outputs": [],
|
|
173
|
+
"source": [
|
|
174
|
+
"geoai.view_vector_interactive(gdf_filtered, column=\"elongation\", tiles=raster_url)"
|
|
175
|
+
]
|
|
176
|
+
}
|
|
177
|
+
],
|
|
178
|
+
"metadata": {
|
|
179
|
+
"kernelspec": {
|
|
180
|
+
"display_name": "geo",
|
|
181
|
+
"language": "python",
|
|
182
|
+
"name": "python3"
|
|
183
|
+
},
|
|
184
|
+
"language_info": {
|
|
185
|
+
"codemirror_mode": {
|
|
186
|
+
"name": "ipython",
|
|
187
|
+
"version": 3
|
|
188
|
+
},
|
|
189
|
+
"file_extension": ".py",
|
|
190
|
+
"mimetype": "text/x-python",
|
|
191
|
+
"name": "python",
|
|
192
|
+
"nbconvert_exporter": "python",
|
|
193
|
+
"pygments_lexer": "ipython3",
|
|
194
|
+
"version": "3.12.2"
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
"nbformat": 4,
|
|
198
|
+
"nbformat_minor": 2
|
|
199
|
+
}
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
[](https://pepy.tech/project/geoai-py)
|
|
5
5
|
[](https://anaconda.org/conda-forge/geoai)
|
|
6
6
|
[](https://anaconda.org/conda-forge/geoai)
|
|
7
|
-
[](https://github.com/
|
|
7
|
+
[](https://github.com/giswqs/geoai-py-feedstock)
|
|
8
8
|
[](https://opensource.org/licenses/MIT)
|
|
9
|
-
[](https://bit.ly/GeoAI-Tutorials)
|
|
10
10
|
|
|
11
11
|
**A powerful Python package for integrating Artificial Intelligence with geospatial data analysis and visualization**
|
|
12
12
|
|
|
@@ -40,7 +40,7 @@ GeoAI bridges the gap between AI and geospatial analysis, providing tools for pr
|
|
|
40
40
|
- Integration with Meta's Segment Anything Model (SAM) for automatic feature extraction
|
|
41
41
|
- Specialized segmentation algorithms optimized for satellite and aerial imagery
|
|
42
42
|
- Streamlined workflows for segmenting buildings, roads, vegetation, and water bodies
|
|
43
|
-
- Export capabilities to standard geospatial formats (GeoJSON, Shapefile, GeoPackage)
|
|
43
|
+
- Export capabilities to standard geospatial formats (GeoJSON, Shapefile, GeoPackage, GeoParquet)
|
|
44
44
|
|
|
45
45
|
### 🔍 Image Classification
|
|
46
46
|
|
|
@@ -85,6 +85,12 @@ Comprehensive documentation is available at [https://geoai.gishub.org](https://g
|
|
|
85
85
|
- Explanation of algorithms and models
|
|
86
86
|
- Best practices for geospatial AI
|
|
87
87
|
|
|
88
|
+
## 📺 Video Tutorials
|
|
89
|
+
|
|
90
|
+
Check out our [YouTube channel](https://bit.ly/GeoAI-Tutorials) for video tutorials on using GeoAI for geospatial data analysis and visualization.
|
|
91
|
+
|
|
92
|
+
[](https://bit.ly/GeoAI-Tutorials)
|
|
93
|
+
|
|
88
94
|
## 🤝 Contributing
|
|
89
95
|
|
|
90
96
|
We welcome contributions of all kinds! See our [contributing guide](https://geoai.gishub.org/contributing) for ways to get started.
|