geoai-py 0.5.1__py2.py3-none-any.whl → 0.5.3__py2.py3-none-any.whl

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/__init__.py CHANGED
@@ -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.3"
6
6
 
7
7
 
8
8
  import os
geoai/geoai.py CHANGED
@@ -1,5 +1,9 @@
1
1
  """Main module."""
2
2
 
3
+ import logging
4
+
5
+ logging.getLogger("maplibre").setLevel(logging.ERROR)
6
+
3
7
  import leafmap
4
8
  import leafmap.maplibregl as maplibregl
5
9
 
@@ -118,3 +122,90 @@ def create_vector_data(
118
122
  frame_border=frame_border,
119
123
  **kwargs,
120
124
  )
125
+
126
+
127
+ def edit_vector_data(
128
+ m: Optional[Map] = None,
129
+ filename: str = None,
130
+ properties: Optional[Dict[str, List[Any]]] = None,
131
+ time_format: str = "%Y%m%dT%H%M%S",
132
+ column_widths: Optional[List[int]] = (9, 3),
133
+ map_height: str = "600px",
134
+ out_dir: Optional[str] = None,
135
+ filename_prefix: str = "",
136
+ file_ext: str = "geojson",
137
+ add_mapillary: bool = False,
138
+ style: str = "photo",
139
+ radius: float = 0.00005,
140
+ width: int = 300,
141
+ height: int = 420,
142
+ frame_border: int = 0,
143
+ controls: Optional[List[str]] = None,
144
+ position: str = "top-right",
145
+ fit_bounds_options: Dict = None,
146
+ **kwargs: Any,
147
+ ):
148
+ """Generates a widget-based interface for creating and managing vector data on a map.
149
+
150
+ This function creates an interactive widget interface that allows users to draw features
151
+ (points, lines, polygons) on a map, assign properties to these features, and export them
152
+ as GeoJSON files. The interface includes a map, a sidebar for property management, and
153
+ buttons for saving, exporting, and resetting the data.
154
+
155
+ Args:
156
+ m (Map, optional): An existing Map object. If not provided, a default map with
157
+ basemaps and drawing controls will be created. Defaults to None.
158
+ filename (str or gpd.GeoDataFrame): The path to a GeoJSON file or a GeoDataFrame
159
+ containing the vector data to be edited. Defaults to None.
160
+ properties (Dict[str, List[Any]], optional): A dictionary where keys are property names
161
+ and values are lists of possible values for each property. These properties can be
162
+ assigned to the drawn features. Defaults to None.
163
+ time_format (str, optional): The format string for the timestamp used in the exported
164
+ filename. Defaults to "%Y%m%dT%H%M%S".
165
+ column_widths (Optional[List[int]], optional): A list of two integers specifying the
166
+ relative widths of the map and sidebar columns. Defaults to (9, 3).
167
+ map_height (str, optional): The height of the map widget. Defaults to "600px".
168
+ out_dir (str, optional): The directory where the exported GeoJSON files will be saved.
169
+ If not provided, the current working directory is used. Defaults to None.
170
+ filename_prefix (str, optional): A prefix to be added to the exported filename.
171
+ Defaults to "".
172
+ file_ext (str, optional): The file extension for the exported file. Defaults to "geojson".
173
+ add_mapillary (bool, optional): Whether to add a Mapillary image widget that displays the
174
+ nearest image to the clicked point on the map. Defaults to False.
175
+ style (str, optional): The style of the Mapillary image widget. Can be "classic", "photo",
176
+ or "split". Defaults to "photo".
177
+ radius (float, optional): The radius (in degrees) used to search for the nearest Mapillary
178
+ image. Defaults to 0.00005 degrees.
179
+ width (int, optional): The width of the Mapillary image widget. Defaults to 300.
180
+ height (int, optional): The height of the Mapillary image widget. Defaults to 420.
181
+ frame_border (int, optional): The width of the frame border for the Mapillary image widget.
182
+ Defaults to 0.
183
+ controls (Optional[List[str]], optional): The drawing controls to be added to the map.
184
+ Defaults to ["point", "polygon", "line_string", "trash"].
185
+ position (str, optional): The position of the drawing controls on the map. Defaults to "top-right".
186
+ **kwargs (Any): Additional keyword arguments that may be passed to the function.
187
+
188
+ Returns:
189
+ widgets.VBox: A vertical box widget containing the map, sidebar, and control buttons.
190
+ """
191
+ return maplibregl.edit_vector_data(
192
+ m=m,
193
+ filename=filename,
194
+ properties=properties,
195
+ time_format=time_format,
196
+ column_widths=column_widths,
197
+ map_height=map_height,
198
+ out_dir=out_dir,
199
+ filename_prefix=filename_prefix,
200
+ file_ext=file_ext,
201
+ add_mapillary=add_mapillary,
202
+ style=style,
203
+ radius=radius,
204
+ width=width,
205
+ height=height,
206
+ frame_border=frame_border,
207
+ controls=controls,
208
+ position=position,
209
+ fit_bounds_options=fit_bounds_options,
210
+ **kwargs,
211
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: geoai-py
3
- Version: 0.5.1
3
+ Version: 0.5.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
@@ -1,16 +1,16 @@
1
- geoai/__init__.py,sha256=pJWIhWx8tlrmE1KCdmmSNJFEyvGyzOBBtYWdtQanGCU,3765
1
+ geoai/__init__.py,sha256=jStw8KmV7u2Lunpz5zvB0hetngAXZHlFLKos0kVaVH8,3765
2
2
  geoai/classify.py,sha256=_e-193QzAx3pIxUflPIsIs1qZevQx5ADu7i3bOL1G70,35055
3
3
  geoai/download.py,sha256=lJ1GsJOZsKc2i6_dQyPV-XXIXmlADOpmSBo-wha4DEU,40892
4
4
  geoai/extract.py,sha256=GocJufMmrwEWxNBL1J91EXXHL8AKcO8m_lmtUF5AKPw,119102
5
- geoai/geoai.py,sha256=QGKDAenLPo1CgKZLsMFDzW7CLH1Ao2sYaWhFZG3eTpk,4896
5
+ geoai/geoai.py,sha256=CeVLiK_ly8SG6HBXb8ZrHv_WbPQS3v68NYfXskr1vMM,9270
6
6
  geoai/hf.py,sha256=mLKGxEAS5eHkxZLwuLpYc1o7e3-7QIXdBv-QUY-RkFk,17072
7
7
  geoai/segment.py,sha256=g3YW17ftr--CKq6VB32TJEPY8owGQ7uQ0sg_tUT2ooE,13681
8
8
  geoai/segmentation.py,sha256=AtPzCvguHAEeuyXafa4bzMFATvltEYcah1B8ZMfkM_s,11373
9
9
  geoai/train.py,sha256=mQXat2yuddT-2rME4xnX_m3SkY23E_-zdxLnBIKxw8o,44091
10
10
  geoai/utils.py,sha256=5BZTL9QlJGEs9uw5w6i_aZ4s8SH_FGvb6ZFlIyEHEZI,239703
11
- geoai_py-0.5.1.dist-info/licenses/LICENSE,sha256=vN2L5U7cZ6ZkOHFmc8WiGlsogWsZc5dllMeNxnKVOZg,1070
12
- geoai_py-0.5.1.dist-info/METADATA,sha256=9_A_dN9Vnl5C4Q_i7N8OdgTTo1Ke4wunve3ChsUvQnA,6637
13
- geoai_py-0.5.1.dist-info/WHEEL,sha256=MAQBAzGbXNI3bUmkDsiV_duv8i-gcdnLzw7cfUFwqhU,109
14
- geoai_py-0.5.1.dist-info/entry_points.txt,sha256=uGp3Az3HURIsRHP9v-ys0hIbUuBBNUfXv6VbYHIXeg4,41
15
- geoai_py-0.5.1.dist-info/top_level.txt,sha256=1YkCUWu-ii-0qIex7kbwAvfei-gos9ycyDyUCJPNWHY,6
16
- geoai_py-0.5.1.dist-info/RECORD,,
11
+ geoai_py-0.5.3.dist-info/licenses/LICENSE,sha256=vN2L5U7cZ6ZkOHFmc8WiGlsogWsZc5dllMeNxnKVOZg,1070
12
+ geoai_py-0.5.3.dist-info/METADATA,sha256=PWPPZoHB-5IHNgWz7vL1jq3skgeKCmgNSmQjdLo6klA,6637
13
+ geoai_py-0.5.3.dist-info/WHEEL,sha256=MAQBAzGbXNI3bUmkDsiV_duv8i-gcdnLzw7cfUFwqhU,109
14
+ geoai_py-0.5.3.dist-info/entry_points.txt,sha256=uGp3Az3HURIsRHP9v-ys0hIbUuBBNUfXv6VbYHIXeg4,41
15
+ geoai_py-0.5.3.dist-info/top_level.txt,sha256=1YkCUWu-ii-0qIex7kbwAvfei-gos9ycyDyUCJPNWHY,6
16
+ geoai_py-0.5.3.dist-info/RECORD,,