geobox 2.2.1__tar.gz → 2.2.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.
- {geobox-2.2.1 → geobox-2.2.3}/PKG-INFO +1 -1
- {geobox-2.2.1 → geobox-2.2.3}/geobox/aio/feature.py +32 -12
- {geobox-2.2.1 → geobox-2.2.3}/geobox/aio/task.py +4 -1
- {geobox-2.2.1 → geobox-2.2.3}/geobox/aio/vectorlayer.py +3 -2
- {geobox-2.2.1 → geobox-2.2.3}/geobox/feature.py +33 -12
- {geobox-2.2.1 → geobox-2.2.3}/geobox/task.py +4 -1
- {geobox-2.2.1 → geobox-2.2.3}/geobox/vectorlayer.py +3 -2
- {geobox-2.2.1 → geobox-2.2.3}/geobox.egg-info/PKG-INFO +1 -1
- {geobox-2.2.1 → geobox-2.2.3}/pyproject.toml +1 -1
- {geobox-2.2.1 → geobox-2.2.3}/tests/test_feature.py +506 -450
- {geobox-2.2.1 → geobox-2.2.3}/LICENSE +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/README.md +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/__init__.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/aio/__init__.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/aio/api.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/aio/apikey.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/aio/attachment.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/aio/base.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/aio/basemap.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/aio/dashboard.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/aio/field.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/aio/file.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/aio/layout.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/aio/log.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/aio/map.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/aio/model3d.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/aio/mosaic.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/aio/plan.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/aio/query.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/aio/raster.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/aio/raster_analysis.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/aio/route.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/aio/scene.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/aio/settings.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/aio/tile3d.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/aio/tileset.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/aio/usage.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/aio/user.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/aio/vector_tool.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/aio/version.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/aio/view.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/aio/workflow.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/api.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/apikey.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/attachment.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/base.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/basemap.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/dashboard.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/enums.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/exception.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/field.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/file.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/layout.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/log.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/map.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/model3d.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/mosaic.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/plan.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/query.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/raster.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/raster_analysis.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/route.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/scene.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/settings.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/tile3d.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/tileset.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/usage.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/user.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/utils.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/vector_tool.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/version.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/view.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox/workflow.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox.egg-info/SOURCES.txt +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox.egg-info/dependency_links.txt +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox.egg-info/requires.txt +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/geobox.egg-info/top_level.txt +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/setup.cfg +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/tests/test_api.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/tests/test_apikey.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/tests/test_attachment.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/tests/test_basemap.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/tests/test_dashboard.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/tests/test_field.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/tests/test_file.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/tests/test_layout.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/tests/test_log.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/tests/test_map.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/tests/test_model3d.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/tests/test_mosaic.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/tests/test_plan.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/tests/test_query.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/tests/test_raster.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/tests/test_raster_analysis.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/tests/test_route.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/tests/test_scene.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/tests/test_settings.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/tests/test_task.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/tests/test_tile3d.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/tests/test_tileset.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/tests/test_usage.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/tests/test_user.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/tests/test_vector_tool.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/tests/test_vectorlayer.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/tests/test_version.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/tests/test_view.py +0 -0
- {geobox-2.2.1 → geobox-2.2.3}/tests/test_workflow.py +0 -0
|
@@ -29,7 +29,11 @@ class AsyncFeature(AsyncBase):
|
|
|
29
29
|
super().__init__(api=layer.api)
|
|
30
30
|
self.layer = layer
|
|
31
31
|
self._srid = srid
|
|
32
|
-
self.data = data or {
|
|
32
|
+
self.data = data or {
|
|
33
|
+
"type": "Feature",
|
|
34
|
+
"geometry": {},
|
|
35
|
+
"properties": {}
|
|
36
|
+
}
|
|
33
37
|
self.original_geometry = self.data.get('geometry')
|
|
34
38
|
self.endpoint = urljoin(layer.endpoint, f'features/{self.data.get("id")}/') if self.data.get('id') else None
|
|
35
39
|
|
|
@@ -215,11 +219,8 @@ class AsyncFeature(AsyncBase):
|
|
|
215
219
|
|
|
216
220
|
try:
|
|
217
221
|
if self.id:
|
|
218
|
-
if self.srid != self.BASE_SRID:
|
|
219
|
-
self = self.transform(self.BASE_SRID)
|
|
220
|
-
self.data['geometry'] = self.original_geometry
|
|
221
222
|
await self.update(self.data)
|
|
222
|
-
|
|
223
|
+
|
|
223
224
|
except AttributeError:
|
|
224
225
|
if self.srid != self.BASE_SRID:
|
|
225
226
|
self = self.transform(self.BASE_SRID)
|
|
@@ -273,17 +274,28 @@ class AsyncFeature(AsyncBase):
|
|
|
273
274
|
... }
|
|
274
275
|
>>> await feature.update(geojson)
|
|
275
276
|
"""
|
|
276
|
-
|
|
277
|
+
self.data = geojson
|
|
278
|
+
data = self.data.copy()
|
|
279
|
+
srid = self.srid
|
|
280
|
+
|
|
281
|
+
if self.srid != self.BASE_SRID:
|
|
282
|
+
self = self.transform(self.BASE_SRID)
|
|
283
|
+
|
|
284
|
+
await super()._update(self.endpoint, self.data, clean=False)
|
|
285
|
+
self.data['geometry'] = data['geometry']
|
|
286
|
+
self._srid = srid
|
|
287
|
+
return self.data
|
|
277
288
|
|
|
278
289
|
|
|
279
290
|
@classmethod
|
|
280
|
-
async def create_feature(cls, layer: 'VectorLayer', geojson: Dict) -> 'AsyncFeature':
|
|
291
|
+
async def create_feature(cls, layer: 'VectorLayer', geojson: Dict, srid: int = 3857) -> 'AsyncFeature':
|
|
281
292
|
"""
|
|
282
293
|
[async] Create a new feature in the vector layer.
|
|
283
294
|
|
|
284
295
|
Args:
|
|
285
296
|
layer (VectorLayer): The vector layer to create the feature in
|
|
286
297
|
geojson (Dict): The GeoJSON data for the feature
|
|
298
|
+
srid (int, optional): the feature srid. default: 3857
|
|
287
299
|
|
|
288
300
|
Returns:
|
|
289
301
|
AsyncFeature: The created feature instance
|
|
@@ -299,8 +311,19 @@ class AsyncFeature(AsyncBase):
|
|
|
299
311
|
... }
|
|
300
312
|
>>> feature = await Feature.create_feature(layer, geojson)
|
|
301
313
|
"""
|
|
314
|
+
feature = AsyncFeature(layer, srid=srid, data=geojson)
|
|
315
|
+
data = feature.data.copy()
|
|
316
|
+
srid = feature.srid
|
|
317
|
+
|
|
318
|
+
if feature.srid != feature.BASE_SRID:
|
|
319
|
+
feature = feature.transform(feature.BASE_SRID)
|
|
320
|
+
|
|
302
321
|
endpoint = urljoin(layer.endpoint, 'features/')
|
|
303
|
-
|
|
322
|
+
|
|
323
|
+
feature = await cls._create(layer.api, endpoint, feature.data, factory_func=lambda api, item: AsyncFeature(layer, data=item))
|
|
324
|
+
feature.data['geometry'] = data['geometry']
|
|
325
|
+
feature._srid = srid
|
|
326
|
+
return feature
|
|
304
327
|
|
|
305
328
|
|
|
306
329
|
@classmethod
|
|
@@ -360,10 +383,7 @@ class AsyncFeature(AsyncBase):
|
|
|
360
383
|
"Install it with: pip install geobox[geometry]"
|
|
361
384
|
)
|
|
362
385
|
|
|
363
|
-
if not self.data:
|
|
364
|
-
return None
|
|
365
|
-
|
|
366
|
-
elif not self.data.get('geometry'):
|
|
386
|
+
if not self.data.get('geometry'):
|
|
367
387
|
raise ValueError("Geometry is not present in the feature data")
|
|
368
388
|
|
|
369
389
|
elif not isinstance(self.data['geometry'], dict):
|
|
@@ -2,6 +2,7 @@ import time
|
|
|
2
2
|
import asyncio
|
|
3
3
|
from urllib.parse import urljoin
|
|
4
4
|
from typing import Optional, Dict, List, Optional, Union, TYPE_CHECKING
|
|
5
|
+
import logging
|
|
5
6
|
|
|
6
7
|
from .base import AsyncBase
|
|
7
8
|
from ..enums import TaskStatus
|
|
@@ -16,6 +17,8 @@ if TYPE_CHECKING:
|
|
|
16
17
|
from ..api import GeoboxClient
|
|
17
18
|
from ..task import Task
|
|
18
19
|
|
|
20
|
+
logger = logging.getLogger(__name__)
|
|
21
|
+
|
|
19
22
|
|
|
20
23
|
class AsyncTask(AsyncBase):
|
|
21
24
|
|
|
@@ -233,7 +236,7 @@ class AsyncTask(AsyncBase):
|
|
|
233
236
|
return await self._wait(timeout, interval, progress_bar)
|
|
234
237
|
except Exception as e:
|
|
235
238
|
last_exception = e
|
|
236
|
-
|
|
239
|
+
logger.warning(f"[Retry {attempt}/{retry}] Task wait failed: {e}")
|
|
237
240
|
time.sleep(interval)
|
|
238
241
|
raise last_exception
|
|
239
242
|
|
|
@@ -755,12 +755,13 @@ class AsyncVectorLayer(AsyncBase):
|
|
|
755
755
|
return feature
|
|
756
756
|
|
|
757
757
|
|
|
758
|
-
async def create_feature(self, geojson: Dict)-> 'AsyncFeature':
|
|
758
|
+
async def create_feature(self, geojson: Dict, srid: int = AsyncFeature.BASE_SRID)-> 'AsyncFeature':
|
|
759
759
|
"""
|
|
760
760
|
[async] Create a new feature in the layer.
|
|
761
761
|
|
|
762
762
|
Args:
|
|
763
763
|
geojson (Dict): The feature data including properties and geometry.
|
|
764
|
+
srid (int, optional): the feature srid. default: 3857
|
|
764
765
|
|
|
765
766
|
Returns:
|
|
766
767
|
Feature: The newly created feature instance.
|
|
@@ -780,7 +781,7 @@ class AsyncVectorLayer(AsyncBase):
|
|
|
780
781
|
... }
|
|
781
782
|
>>> feature = await layer.create_feature(geojson=geojson)
|
|
782
783
|
"""
|
|
783
|
-
return await AsyncFeature.create_feature(self, geojson)
|
|
784
|
+
return await AsyncFeature.create_feature(self, geojson, srid=srid)
|
|
784
785
|
|
|
785
786
|
|
|
786
787
|
async def delete_features(self,
|
|
@@ -34,7 +34,7 @@ class Feature(Base):
|
|
|
34
34
|
... "type": "Feature",
|
|
35
35
|
... "geometry": {
|
|
36
36
|
... "type": "Point",
|
|
37
|
-
... "coordinates": [
|
|
37
|
+
... "coordinates": [10.0, 10.0]
|
|
38
38
|
... },
|
|
39
39
|
... "properties": {
|
|
40
40
|
... "name": "Test feature"
|
|
@@ -46,7 +46,11 @@ class Feature(Base):
|
|
|
46
46
|
super().__init__(api=layer.api)
|
|
47
47
|
self.layer = layer
|
|
48
48
|
self._srid = srid
|
|
49
|
-
self.data = data or {
|
|
49
|
+
self.data = data or {
|
|
50
|
+
"type": "Feature",
|
|
51
|
+
"geometry": {},
|
|
52
|
+
"properties": {}
|
|
53
|
+
}
|
|
50
54
|
self.original_geometry = self.data.get('geometry')
|
|
51
55
|
self.endpoint = urljoin(layer.endpoint, f'features/{self.data.get("id")}/') if self.data.get('id') else None
|
|
52
56
|
|
|
@@ -232,11 +236,8 @@ class Feature(Base):
|
|
|
232
236
|
|
|
233
237
|
try:
|
|
234
238
|
if self.id:
|
|
235
|
-
if self.srid != self.BASE_SRID:
|
|
236
|
-
self = self.transform(self.BASE_SRID)
|
|
237
|
-
self.data['geometry'] = self.original_geometry
|
|
238
239
|
self.update(self.data)
|
|
239
|
-
|
|
240
|
+
|
|
240
241
|
except AttributeError:
|
|
241
242
|
if self.srid != self.BASE_SRID:
|
|
242
243
|
self = self.transform(self.BASE_SRID)
|
|
@@ -291,17 +292,28 @@ class Feature(Base):
|
|
|
291
292
|
... }
|
|
292
293
|
>>> feature.update(geojson)
|
|
293
294
|
"""
|
|
294
|
-
|
|
295
|
+
self.data = geojson
|
|
296
|
+
data = self.data.copy()
|
|
297
|
+
srid = self.srid
|
|
298
|
+
|
|
299
|
+
if self.srid != self.BASE_SRID:
|
|
300
|
+
self = self.transform(self.BASE_SRID)
|
|
301
|
+
|
|
302
|
+
super()._update(self.endpoint, self.data, clean=False)
|
|
303
|
+
self.data['geometry'] = data['geometry']
|
|
304
|
+
self._srid = srid
|
|
305
|
+
return self.data
|
|
295
306
|
|
|
296
307
|
|
|
297
308
|
@classmethod
|
|
298
|
-
def create_feature(cls, layer: 'VectorLayer', geojson: Dict) -> 'Feature':
|
|
309
|
+
def create_feature(cls, layer: 'VectorLayer', geojson: Dict, srid: int = 3857) -> 'Feature':
|
|
299
310
|
"""
|
|
300
311
|
Create a new feature in the vector layer.
|
|
301
312
|
|
|
302
313
|
Args:
|
|
303
314
|
layer (VectorLayer): The vector layer to create the feature in
|
|
304
315
|
geojson (Dict): The GeoJSON data for the feature
|
|
316
|
+
srid (int, optional): the feature srid. default: 3857
|
|
305
317
|
|
|
306
318
|
Returns:
|
|
307
319
|
Feature: The created feature instance
|
|
@@ -318,8 +330,19 @@ class Feature(Base):
|
|
|
318
330
|
... }
|
|
319
331
|
>>> feature = Feature.create_feature(layer, geojson)
|
|
320
332
|
"""
|
|
333
|
+
feature = Feature(layer, srid=srid, data=geojson)
|
|
334
|
+
data = feature.data.copy()
|
|
335
|
+
srid = feature.srid
|
|
336
|
+
|
|
337
|
+
if feature.srid != feature.BASE_SRID:
|
|
338
|
+
feature = feature.transform(feature.BASE_SRID)
|
|
339
|
+
|
|
321
340
|
endpoint = urljoin(layer.endpoint, 'features/')
|
|
322
|
-
|
|
341
|
+
|
|
342
|
+
feature = cls._create(layer.api, endpoint, feature.data, factory_func=lambda api, item: Feature(layer, data=item))
|
|
343
|
+
feature.data['geometry'] = data['geometry']
|
|
344
|
+
feature._srid = srid
|
|
345
|
+
return feature
|
|
323
346
|
|
|
324
347
|
|
|
325
348
|
@classmethod
|
|
@@ -380,10 +403,8 @@ class Feature(Base):
|
|
|
380
403
|
"Install it with: pip install geobox[geometry]"
|
|
381
404
|
)
|
|
382
405
|
|
|
383
|
-
if not self.data:
|
|
384
|
-
return None
|
|
385
406
|
|
|
386
|
-
|
|
407
|
+
if not self.data.get('geometry'):
|
|
387
408
|
raise ValueError("Geometry is not present in the feature data")
|
|
388
409
|
|
|
389
410
|
elif not isinstance(self.data['geometry'], dict):
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from urllib.parse import urljoin, urlencode
|
|
2
2
|
from typing import Optional, Dict, List, Optional, Union, TYPE_CHECKING
|
|
3
3
|
import time
|
|
4
|
+
import logging
|
|
4
5
|
|
|
5
6
|
from .base import Base
|
|
6
7
|
from .enums import TaskStatus
|
|
@@ -15,6 +16,8 @@ if TYPE_CHECKING:
|
|
|
15
16
|
from .aio import AsyncGeoboxClient
|
|
16
17
|
from .aio.task import AsyncTask
|
|
17
18
|
|
|
19
|
+
logger = logging.getLogger(__name__)
|
|
20
|
+
|
|
18
21
|
|
|
19
22
|
class Task(Base):
|
|
20
23
|
|
|
@@ -230,7 +233,7 @@ class Task(Base):
|
|
|
230
233
|
return self._wait(timeout, interval, progress_bar)
|
|
231
234
|
except Exception as e:
|
|
232
235
|
last_exception = e
|
|
233
|
-
|
|
236
|
+
logger.warning(f"[Retry {attempt}/{retry}] Task wait failed: {e}")
|
|
234
237
|
time.sleep(interval)
|
|
235
238
|
raise last_exception
|
|
236
239
|
|
|
@@ -756,12 +756,13 @@ class VectorLayer(Base):
|
|
|
756
756
|
return feature
|
|
757
757
|
|
|
758
758
|
|
|
759
|
-
def create_feature(self, geojson: Dict)-> 'Feature':
|
|
759
|
+
def create_feature(self, geojson: Dict, srid: int = Feature.BASE_SRID)-> 'Feature':
|
|
760
760
|
"""
|
|
761
761
|
Create a new feature in the layer.
|
|
762
762
|
|
|
763
763
|
Args:
|
|
764
764
|
geojson (Dict): The feature data including properties and geometry.
|
|
765
|
+
srid (int, optional): the feature srid. default: 3857
|
|
765
766
|
|
|
766
767
|
Returns:
|
|
767
768
|
Feature: The newly created feature instance.
|
|
@@ -781,7 +782,7 @@ class VectorLayer(Base):
|
|
|
781
782
|
... }
|
|
782
783
|
>>> feature = layer.create_feature(geojson=geojson)
|
|
783
784
|
"""
|
|
784
|
-
return Feature.create_feature(self, geojson)
|
|
785
|
+
return Feature.create_feature(self, geojson, srid=srid)
|
|
785
786
|
|
|
786
787
|
|
|
787
788
|
def delete_features(self, q: str = None, bbox: str = None, bbox_srid: int = None, feature_ids: List[int] = None,
|