geoai-py 0.5.1__tar.gz → 0.5.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 (105) hide show
  1. {geoai_py-0.5.1 → geoai_py-0.5.2}/PKG-INFO +1 -1
  2. geoai_py-0.5.2/docs/examples/edit_vector.ipynb +124 -0
  3. {geoai_py-0.5.1 → geoai_py-0.5.2}/geoai/__init__.py +1 -1
  4. {geoai_py-0.5.1 → geoai_py-0.5.2}/geoai/geoai.py +87 -0
  5. {geoai_py-0.5.1 → geoai_py-0.5.2}/geoai_py.egg-info/PKG-INFO +1 -1
  6. {geoai_py-0.5.1 → geoai_py-0.5.2}/geoai_py.egg-info/SOURCES.txt +1 -0
  7. {geoai_py-0.5.1 → geoai_py-0.5.2}/mkdocs.yml +1 -0
  8. {geoai_py-0.5.1 → geoai_py-0.5.2}/pyproject.toml +2 -2
  9. {geoai_py-0.5.1 → geoai_py-0.5.2}/.editorconfig +0 -0
  10. {geoai_py-0.5.1 → geoai_py-0.5.2}/.github/FUNDING.yml +0 -0
  11. {geoai_py-0.5.1 → geoai_py-0.5.2}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  12. {geoai_py-0.5.1 → geoai_py-0.5.2}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  13. {geoai_py-0.5.1 → geoai_py-0.5.2}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  14. {geoai_py-0.5.1 → geoai_py-0.5.2}/.github/dependabot.yml +0 -0
  15. {geoai_py-0.5.1 → geoai_py-0.5.2}/.github/workflows/docs-build.yml +0 -0
  16. {geoai_py-0.5.1 → geoai_py-0.5.2}/.github/workflows/docs.yml +0 -0
  17. {geoai_py-0.5.1 → geoai_py-0.5.2}/.github/workflows/macos.yml +0 -0
  18. {geoai_py-0.5.1 → geoai_py-0.5.2}/.github/workflows/pypi.yml +0 -0
  19. {geoai_py-0.5.1 → geoai_py-0.5.2}/.github/workflows/ubuntu.yml +0 -0
  20. {geoai_py-0.5.1 → geoai_py-0.5.2}/.github/workflows/windows.yml +0 -0
  21. {geoai_py-0.5.1 → geoai_py-0.5.2}/.gitignore +0 -0
  22. {geoai_py-0.5.1 → geoai_py-0.5.2}/.pre-commit-config.yaml +0 -0
  23. {geoai_py-0.5.1 → geoai_py-0.5.2}/LICENSE +0 -0
  24. {geoai_py-0.5.1 → geoai_py-0.5.2}/MANIFEST.in +0 -0
  25. {geoai_py-0.5.1 → geoai_py-0.5.2}/README.md +0 -0
  26. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/CNAME +0 -0
  27. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/assets/logo.ico +0 -0
  28. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/assets/logo.png +0 -0
  29. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/assets/logo_rect.png +0 -0
  30. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/changelog.md +0 -0
  31. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/classify.md +0 -0
  32. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/contributing.md +0 -0
  33. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/download.md +0 -0
  34. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/examples/_template.ipynb +0 -0
  35. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/examples/building_footprints_africa.ipynb +0 -0
  36. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/examples/building_footprints_china.ipynb +0 -0
  37. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/examples/building_footprints_usa.ipynb +0 -0
  38. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/examples/building_regularization.ipynb +0 -0
  39. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/examples/car_detection.ipynb +0 -0
  40. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/examples/create_vector.ipynb +0 -0
  41. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/examples/data_visualization.ipynb +0 -0
  42. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/examples/dataviz/lidar_viz.ipynb +0 -0
  43. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/examples/dataviz/raster_viz.ipynb +0 -0
  44. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/examples/dataviz/vector_viz.ipynb +0 -0
  45. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/examples/download_data.ipynb +0 -0
  46. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/examples/download_sentinel2.ipynb +0 -0
  47. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/examples/geometric_properties.ipynb +0 -0
  48. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/examples/image_chips.ipynb +0 -0
  49. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/examples/jupytext.toml +0 -0
  50. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/examples/parking_spot_detection.ipynb +0 -0
  51. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/examples/planetary_computer.ipynb +0 -0
  52. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/examples/rastervision/semantic_segmentation.ipynb +0 -0
  53. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/examples/samgeo/arcgis.ipynb +0 -0
  54. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/examples/samgeo/automatic_mask_generator.ipynb +0 -0
  55. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/examples/samgeo/automatic_mask_generator_hq.ipynb +0 -0
  56. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/examples/samgeo/box_prompts.ipynb +0 -0
  57. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/examples/samgeo/fast_sam.ipynb +0 -0
  58. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/examples/samgeo/input_prompts.ipynb +0 -0
  59. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/examples/samgeo/input_prompts_hq.ipynb +0 -0
  60. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/examples/samgeo/maxar_open_data.ipynb +0 -0
  61. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/examples/samgeo/satellite-predictor.ipynb +0 -0
  62. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/examples/samgeo/satellite.ipynb +0 -0
  63. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/examples/samgeo/swimming_pools.ipynb +0 -0
  64. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/examples/samgeo/text_prompts.ipynb +0 -0
  65. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/examples/samgeo/text_prompts_batch.ipynb +0 -0
  66. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/examples/ship_detection.ipynb +0 -0
  67. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/examples/solar_panel_detection.ipynb +0 -0
  68. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/examples/text_prompt_segmentation.ipynb +0 -0
  69. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/examples/train_building_footprints_usa.ipynb +0 -0
  70. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/examples/train_car_detection.ipynb +0 -0
  71. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/examples/train_object_detection_model.ipynb +0 -0
  72. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/examples/train_ship_detection.ipynb +0 -0
  73. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/examples/train_solar_panel_detection.ipynb +0 -0
  74. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/examples/train_water_detection.ipynb +0 -0
  75. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/examples/view_metadata.ipynb +0 -0
  76. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/examples/wetland_mapping.ipynb +0 -0
  77. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/extract.md +0 -0
  78. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/faq.md +0 -0
  79. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/geoai.md +0 -0
  80. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/hf.md +0 -0
  81. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/index.md +0 -0
  82. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/installation.md +0 -0
  83. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/overrides/main.html +0 -0
  84. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/segment.md +0 -0
  85. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/segmentation.md +0 -0
  86. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/train.md +0 -0
  87. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/usage.md +0 -0
  88. {geoai_py-0.5.1 → geoai_py-0.5.2}/docs/utils.md +0 -0
  89. {geoai_py-0.5.1 → geoai_py-0.5.2}/geoai/classify.py +0 -0
  90. {geoai_py-0.5.1 → geoai_py-0.5.2}/geoai/download.py +0 -0
  91. {geoai_py-0.5.1 → geoai_py-0.5.2}/geoai/extract.py +0 -0
  92. {geoai_py-0.5.1 → geoai_py-0.5.2}/geoai/hf.py +0 -0
  93. {geoai_py-0.5.1 → geoai_py-0.5.2}/geoai/segment.py +0 -0
  94. {geoai_py-0.5.1 → geoai_py-0.5.2}/geoai/segmentation.py +0 -0
  95. {geoai_py-0.5.1 → geoai_py-0.5.2}/geoai/train.py +0 -0
  96. {geoai_py-0.5.1 → geoai_py-0.5.2}/geoai/utils.py +0 -0
  97. {geoai_py-0.5.1 → geoai_py-0.5.2}/geoai_py.egg-info/dependency_links.txt +0 -0
  98. {geoai_py-0.5.1 → geoai_py-0.5.2}/geoai_py.egg-info/entry_points.txt +0 -0
  99. {geoai_py-0.5.1 → geoai_py-0.5.2}/geoai_py.egg-info/requires.txt +0 -0
  100. {geoai_py-0.5.1 → geoai_py-0.5.2}/geoai_py.egg-info/top_level.txt +0 -0
  101. {geoai_py-0.5.1 → geoai_py-0.5.2}/requirements.txt +0 -0
  102. {geoai_py-0.5.1 → geoai_py-0.5.2}/requirements_docs.txt +0 -0
  103. {geoai_py-0.5.1 → geoai_py-0.5.2}/setup.cfg +0 -0
  104. {geoai_py-0.5.1 → geoai_py-0.5.2}/tests/__init__.py +0 -0
  105. {geoai_py-0.5.1 → geoai_py-0.5.2}/tests/test_geoai.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: geoai-py
