geobox 2.2.0__tar.gz → 2.2.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.
- {geobox-2.2.0 → geobox-2.2.1}/PKG-INFO +1 -1
- {geobox-2.2.0 → geobox-2.2.1}/geobox/aio/feature.py +13 -3
- {geobox-2.2.0 → geobox-2.2.1}/geobox/feature.py +26 -5
- {geobox-2.2.0 → geobox-2.2.1}/geobox.egg-info/PKG-INFO +1 -1
- {geobox-2.2.0 → geobox-2.2.1}/pyproject.toml +1 -1
- {geobox-2.2.0 → geobox-2.2.1}/LICENSE +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/README.md +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/__init__.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/aio/__init__.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/aio/api.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/aio/apikey.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/aio/attachment.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/aio/base.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/aio/basemap.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/aio/dashboard.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/aio/field.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/aio/file.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/aio/layout.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/aio/log.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/aio/map.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/aio/model3d.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/aio/mosaic.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/aio/plan.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/aio/query.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/aio/raster.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/aio/raster_analysis.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/aio/route.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/aio/scene.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/aio/settings.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/aio/task.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/aio/tile3d.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/aio/tileset.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/aio/usage.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/aio/user.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/aio/vector_tool.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/aio/vectorlayer.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/aio/version.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/aio/view.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/aio/workflow.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/api.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/apikey.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/attachment.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/base.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/basemap.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/dashboard.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/enums.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/exception.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/field.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/file.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/layout.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/log.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/map.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/model3d.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/mosaic.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/plan.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/query.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/raster.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/raster_analysis.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/route.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/scene.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/settings.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/task.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/tile3d.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/tileset.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/usage.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/user.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/utils.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/vector_tool.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/vectorlayer.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/version.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/view.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox/workflow.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox.egg-info/SOURCES.txt +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox.egg-info/dependency_links.txt +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox.egg-info/requires.txt +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/geobox.egg-info/top_level.txt +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/setup.cfg +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/tests/test_api.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/tests/test_apikey.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/tests/test_attachment.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/tests/test_basemap.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/tests/test_dashboard.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/tests/test_feature.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/tests/test_field.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/tests/test_file.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/tests/test_layout.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/tests/test_log.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/tests/test_map.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/tests/test_model3d.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/tests/test_mosaic.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/tests/test_plan.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/tests/test_query.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/tests/test_raster.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/tests/test_raster_analysis.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/tests/test_route.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/tests/test_scene.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/tests/test_settings.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/tests/test_task.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/tests/test_tile3d.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/tests/test_tileset.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/tests/test_usage.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/tests/test_user.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/tests/test_vector_tool.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/tests/test_vectorlayer.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/tests/test_version.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/tests/test_view.py +0 -0
- {geobox-2.2.0 → geobox-2.2.1}/tests/test_workflow.py +0 -0
|
@@ -58,7 +58,8 @@ class AsyncFeature(AsyncBase):
|
|
|
58
58
|
Returns:
|
|
59
59
|
str: A string representation of the Feature object.
|
|
60
60
|
"""
|
|
61
|
-
|
|
61
|
+
feature_id = getattr(self, "id", "-1")
|
|
62
|
+
return f"AsyncFeature(id={feature_id}, type={self.feature_type})"
|
|
62
63
|
|
|
63
64
|
|
|
64
65
|
def __getattr__(self, name: str) -> Any:
|
|
@@ -210,18 +211,27 @@ class AsyncFeature(AsyncBase):
|
|
|
210
211
|
>>> await feature.save()
|
|
211
212
|
"""
|
|
212
213
|
data = self.data.copy()
|
|
214
|
+
srid = self.srid
|
|
215
|
+
|
|
213
216
|
try:
|
|
214
217
|
if self.id:
|
|
215
218
|
if self.srid != self.BASE_SRID:
|
|
216
|
-
self
|
|
219
|
+
self = self.transform(self.BASE_SRID)
|
|
220
|
+
self.data['geometry'] = self.original_geometry
|
|
217
221
|
await self.update(self.data)
|
|
218
222
|
self.coordinates = data['geometry']['coordinates']
|
|
219
223
|
except AttributeError:
|
|
224
|
+
if self.srid != self.BASE_SRID:
|
|
225
|
+
self = self.transform(self.BASE_SRID)
|
|
220
226
|
endpoint = urljoin(self.layer.endpoint, 'features/')
|
|
221
|
-
|
|
227
|
+
request_data = self.data.copy()
|
|
228
|
+
response = await self.layer.api.post(endpoint, request_data)
|
|
222
229
|
self.endpoint = urljoin(self.layer.endpoint, f'features/{response["id"]}/')
|
|
223
230
|
self.data.update(response)
|
|
224
231
|
|
|
232
|
+
self.data['geometry'] = data['geometry']
|
|
233
|
+
self._srid = srid
|
|
234
|
+
|
|
225
235
|
|
|
226
236
|
async def delete(self) -> None:
|
|
227
237
|
"""
|
|
@@ -30,7 +30,17 @@ class Feature(Base):
|
|
|
30
30
|
>>> from geobox import GeoboxClient, Feature
|
|
31
31
|
>>> client = GeoboxClient()
|
|
32
32
|
>>> layer = client.get_vector(uuid="12345678-1234-5678-1234-567812345678")
|
|
33
|
-
>>>
|
|
33
|
+
>>> geojson = {
|
|
34
|
+
... "type": "Feature",
|
|
35
|
+
... "geometry": {
|
|
36
|
+
... "type": "Point",
|
|
37
|
+
... "coordinates": [58.4, 23.6]
|
|
38
|
+
... },
|
|
39
|
+
... "properties": {
|
|
40
|
+
... "name": "Test feature"
|
|
41
|
+
... }
|
|
42
|
+
... }
|
|
43
|
+
>>> feature = Feature(layer=layer, data=geojson, srid=4326) # example srid set to 4326
|
|
34
44
|
>>> feature.save()
|
|
35
45
|
"""
|
|
36
46
|
super().__init__(api=layer.api)
|
|
@@ -65,8 +75,9 @@ class Feature(Base):
|
|
|
65
75
|
Returns:
|
|
66
76
|
str: A string representation of the Feature object.
|
|
67
77
|
"""
|
|
68
|
-
|
|
69
|
-
|
|
78
|
+
feature_id = getattr(self, "id", "-1")
|
|
79
|
+
return f"Feature(id={feature_id}, type={self.feature_type})"
|
|
80
|
+
|
|
70
81
|
|
|
71
82
|
def __getattr__(self, name: str) -> Any:
|
|
72
83
|
"""
|
|
@@ -217,18 +228,28 @@ class Feature(Base):
|
|
|
217
228
|
>>> feature.save()
|
|
218
229
|
"""
|
|
219
230
|
data = self.data.copy()
|
|
231
|
+
srid = self.srid
|
|
232
|
+
|
|
220
233
|
try:
|
|
221
234
|
if self.id:
|
|
222
235
|
if self.srid != self.BASE_SRID:
|
|
223
|
-
self
|
|
236
|
+
self = self.transform(self.BASE_SRID)
|
|
237
|
+
self.data['geometry'] = self.original_geometry
|
|
224
238
|
self.update(self.data)
|
|
225
239
|
self.coordinates = data['geometry']['coordinates']
|
|
226
240
|
except AttributeError:
|
|
241
|
+
if self.srid != self.BASE_SRID:
|
|
242
|
+
self = self.transform(self.BASE_SRID)
|
|
227
243
|
endpoint = urljoin(self.layer.endpoint, 'features/')
|
|
228
|
-
|
|
244
|
+
request_data = self.data.copy()
|
|
245
|
+
response = self.layer.api.post(endpoint, request_data)
|
|
229
246
|
self.endpoint = urljoin(self.layer.endpoint, f'features/{response["id"]}/')
|
|
230
247
|
self.data.update(response)
|
|
231
248
|
|
|
249
|
+
self.data['geometry'] = data['geometry']
|
|
250
|
+
self._srid = srid
|
|
251
|
+
|
|
252
|
+
|
|
232
253
|
|
|
233
254
|
def delete(self) -> None:
|
|
234
255
|
"""
|
|
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
|
|
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
|
|
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
|