3
- Version: 0.5.1
3
+ Version: 0.5.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
@@ -0,0 +1,124 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "metadata": {},
6
+ "source": [
7
+ "# Edit vector labels for training deep learning models\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/edit_vector.ipynb)\n",
10
+ "\n",
11
+ "## Install package\n",
12
+ "To use the `geoai-py` package, ensure it is installed in your environment. Uncomment the command below if needed."
13
+ ]
14
+ },
15
+ {
16
+ "cell_type": "code",
17
+ "execution_count": null,
18
+ "metadata": {},
19
+ "outputs": [],
20
+ "source": [
21
+ "# %pip install geoai-py"
22
+ ]
23
+ },
24
+ {
25
+ "cell_type": "markdown",
26
+ "metadata": {},
27
+ "source": [
28
+ "## Import libraries"
29
+ ]
30
+ },
31
+ {
32
+ "cell_type": "code",
33
+ "execution_count": null,
34
+ "metadata": {},
35
+ "outputs": [],
36
+ "source": [
37
+ "import geoai"
38
+ ]
39
+ },
40
+ {
41
+ "cell_type": "markdown",
42
+ "metadata": {},
43
+ "source": [
44
+ "## Add sample datasets"
45
+ ]
46
+ },
47
+ {
48
+ "cell_type": "code",
49
+ "execution_count": null,
50
+ "metadata": {},
51
+ "outputs": [],
52
+ "source": [
53
+ "m = geoai.MapLibre()\n",
54
+ "m.add_basemap(\"Google Satellite\")\n",
55
+ "url = \"https://huggingface.co/datasets/giswqs/geospatial/resolve/main/naip_train_buildings.geojson\""
56
+ ]
57
+ },
58
+ {
59
+ "cell_type": "markdown",
60
+ "metadata": {},
61
+ "source": [
62
+ "## Set default properties"
63
+ ]
64
+ },
65
+ {
66
+ "cell_type": "code",
67
+ "execution_count": null,
68
+ "metadata": {},
69
+ "outputs": [],
70
+ "source": [
71
+ "properties = {\n",
72
+ " \"class\": [\"apartments\", \"terrace\", \"detached\", \"house\", \"shed\", None],\n",
73
+ " \"height\": 0.0,\n",
74
+ "}"
75
+ ]
76
+ },
77
+ {
78
+ "cell_type": "markdown",
79
+ "metadata": {},
80
+ "source": [
81
+ "## Display the interactive widget"
82
+ ]
83
+ },
84
+ {
85
+ "cell_type": "code",
86
+ "execution_count": null,
87
+ "metadata": {},
88
+ "outputs": [],
89
+ "source": [
90
+ "widget = geoai.edit_vector_data(m, url, properties=properties)\n",
91
+ "m.add_layer_control()\n",
92
+ "widget"
93
+ ]
94
+ },
95
+ {
96
+ "cell_type": "markdown",
97
+ "metadata": {},
98
+ "source": [
99
+ "![image](https://github.com/user-attachments/assets/c86f78ee-1f50-418e-981e-b01fe61b2b53)"
100
+ ]
101
+ }
102
+ ],
103
+ "metadata": {
104
+ "kernelspec": {
105
+ "display_name": "Python 3 (ipykernel)",
106
+ "language": "python",
107
+ "name": "python3"
108
+ },
109
+ "language_info": {
110
+ "codemirror_mode": {
111
+ "name": "ipython",
112
+ "version": 3
113
+ },
114
+ "file_extension": ".py",
115
+ "mimetype": "text/x-python",
116
+ "name": "python",
117
+ "nbconvert_exporter": "python",
118
+ "pygments_lexer": "ipython3",
119
+ "version": "3.12.2"
120
+ }
121
+ },
122
+ "nbformat": 4,
123
+ "nbformat_minor": 4
124
+ }
@@ -2,7 +2,7 @@
2
2
 
3
3
  __author__ = """Qiusheng Wu"""
4
4
  __email__ = "giswqs@gmail.com"
5
- __version__ = "0.5.1"
5
+ __version__ = "0.5.2"
6
6
 
7
7
 
8
8
  import os
@@ -118,3 +118,90 @@ def create_vector_data(
118
118
  frame_border=frame_border,
119
119
  **kwargs,
120
120
  )
121
+
122
+
123
+ def edit_vector_data(
124
+ m: Optional[Map] = None,
125
+ filename: str = None,
126
+ properties: Optional[Dict[str, List[Any]]] = None,
127
+ time_format: str = "%Y%m%dT%H%M%S",
128
+ column_widths: Optional[List[int]] = (9, 3),
129
+ map_height: str = "600px",
130
+ out_dir: Optional[str] = None,
131
+ filename_prefix: str = "",
132
+ file_ext: str = "geojson",
133
+ add_mapillary: bool = False,
134
+ style: str = "photo",
135
+ radius: float = 0.00005,
136
+ width: int = 300,
137
+ height: int = 420,
138
+ frame_border: int = 0,
139
+ controls: Optional[List[str]] = None,
140
+ position: str = "top-right",
141
+ fit_bounds_options: Dict = None,
142
+ **kwargs: Any,
143
+ ):
144
+ """Generates a widget-based interface for creating and managing vector data on a map.
145
+
146
+ This function creates an interactive widget interface that allows users to draw features
147
+ (points, lines, polygons) on a map, assign properties to these features, and export them
148
+ as GeoJSON files. The interface includes a map, a sidebar for property management, and
149
+ buttons for saving, exporting, and resetting the data.
150
+
151
+ Args:
152
+ m (Map, optional): An existing Map object. If not provided, a default map with
153
+ basemaps and drawing controls will be created. Defaults to None.
154
+ filename (str or gpd.GeoDataFrame): The path to a GeoJSON file or a GeoDataFrame
155
+ containing the vector data to be edited. Defaults to None.
156
+ properties (Dict[str, List[Any]], optional): A dictionary where keys are property names
157
+ and values are lists of possible values for each property. These properties can be
158
+ assigned to the drawn features. Defaults to None.
159
+ time_format (str, optional): The format string for the timestamp used in the exported
160
+ filename. Defaults to "%Y%m%dT%H%M%S".
161
+ column_widths (Optional[List[int]], optional): A list of two integers specifying the
162
+ relative widths of the map and sidebar columns. Defaults to (9, 3).
163
+ map_height (str, optional): The height of the map widget. Defaults to "600px".
164
+ out_dir (str, optional): The directory where the exported GeoJSON files will be saved.
165
+ If not provided, the current working directory is used. Defaults to None.
166
+ filename_prefix (str, optional): A prefix to be added to the exported filename.
167
+ Defaults to "".
168
+ file_ext (str, optional): The file extension for the exported file. Defaults to "geojson".
169
+ add_mapillary (bool, optional): Whether to add a Mapillary image widget that displays the
170
+ nearest image to the clicked point on the map. Defaults to False.
171
+ style (str, optional): The style of the Mapillary image widget. Can be "classic", "photo",
172
+ or "split". Defaults to "photo".
173
+ radius (float, optional): The radius (in degrees) used to search for the nearest Mapillary
174
+ image. Defaults to 0.00005 degrees.
175
+ width (int, optional): The width of the Mapillary image widget. Defaults to 300.
176
+ height (int, optional): The height of the Mapillary image widget. Defaults to 420.
177
+ frame_border (int, optional): The width of the frame border for the Mapillary image widget.
178
+ Defaults to 0.
179
+ controls (Optional[List[str]], optional): The drawing controls to be added to the map.
180
+ Defaults to ["point", "polygon", "line_string", "trash"].
181
+ position (str, optional): The position of the drawing controls on the map. Defaults to "top-right".
182
+ **kwargs (Any): Additional keyword arguments that may be passed to the function.
183
+
184
+ Returns:
185
+ widgets.VBox: A vertical box widget containing the map, sidebar, and control buttons.
186
+ """
187
+ return maplibregl.edit_vector_data(
188
+ m=m,
189
+ filename=filename,
190
+ properties=properties,
191
+ time_format=time_format,
192
+ column_widths=column_widths,
193
+ map_height=map_height,
194
+ out_dir=out_dir,
195
+ filename_prefix=filename_prefix,
196
+ file_ext=file_ext,
197
+ add_mapillary=add_mapillary,
198
+ style=style,
199
+ radius=radius,
200
+ width=width,
201
+ height=height,
202
+ frame_border=frame_border,
203
+ controls=controls,
204
+ position=position,
205
+ fit_bounds_options=fit_bounds_options,
206
+ **kwargs,
207
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: geoai-py
3
- Version: 0.5.1
3
+ Version: 0.5.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
@@ -48,6 +48,7 @@ docs/examples/create_vector.ipynb
48
48
  docs/examples/data_visualization.ipynb
49
49
  docs/examples/download_data.ipynb
50
50
  docs/examples/download_sentinel2.ipynb
51
+ docs/examples/edit_vector.ipynb
51
52
  docs/examples/geometric_properties.ipynb
52
53
  docs/examples/image_chips.ipynb
53
54
  docs/examples/jupytext.toml
@@ -104,6 +104,7 @@ nav:
104
104
  - examples/planetary_computer.ipynb
105
105
  - examples/view_metadata.ipynb
106
106
  - examples/create_vector.ipynb
107
+ - examples/edit_vector.ipynb
107
108
  - examples/image_chips.ipynb
108
109
  - examples/building_footprints_usa.ipynb
109
110
  - examples/building_footprints_africa.ipynb
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "geoai-py"
3
- version = "0.5.1"
3
+ version = "0.5.2"
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.5.1"
47
+ current_version = "0.5.2"
48
48
  commit = true
49
49
  tag = true
50
50
 
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
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