geobox 2.1.0__py3-none-any.whl → 2.2.1__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.
- geobox/__init__.py +61 -63
- geobox/aio/__init__.py +61 -63
- geobox/aio/api.py +491 -574
- geobox/aio/apikey.py +263 -263
- geobox/aio/attachment.py +341 -339
- geobox/aio/base.py +261 -262
- geobox/aio/basemap.py +196 -196
- geobox/aio/dashboard.py +340 -342
- geobox/aio/feature.py +35 -35
- geobox/aio/field.py +315 -321
- geobox/aio/file.py +72 -72
- geobox/aio/layout.py +340 -341
- geobox/aio/log.py +23 -23
- geobox/aio/map.py +1033 -1034
- geobox/aio/model3d.py +415 -415
- geobox/aio/mosaic.py +696 -696
- geobox/aio/plan.py +314 -314
- geobox/aio/query.py +693 -693
- geobox/aio/raster.py +88 -454
- geobox/aio/{analysis.py → raster_analysis.py} +153 -170
- geobox/aio/route.py +4 -4
- geobox/aio/scene.py +340 -342
- geobox/aio/settings.py +18 -18
- geobox/aio/task.py +404 -402
- geobox/aio/tile3d.py +337 -339
- geobox/aio/tileset.py +102 -103
- geobox/aio/usage.py +52 -51
- geobox/aio/user.py +506 -507
- geobox/aio/vector_tool.py +1968 -0
- geobox/aio/vectorlayer.py +316 -414
- geobox/aio/version.py +272 -273
- geobox/aio/view.py +1019 -983
- geobox/aio/workflow.py +340 -341
- geobox/api.py +14 -98
- geobox/apikey.py +262 -262
- geobox/attachment.py +336 -337
- geobox/base.py +384 -384
- geobox/basemap.py +194 -194
- geobox/dashboard.py +339 -341
- geobox/enums.py +31 -1
- geobox/feature.py +31 -10
- geobox/field.py +320 -320
- geobox/file.py +4 -4
- geobox/layout.py +339 -340
- geobox/log.py +4 -4
- geobox/map.py +1031 -1032
- geobox/model3d.py +410 -410
- geobox/mosaic.py +696 -696
- geobox/plan.py +313 -313
- geobox/query.py +691 -691
- geobox/raster.py +5 -368
- geobox/{analysis.py → raster_analysis.py} +108 -128
- geobox/scene.py +341 -342
- geobox/settings.py +194 -194
- geobox/task.py +399 -400
- geobox/tile3d.py +337 -338
- geobox/tileset.py +4 -4
- geobox/usage.py +3 -3
- geobox/user.py +503 -503
- geobox/vector_tool.py +1968 -0
- geobox/vectorlayer.py +5 -110
- geobox/version.py +272 -272
- geobox/view.py +981 -981
- geobox/workflow.py +338 -339
- {geobox-2.1.0.dist-info → geobox-2.2.1.dist-info}/METADATA +15 -1
- geobox-2.2.1.dist-info/RECORD +72 -0
- geobox-2.1.0.dist-info/RECORD +0 -70
- {geobox-2.1.0.dist-info → geobox-2.2.1.dist-info}/WHEEL +0 -0
- {geobox-2.1.0.dist-info → geobox-2.2.1.dist-info}/licenses/LICENSE +0 -0
- {geobox-2.1.0.dist-info → geobox-2.2.1.dist-info}/top_level.txt +0 -0
geobox/aio/api.py
CHANGED
|
@@ -3,38 +3,35 @@ import asyncio
|
|
|
3
3
|
import logging
|
|
4
4
|
import os
|
|
5
5
|
from urllib.parse import urljoin
|
|
6
|
-
from typing import Dict, List,
|
|
6
|
+
from typing import Dict, List, Union, Any
|
|
7
7
|
from datetime import datetime
|
|
8
8
|
|
|
9
|
-
from
|
|
10
|
-
|
|
11
|
-
from
|
|
12
|
-
from .
|
|
13
|
-
from .
|
|
14
|
-
from .
|
|
15
|
-
from .
|
|
16
|
-
from .
|
|
17
|
-
from .
|
|
18
|
-
from .
|
|
19
|
-
from .
|
|
20
|
-
from .
|
|
21
|
-
from .
|
|
22
|
-
from .
|
|
23
|
-
from .
|
|
24
|
-
from .
|
|
25
|
-
from .
|
|
26
|
-
from .
|
|
27
|
-
from .
|
|
28
|
-
from .
|
|
29
|
-
from .
|
|
30
|
-
from .
|
|
31
|
-
from .
|
|
32
|
-
from .
|
|
33
|
-
from .
|
|
34
|
-
from .
|
|
35
|
-
from .apikey import ApiKey
|
|
36
|
-
from .log import Log
|
|
37
|
-
from .usage import Usage, UsageScale, UsageParam
|
|
9
|
+
from .vectorlayer import AsyncVectorLayer, LayerType
|
|
10
|
+
from .feature import AsyncFeature
|
|
11
|
+
from .file import AsyncFile
|
|
12
|
+
from .task import AsyncTask
|
|
13
|
+
from .view import AsyncVectorLayerView
|
|
14
|
+
from .tileset import AsyncTileset
|
|
15
|
+
from .raster import AsyncRaster
|
|
16
|
+
from .mosaic import AsyncMosaic
|
|
17
|
+
from .model3d import AsyncModel
|
|
18
|
+
from .map import AsyncMap
|
|
19
|
+
from .user import AsyncUser, UserRole, UserStatus, AsyncSession
|
|
20
|
+
from .query import AsyncQuery
|
|
21
|
+
from .workflow import AsyncWorkflow
|
|
22
|
+
from .layout import AsyncLayout
|
|
23
|
+
from .version import AsyncVectorLayerVersion
|
|
24
|
+
from .tile3d import AsyncTile3d
|
|
25
|
+
from .settings import AsyncSystemSettings
|
|
26
|
+
from .scene import AsyncScene
|
|
27
|
+
from .route import AsyncRouting
|
|
28
|
+
from .plan import AsyncPlan
|
|
29
|
+
from .dashboard import AsyncDashboard
|
|
30
|
+
from .basemap import AsyncBasemap
|
|
31
|
+
from .attachment import AsyncAttachment
|
|
32
|
+
from .apikey import AsyncApiKey
|
|
33
|
+
from .log import AsyncLog
|
|
34
|
+
from .usage import AsyncUsage, UsageScale, UsageParam
|
|
38
35
|
from ..exception import AuthenticationError, ApiRequestError, NotFoundError, ValidationError, ServerError, AuthorizationError
|
|
39
36
|
from ..utils import join_url_params
|
|
40
37
|
|
|
@@ -118,17 +115,17 @@ class AsyncRequestSession:
|
|
|
118
115
|
return original_content_type
|
|
119
116
|
|
|
120
117
|
|
|
121
|
-
class AsyncGeoboxClient
|
|
118
|
+
class AsyncGeoboxClient:
|
|
122
119
|
"""
|
|
123
120
|
An async class to interact with the Geobox API.
|
|
124
121
|
"""
|
|
125
122
|
def __init__(self,
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
123
|
+
host: str = 'https://api.geobox.ir',
|
|
124
|
+
ver: str = 'v1/',
|
|
125
|
+
username: str = None,
|
|
126
|
+
password: str = None,
|
|
127
|
+
access_token: str = None,
|
|
128
|
+
apikey: str = None):
|
|
132
129
|
"""
|
|
133
130
|
Constructs all the necessary attributes for the Api object.
|
|
134
131
|
"""
|
|
@@ -438,7 +435,21 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
438
435
|
return await self._make_request(HttpMethods.DELETE, endpoint, payload, is_json)
|
|
439
436
|
|
|
440
437
|
|
|
441
|
-
|
|
438
|
+
@property
|
|
439
|
+
def raster_analysis(self):
|
|
440
|
+
from .raster_analysis import AsyncRasterAnalysis
|
|
441
|
+
|
|
442
|
+
return AsyncRasterAnalysis(self)
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
@property
|
|
446
|
+
def vector_tool(self):
|
|
447
|
+
from .vector_tool import AsyncVectorTool
|
|
448
|
+
|
|
449
|
+
return AsyncVectorTool(self)
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
async def get_vectors(self, **kwargs) -> Union[List['AsyncVectorLayer'], int]:
|
|
442
453
|
"""
|
|
443
454
|
[async] Get a list of vector layers with optional filtering and pagination.
|
|
444
455
|
|
|
@@ -456,24 +467,24 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
456
467
|
shared (bool): Whether to return shared layers. default is False.
|
|
457
468
|
|
|
458
469
|
Returns:
|
|
459
|
-
List[
|
|
470
|
+
List[AsyncVectorLayer] | int: A list of VectorLayer instances or the layers count if return_count is True.
|
|
460
471
|
|
|
461
472
|
Example:
|
|
462
473
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
463
474
|
>>> async with AsyncGeoboxClient() as client:
|
|
464
475
|
>>> layers = await client.get_vectors(include_settings=True,
|
|
465
|
-
...
|
|
466
|
-
...
|
|
467
|
-
...
|
|
468
|
-
...
|
|
469
|
-
...
|
|
470
|
-
...
|
|
471
|
-
...
|
|
472
|
-
"""
|
|
473
|
-
return await
|
|
476
|
+
... skip=0,
|
|
477
|
+
... limit=100,
|
|
478
|
+
... return_count=False,
|
|
479
|
+
... search="my_layer",
|
|
480
|
+
... search_fields="name, description",
|
|
481
|
+
... order_by="name",
|
|
482
|
+
... shared=True)
|
|
483
|
+
"""
|
|
484
|
+
return await AsyncVectorLayer.get_vectors(self, **kwargs)
|
|
474
485
|
|
|
475
486
|
|
|
476
|
-
async def get_vector(self, uuid: str, user_id: int = None) -> '
|
|
487
|
+
async def get_vector(self, uuid: str, user_id: int = None) -> 'AsyncVectorLayer':
|
|
477
488
|
"""
|
|
478
489
|
[async] Get a specific vector layer by its UUID.
|
|
479
490
|
|
|
@@ -492,10 +503,10 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
492
503
|
>>> async with AsyncGeoboxClient() as client:
|
|
493
504
|
>>> layer = await client.get_vector(uuid="12345678-1234-5678-1234-567812345678")
|
|
494
505
|
"""
|
|
495
|
-
return await
|
|
506
|
+
return await AsyncVectorLayer.get_vector(self, uuid, user_id)
|
|
496
507
|
|
|
497
508
|
|
|
498
|
-
async def get_vectors_by_ids(self, ids: List[int], user_id: int = None, include_settings: bool = False) -> List['
|
|
509
|
+
async def get_vectors_by_ids(self, ids: List[int], user_id: int = None, include_settings: bool = False) -> List['AsyncVectorLayer']:
|
|
499
510
|
"""
|
|
500
511
|
[async] Get vector layers by their IDs.
|
|
501
512
|
|
|
@@ -505,24 +516,24 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
505
516
|
include_settings (bool, optional): Whether to include the layer settings. default is False.
|
|
506
517
|
|
|
507
518
|
Returns:
|
|
508
|
-
List[
|
|
519
|
+
List[AsyncVectorLayer]: The list of VectorLayer instances.
|
|
509
520
|
|
|
510
521
|
Example:
|
|
511
522
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
512
523
|
>>> async with AsyncGeoboxClient() as client:
|
|
513
524
|
>>> layers = await client.get_vectors_by_ids(ids=[1, 2, 3])
|
|
514
525
|
"""
|
|
515
|
-
return await
|
|
526
|
+
return await AsyncVectorLayer.get_vectors_by_ids(self, ids, user_id, include_settings)
|
|
516
527
|
|
|
517
528
|
|
|
518
529
|
async def create_vector(self,
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
530
|
+
name: str,
|
|
531
|
+
layer_type: 'LayerType',
|
|
532
|
+
display_name: str = None,
|
|
533
|
+
description: str = None,
|
|
534
|
+
has_z: bool = False,
|
|
535
|
+
temporary: bool = False,
|
|
536
|
+
fields: List = None) -> 'AsyncVectorLayer':
|
|
526
537
|
"""
|
|
527
538
|
[async] Create a new vector layer.
|
|
528
539
|
|
|
@@ -536,7 +547,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
536
547
|
fields (List, optional): List of field definitions for the layer. default is None.
|
|
537
548
|
|
|
538
549
|
Returns:
|
|
539
|
-
|
|
550
|
+
AsyncVectorLayer: The newly created layer instance.
|
|
540
551
|
|
|
541
552
|
Raises:
|
|
542
553
|
ValidationError: If the layer data is invalid.
|
|
@@ -545,16 +556,16 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
545
556
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
546
557
|
>>> async with AsyncGeoboxClient() as client:
|
|
547
558
|
>>> layer = await client.create_vector(name="my_layer",
|
|
548
|
-
...
|
|
549
|
-
...
|
|
550
|
-
...
|
|
551
|
-
...
|
|
552
|
-
...
|
|
559
|
+
... layer_type=LayerType.Point,
|
|
560
|
+
... display_name="My Layer",
|
|
561
|
+
... description="This is a description of my layer",
|
|
562
|
+
... has_z=False,
|
|
563
|
+
... fields=[{"name": "my_field", "datatype": "FieldTypeString"}])
|
|
553
564
|
"""
|
|
554
|
-
return await
|
|
565
|
+
return await AsyncVectorLayer.create_vector(self, name=name, layer_type=layer_type, display_name=display_name, description=description, has_z=has_z, temporary=temporary, fields=fields)
|
|
555
566
|
|
|
556
567
|
|
|
557
|
-
async def get_vector_by_name(self, name: str, user_id: int = None) -> Union['
|
|
568
|
+
async def get_vector_by_name(self, name: str, user_id: int = None) -> Union['AsyncVectorLayer', None]:
|
|
558
569
|
"""
|
|
559
570
|
[async] Get a vector layer by name
|
|
560
571
|
|
|
@@ -563,17 +574,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
563
574
|
user_id (int, optional): specific user. privileges required.
|
|
564
575
|
|
|
565
576
|
Returns:
|
|
566
|
-
|
|
577
|
+
AsyncVectorLayer | None: returns the vector if a vector matches the given name, else None
|
|
567
578
|
|
|
568
579
|
Example:
|
|
569
580
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
570
581
|
>>> async with AsyncGeoboxClient() as client:
|
|
571
582
|
>>> layer = await client.get_vector_by_name(name='test')
|
|
572
583
|
"""
|
|
573
|
-
return await
|
|
584
|
+
return await AsyncVectorLayer.get_vector_by_name(self, name, user_id)
|
|
574
585
|
|
|
575
586
|
|
|
576
|
-
async def get_files(self, **kwargs) -> Union[List['
|
|
587
|
+
async def get_files(self, **kwargs) -> Union[List['AsyncFile'], int]:
|
|
577
588
|
"""
|
|
578
589
|
[async] Retrieves a list of files.
|
|
579
590
|
|
|
@@ -589,17 +600,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
589
600
|
shared (bool): Whether to return shared files. default is False.
|
|
590
601
|
|
|
591
602
|
Returns:
|
|
592
|
-
List[
|
|
603
|
+
List[AsyncFile] | int: A list of File objects or the total number of results.
|
|
593
604
|
|
|
594
605
|
Example:
|
|
595
606
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
596
607
|
>>> async with AsyncGeoboxClient() as client:
|
|
597
608
|
>>> files = await client.get_files(search_fields='name', search='GIS', order_by='name', skip=10, limit=10)
|
|
598
609
|
"""
|
|
599
|
-
return await
|
|
610
|
+
return await AsyncFile.get_files(self, **kwargs)
|
|
600
611
|
|
|
601
612
|
|
|
602
|
-
async def get_file(self, uuid: str) -> '
|
|
613
|
+
async def get_file(self, uuid: str) -> 'AsyncFile':
|
|
603
614
|
"""
|
|
604
615
|
[async] Retrieves a file by its UUID.
|
|
605
616
|
|
|
@@ -607,7 +618,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
607
618
|
uuid (str, optional): The UUID of the file.
|
|
608
619
|
|
|
609
620
|
Returns:
|
|
610
|
-
|
|
621
|
+
AsyncFile: The retrieved file instance.
|
|
611
622
|
|
|
612
623
|
Raises:
|
|
613
624
|
NotFoundError: If the file with the specified UUID is not found.
|
|
@@ -617,10 +628,10 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
617
628
|
>>> async with AsyncGeoboxClient() as client:
|
|
618
629
|
>>> file = await client.get_file(uuid="12345678-1234-5678-1234-567812345678")
|
|
619
630
|
"""
|
|
620
|
-
return await
|
|
631
|
+
return await AsyncFile.get_file(self, uuid=uuid)
|
|
621
632
|
|
|
622
633
|
|
|
623
|
-
async def get_files_by_name(self, name: str, user_id: int = None) -> List['
|
|
634
|
+
async def get_files_by_name(self, name: str, user_id: int = None) -> List['AsyncFile']:
|
|
624
635
|
"""
|
|
625
636
|
[async] Get files by name
|
|
626
637
|
|
|
@@ -629,17 +640,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
629
640
|
user_id (int, optional): specific user. privileges required.
|
|
630
641
|
|
|
631
642
|
Returns:
|
|
632
|
-
List[
|
|
643
|
+
List[AsyncFile]: returns files that matches the given name
|
|
633
644
|
|
|
634
645
|
Example:
|
|
635
646
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
636
647
|
>>> async with AsyncGeoboxClient() as client:
|
|
637
648
|
>>> files = await client.get_files_by_name(name='test')
|
|
638
649
|
"""
|
|
639
|
-
return await
|
|
650
|
+
return await AsyncFile.get_files_by_name(self, name, user_id)
|
|
640
651
|
|
|
641
652
|
|
|
642
|
-
async def upload_file(self, path: str, user_id: int = None, scan_archive: bool = True) -> '
|
|
653
|
+
async def upload_file(self, path: str, user_id: int = None, scan_archive: bool = True) -> 'AsyncFile':
|
|
643
654
|
"""
|
|
644
655
|
[async] Upload a file to the GeoBox API.
|
|
645
656
|
|
|
@@ -649,7 +660,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
649
660
|
scan_archive (bool, optional): Whether to scan the archive for layers. default: True
|
|
650
661
|
|
|
651
662
|
Returns:
|
|
652
|
-
|
|
663
|
+
AsyncFile: The uploaded file instance.
|
|
653
664
|
|
|
654
665
|
Raises:
|
|
655
666
|
ValueError: If the file type is invalid.
|
|
@@ -660,10 +671,10 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
660
671
|
>>> async with AsyncGeoboxClient() as client:
|
|
661
672
|
>>> file = await client.upload_file(path='path/to/file.shp')
|
|
662
673
|
"""
|
|
663
|
-
return await
|
|
674
|
+
return await AsyncFile.upload_file(self, path=path, user_id=user_id, scan_archive=scan_archive)
|
|
664
675
|
|
|
665
676
|
|
|
666
|
-
async def get_tasks(self, **kwargs) -> Union[List['
|
|
677
|
+
async def get_tasks(self, **kwargs) -> Union[List['AsyncTask'], int]:
|
|
667
678
|
"""
|
|
668
679
|
[async] Get a list of tasks
|
|
669
680
|
|
|
@@ -680,17 +691,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
680
691
|
shared (bool): Whether to return shared tasks. default is False.
|
|
681
692
|
|
|
682
693
|
Returns:
|
|
683
|
-
List[
|
|
694
|
+
List[AsyncTask] | int: The list of task objects or the count of the tasks if return_count is True.
|
|
684
695
|
|
|
685
696
|
Example:
|
|
686
697
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
687
698
|
>>> async with AsyncGeoboxClient() as client:
|
|
688
699
|
>>> tasks = await client.get_tasks()
|
|
689
700
|
"""
|
|
690
|
-
return await
|
|
701
|
+
return await AsyncTask.get_tasks(self, **kwargs)
|
|
691
702
|
|
|
692
703
|
|
|
693
|
-
async def get_task(self, uuid: str) -> '
|
|
704
|
+
async def get_task(self, uuid: str) -> 'AsyncTask':
|
|
694
705
|
"""
|
|
695
706
|
[async] Gets a task.
|
|
696
707
|
|
|
@@ -698,17 +709,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
698
709
|
uuid (str): The UUID of the task.
|
|
699
710
|
|
|
700
711
|
Returns:
|
|
701
|
-
|
|
712
|
+
AsyncTask: The task object.
|
|
702
713
|
|
|
703
714
|
Example:
|
|
704
715
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
705
716
|
>>> async with AsyncGeoboxClient() as client:
|
|
706
717
|
>>> task = await client.get_task(uuid="12345678-1234-5678-1234-567812345678")
|
|
707
718
|
"""
|
|
708
|
-
return await
|
|
719
|
+
return await AsyncTask.get_task(self, uuid)
|
|
709
720
|
|
|
710
721
|
|
|
711
|
-
async def get_views(self, **kwargs) -> Union[List['
|
|
722
|
+
async def get_views(self, **kwargs) -> Union[List['AsyncVectorLayerView'], int]:
|
|
712
723
|
"""
|
|
713
724
|
[async] Get vector layer views.
|
|
714
725
|
|
|
@@ -726,25 +737,25 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
726
737
|
shared(bool): Whether to return shared views. default is False.
|
|
727
738
|
|
|
728
739
|
Returns:
|
|
729
|
-
list[
|
|
740
|
+
list[AsyncVectorLayerView] | int: A list of VectorLayerView instances or the layer views count if return_count is True.
|
|
730
741
|
|
|
731
742
|
Example:
|
|
732
743
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
733
744
|
>>> async with AsyncGeoboxClient() as client:
|
|
734
745
|
>>> views = await client.get_views(layer_id=1,
|
|
735
|
-
...
|
|
736
|
-
...
|
|
737
|
-
...
|
|
738
|
-
...
|
|
739
|
-
...
|
|
740
|
-
...
|
|
741
|
-
...
|
|
742
|
-
...
|
|
746
|
+
... include_settings=True,
|
|
747
|
+
... search="test",
|
|
748
|
+
... search_fields="name",
|
|
749
|
+
... order_by="name A",
|
|
750
|
+
... return_count=False,
|
|
751
|
+
... skip=0,
|
|
752
|
+
... limit=10,
|
|
753
|
+
... shared=True)
|
|
743
754
|
"""
|
|
744
|
-
return await
|
|
755
|
+
return await AsyncVectorLayerView.get_views(self, **kwargs)
|
|
745
756
|
|
|
746
757
|
|
|
747
|
-
async def get_views_by_ids(self, ids: List[int], user_id: int = None, include_settings: bool = False) -> List['
|
|
758
|
+
async def get_views_by_ids(self, ids: List[int], user_id: int = None, include_settings: bool = False) -> List['AsyncVectorLayerView']:
|
|
748
759
|
"""
|
|
749
760
|
[async] Get vector layer views by their IDs.
|
|
750
761
|
|
|
@@ -754,17 +765,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
754
765
|
include_settings (bool, optional): Whether to include the settings of the vector layer views. default is False.
|
|
755
766
|
|
|
756
767
|
Returns:
|
|
757
|
-
List[
|
|
768
|
+
List[AsyncVectorLayerView]: A list of VectorLayerView instances.
|
|
758
769
|
|
|
759
770
|
Example:
|
|
760
771
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
761
772
|
>>> async with AsyncGeoboxClient() as client:
|
|
762
773
|
>>> views = await client.get_views_by_ids(ids=[1,2,3])
|
|
763
774
|
"""
|
|
764
|
-
return await
|
|
775
|
+
return await AsyncVectorLayerView.get_views_by_ids(self, ids, user_id, include_settings)
|
|
765
776
|
|
|
766
777
|
|
|
767
|
-
async def get_view(self, uuid: str, user_id: int = None) -> '
|
|
778
|
+
async def get_view(self, uuid: str, user_id: int = None) -> 'AsyncVectorLayerView':
|
|
768
779
|
"""
|
|
769
780
|
[async] Get a specific vector layer view by its UUID.
|
|
770
781
|
|
|
@@ -773,17 +784,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
773
784
|
user_id (int, optional): Specific user. privileges required.
|
|
774
785
|
|
|
775
786
|
Returns:
|
|
776
|
-
|
|
787
|
+
AsyncVectorLayerView: A VectorLayerView instance.
|
|
777
788
|
|
|
778
789
|
Example:
|
|
779
790
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
780
791
|
>>> async with AsyncGeoboxClient() as client:
|
|
781
792
|
>>> view = await client.get_view(uuid="12345678-1234-5678-1234-567812345678")
|
|
782
793
|
"""
|
|
783
|
-
return await
|
|
794
|
+
return await AsyncVectorLayerView.get_view(self, uuid, user_id)
|
|
784
795
|
|
|
785
796
|
|
|
786
|
-
async def get_view_by_name(self, name: str, user_id: int = None) -> Union['
|
|
797
|
+
async def get_view_by_name(self, name: str, user_id: int = None) -> Union['AsyncVectorLayerView', None]:
|
|
787
798
|
"""
|
|
788
799
|
[async] Get a view by name
|
|
789
800
|
|
|
@@ -792,18 +803,18 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
792
803
|
user_id (int, optional): specific user. privileges required.
|
|
793
804
|
|
|
794
805
|
Returns:
|
|
795
|
-
|
|
806
|
+
AsyncVectorLayerView | None: returns the view if a view matches the given name, else None
|
|
796
807
|
|
|
797
808
|
Example:
|
|
798
809
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
799
810
|
>>> async with AsyncGeoboxClient() as client:
|
|
800
811
|
>>> view = await client.get_view_by_name(name='test')
|
|
801
812
|
"""
|
|
802
|
-
return await
|
|
813
|
+
return await AsyncVectorLayerView.get_view_by_name(self, name, user_id)
|
|
803
814
|
|
|
804
815
|
|
|
805
|
-
async def create_tileset(self, name: str, layers: List[Union['
|
|
806
|
-
min_zoom: int = None, max_zoom: int = None, user_id: int = None) -> '
|
|
816
|
+
async def create_tileset(self, name: str, layers: List[Union['AsyncVectorLayer', 'AsyncVectorLayerView']], display_name: str = None, description: str = None,
|
|
817
|
+
min_zoom: int = None, max_zoom: int = None, user_id: int = None) -> 'AsyncTileset':
|
|
807
818
|
"""
|
|
808
819
|
[async] Create a new tileset.
|
|
809
820
|
|
|
@@ -817,7 +828,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
817
828
|
user_id (int, optional): Specific user. privileges required.
|
|
818
829
|
|
|
819
830
|
Returns:
|
|
820
|
-
|
|
831
|
+
AsyncTileset: The created tileset instance.
|
|
821
832
|
|
|
822
833
|
Example:
|
|
823
834
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
@@ -825,23 +836,23 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
825
836
|
>>> layer = await client.get_vector(uuid="12345678-1234-5678-1234-567812345678")
|
|
826
837
|
>>> view = await client.get_view(uuid="12345678-1234-5678-1234-567812345678")
|
|
827
838
|
>>> tileset = await client.create_tileset(name="your_tileset_name",
|
|
828
|
-
...
|
|
829
|
-
...
|
|
830
|
-
...
|
|
831
|
-
...
|
|
832
|
-
...
|
|
833
|
-
"""
|
|
834
|
-
return await
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
839
|
+
... display_name="Your Tileset",
|
|
840
|
+
... description="Your description",
|
|
841
|
+
... min_zoom=0,
|
|
842
|
+
... max_zoom=14,
|
|
843
|
+
... layers=[layer, view])
|
|
844
|
+
"""
|
|
845
|
+
return await AsyncTileset.create_tileset(api=self,
|
|
846
|
+
name=name,
|
|
847
|
+
layers=layers,
|
|
848
|
+
display_name=display_name,
|
|
849
|
+
description=description,
|
|
850
|
+
min_zoom=min_zoom,
|
|
851
|
+
max_zoom=max_zoom,
|
|
852
|
+
user_id=user_id)
|
|
842
853
|
|
|
843
854
|
|
|
844
|
-
async def get_tilesets(self, **kwargs) -> Union[List['
|
|
855
|
+
async def get_tilesets(self, **kwargs) -> Union[List['AsyncTileset'], int]:
|
|
845
856
|
"""
|
|
846
857
|
[async] Retrieves a list of tilesets.
|
|
847
858
|
|
|
@@ -857,7 +868,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
857
868
|
shared (bool): Whether to return shared tilesets. default is False.
|
|
858
869
|
|
|
859
870
|
Returns:
|
|
860
|
-
List[
|
|
871
|
+
List[AsyncTileset] | int: A list of Tileset instances or the total number of tilesets
|
|
861
872
|
|
|
862
873
|
Example:
|
|
863
874
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
@@ -868,10 +879,10 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
868
879
|
... limit=10,
|
|
869
880
|
... )
|
|
870
881
|
"""
|
|
871
|
-
return await
|
|
882
|
+
return await AsyncTileset.get_tilesets(self, **kwargs)
|
|
872
883
|
|
|
873
884
|
|
|
874
|
-
async def get_tilesets_by_ids(self, ids: List[int], user_id: int = None) -> List['
|
|
885
|
+
async def get_tilesets_by_ids(self, ids: List[int], user_id: int = None) -> List['AsyncTileset']:
|
|
875
886
|
"""
|
|
876
887
|
[async] Retrieves a list of tilesets by their IDs.
|
|
877
888
|
|
|
@@ -880,17 +891,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
880
891
|
user_id (int, optional): Specific user. privileges required.
|
|
881
892
|
|
|
882
893
|
Returns:
|
|
883
|
-
List[
|
|
894
|
+
List[AsyncTileset]: A list of Tileset instances.
|
|
884
895
|
|
|
885
896
|
Example:
|
|
886
897
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
887
898
|
>>> async with AsyncGeoboxClient() as client:
|
|
888
899
|
>>> tilesets = await client.get_tilesets_by_ids(ids=['123', '456'])
|
|
889
900
|
"""
|
|
890
|
-
return await
|
|
901
|
+
return await AsyncTileset.get_tilesets_by_ids(self, ids, user_id)
|
|
891
902
|
|
|
892
903
|
|
|
893
|
-
async def get_tileset(self, uuid: str) -> '
|
|
904
|
+
async def get_tileset(self, uuid: str) -> 'AsyncTileset':
|
|
894
905
|
"""
|
|
895
906
|
[async] Retrieves a tileset by its UUID.
|
|
896
907
|
|
|
@@ -898,17 +909,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
898
909
|
uuid (str): The UUID of the tileset.
|
|
899
910
|
|
|
900
911
|
Returns:
|
|
901
|
-
|
|
912
|
+
AsyncTileset: The retrieved tileset instance.
|
|
902
913
|
|
|
903
914
|
Example:
|
|
904
915
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
905
916
|
>>> async with AsyncGeoboxClient() as client:
|
|
906
917
|
>>> tileset = await client.get_tileset(uuid="12345678-1234-5678-1234-567812345678")
|
|
907
918
|
"""
|
|
908
|
-
return await
|
|
919
|
+
return await AsyncTileset.get_tileset(self, uuid)
|
|
909
920
|
|
|
910
921
|
|
|
911
|
-
async def get_tileset_by_name(self, name: str, user_id: int = None) -> Union['
|
|
922
|
+
async def get_tileset_by_name(self, name: str, user_id: int = None) -> Union['AsyncTileset', None]:
|
|
912
923
|
"""
|
|
913
924
|
[async] Get a tileset by name
|
|
914
925
|
|
|
@@ -917,17 +928,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
917
928
|
user_id (int, optional): specific user. privileges required.
|
|
918
929
|
|
|
919
930
|
Returns:
|
|
920
|
-
|
|
931
|
+
AsyncTileset | None: returns the tileset if a tileset matches the given name, else None
|
|
921
932
|
|
|
922
933
|
Example:
|
|
923
934
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
924
935
|
>>> async with AsyncGeoboxClient() as client:
|
|
925
936
|
>>> tileset = await client.get_tileset_by_name(name='test')
|
|
926
937
|
"""
|
|
927
|
-
return await
|
|
938
|
+
return await AsyncTileset.get_tileset_by_name(self, name, user_id)
|
|
928
939
|
|
|
929
940
|
|
|
930
|
-
async def get_rasters(self, **kwargs) -> Union[List['
|
|
941
|
+
async def get_rasters(self, **kwargs) -> Union[List['AsyncRaster'], int]:
|
|
931
942
|
"""
|
|
932
943
|
[async] Get all rasters.
|
|
933
944
|
|
|
@@ -944,17 +955,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
944
955
|
shared (bool): whether to return shared rasters. default is False.
|
|
945
956
|
|
|
946
957
|
Returns:
|
|
947
|
-
List[
|
|
958
|
+
List[AsyncRaster] | int: A list of Raster objects or the total count of rasters.
|
|
948
959
|
|
|
949
960
|
Example:
|
|
950
961
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
951
962
|
>>> async with AsyncGeoboxClient() as client:
|
|
952
963
|
>>> rasters = await client.get_rasters(terrain=True, q="name LIKE '%GIS%'")
|
|
953
964
|
"""
|
|
954
|
-
return await
|
|
965
|
+
return await AsyncRaster.get_rasters(self, **kwargs)
|
|
955
966
|
|
|
956
967
|
|
|
957
|
-
async def get_rasters_by_ids(self, ids: List[int], user_id: int = None) -> List['
|
|
968
|
+
async def get_rasters_by_ids(self, ids: List[int], user_id: int = None) -> List['AsyncRaster']:
|
|
958
969
|
"""
|
|
959
970
|
[async] Get rasters by their IDs.
|
|
960
971
|
|
|
@@ -963,17 +974,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
963
974
|
user_id (int, optional): specific user. privileges required.
|
|
964
975
|
|
|
965
976
|
Returns:
|
|
966
|
-
List['
|
|
977
|
+
List['AsyncRaster']: A list of Raster objects.
|
|
967
978
|
|
|
968
979
|
Example:
|
|
969
980
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
970
981
|
>>> async with AsyncGeoboxClient() as client:
|
|
971
982
|
>>> rasters = await client.get_rasters_by_ids(ids=['123', '456'])
|
|
972
983
|
"""
|
|
973
|
-
return await
|
|
984
|
+
return await AsyncRaster.get_rasters_by_ids(self, ids, user_id)
|
|
974
985
|
|
|
975
986
|
|
|
976
|
-
async def get_raster(self, uuid: str) -> '
|
|
987
|
+
async def get_raster(self, uuid: str) -> 'AsyncRaster':
|
|
977
988
|
"""
|
|
978
989
|
[async] Get a raster by its UUID.
|
|
979
990
|
|
|
@@ -982,17 +993,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
982
993
|
user_id (int, optional): specific user. privileges required.
|
|
983
994
|
|
|
984
995
|
Returns:
|
|
985
|
-
|
|
996
|
+
AsyncRaster: A Raster object.
|
|
986
997
|
|
|
987
998
|
Example:
|
|
988
999
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
989
1000
|
>>> async with AsyncGeoboxClient() as client:
|
|
990
1001
|
>>> raster = await client.get_raster(uuid="12345678-1234-5678-1234-567812345678")
|
|
991
1002
|
"""
|
|
992
|
-
return await
|
|
1003
|
+
return await AsyncRaster.get_raster(self, uuid)
|
|
993
1004
|
|
|
994
1005
|
|
|
995
|
-
async def get_raster_by_name(self, name: str, user_id: int = None) -> Union['
|
|
1006
|
+
async def get_raster_by_name(self, name: str, user_id: int = None) -> Union['AsyncRaster', None]:
|
|
996
1007
|
"""
|
|
997
1008
|
[async] Get a raster by name
|
|
998
1009
|
|
|
@@ -1001,17 +1012,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1001
1012
|
user_id (int, optional): specific user. privileges required.
|
|
1002
1013
|
|
|
1003
1014
|
Returns:
|
|
1004
|
-
|
|
1015
|
+
AsyncRaster | None: returns the raster if a raster matches the given name, else None
|
|
1005
1016
|
|
|
1006
1017
|
Example:
|
|
1007
1018
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1008
1019
|
>>> async with AsyncGeoboxClient() as client:
|
|
1009
1020
|
>>> raster = await client.get_raster_by_name(name='test')
|
|
1010
1021
|
"""
|
|
1011
|
-
return await
|
|
1022
|
+
return await AsyncRaster.get_raster_by_name(self, name, user_id)
|
|
1012
1023
|
|
|
1013
1024
|
|
|
1014
|
-
async def get_mosaics(self, **kwargs) -> Union[List['
|
|
1025
|
+
async def get_mosaics(self, **kwargs) -> Union[List['AsyncMosaic'], int]:
|
|
1015
1026
|
"""
|
|
1016
1027
|
[async] Get a list of mosaics.
|
|
1017
1028
|
|
|
@@ -1027,17 +1038,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1027
1038
|
shared (bool): Whether to return shared mosaics. default is False.
|
|
1028
1039
|
|
|
1029
1040
|
Returns:
|
|
1030
|
-
List['
|
|
1041
|
+
List['AsyncMosaic'] | int: A list of Mosaic instances or the number of mosaics.
|
|
1031
1042
|
|
|
1032
1043
|
Example:
|
|
1033
1044
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1034
1045
|
>>> async with AsyncGeoboxClient() as client:
|
|
1035
1046
|
>>> mosaics = await client.get_mosaics(q="name LIKE '%GIS%'")
|
|
1036
1047
|
"""
|
|
1037
|
-
return await
|
|
1048
|
+
return await AsyncMosaic.get_mosaics(self, **kwargs)
|
|
1038
1049
|
|
|
1039
1050
|
|
|
1040
|
-
async def get_mosaics_by_ids(self, ids: List[int], user_id: int = None) -> List['
|
|
1051
|
+
async def get_mosaics_by_ids(self, ids: List[int], user_id: int = None) -> List['AsyncMosaic']:
|
|
1041
1052
|
"""
|
|
1042
1053
|
[async] Get mosaics by their IDs.
|
|
1043
1054
|
|
|
@@ -1046,23 +1057,23 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1046
1057
|
user_id (int, optional): specific user. privileges required.
|
|
1047
1058
|
|
|
1048
1059
|
Returns:
|
|
1049
|
-
List[
|
|
1060
|
+
List[AsyncMosaic]: A list of Mosaic instances.
|
|
1050
1061
|
|
|
1051
1062
|
Example:
|
|
1052
1063
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1053
1064
|
>>> async with AsyncGeoboxClient() as client:
|
|
1054
1065
|
>>> mosaics = await client.get_mosaics_by_ids(ids=['1, 2, 3'])
|
|
1055
1066
|
"""
|
|
1056
|
-
return await
|
|
1067
|
+
return await AsyncMosaic.get_mosaics_by_ids(self, ids, user_id)
|
|
1057
1068
|
|
|
1058
1069
|
|
|
1059
1070
|
async def create_mosaic(self,
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1071
|
+
name:str,
|
|
1072
|
+
display_name: str = None,
|
|
1073
|
+
description: str = None,
|
|
1074
|
+
pixel_selection: str = None,
|
|
1075
|
+
min_zoom: int = None,
|
|
1076
|
+
user_id: int = None) -> 'AsyncMosaic':
|
|
1066
1077
|
"""
|
|
1067
1078
|
[async] Create New Raster Mosaic
|
|
1068
1079
|
|
|
@@ -1075,17 +1086,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1075
1086
|
user_id (int, optional): specific user. privileges required.
|
|
1076
1087
|
|
|
1077
1088
|
Returns:
|
|
1078
|
-
|
|
1089
|
+
AsyncMosaic: The created mosaic.
|
|
1079
1090
|
|
|
1080
1091
|
Example:
|
|
1081
1092
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1082
1093
|
>>> async with AsyncGeoboxClient() as client:
|
|
1083
1094
|
>>> mosaic = await client.create_mosaic(name='mosaic_name')
|
|
1084
1095
|
"""
|
|
1085
|
-
return await
|
|
1096
|
+
return await AsyncMosaic.create_mosaic(self, name, display_name, description, pixel_selection, min_zoom, user_id)
|
|
1086
1097
|
|
|
1087
1098
|
|
|
1088
|
-
async def get_mosaic(self, uuid: str, user_id: int = None) -> '
|
|
1099
|
+
async def get_mosaic(self, uuid: str, user_id: int = None) -> 'AsyncMosaic':
|
|
1089
1100
|
"""
|
|
1090
1101
|
[async] Get a mosaic by uuid.
|
|
1091
1102
|
|
|
@@ -1094,17 +1105,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1094
1105
|
user_id (int, optional): specific user. privileges required.
|
|
1095
1106
|
|
|
1096
1107
|
Returns:
|
|
1097
|
-
|
|
1108
|
+
AsyncMosaic: The mosaic object.
|
|
1098
1109
|
|
|
1099
1110
|
Example:
|
|
1100
1111
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1101
1112
|
>>> async with AsyncGeoboxClient() as client:
|
|
1102
1113
|
>>> mosaic = await client.get_mosaic(uuid="12345678-1234-5678-1234-567812345678")
|
|
1103
1114
|
"""
|
|
1104
|
-
return await
|
|
1115
|
+
return await AsyncMosaic.get_mosaic(self, uuid, user_id)
|
|
1105
1116
|
|
|
1106
1117
|
|
|
1107
|
-
async def get_mosaic_by_name(self, name: str, user_id: int = None) -> Union['
|
|
1118
|
+
async def get_mosaic_by_name(self, name: str, user_id: int = None) -> Union['AsyncMosaic', None]:
|
|
1108
1119
|
"""
|
|
1109
1120
|
[async] Get a mosaic by name
|
|
1110
1121
|
|
|
@@ -1113,17 +1124,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1113
1124
|
user_id (int, optional): specific user. privileges required.
|
|
1114
1125
|
|
|
1115
1126
|
Returns:
|
|
1116
|
-
|
|
1127
|
+
AsyncMosaic | None: returns the mosaic if a mosaic matches the given name, else None
|
|
1117
1128
|
|
|
1118
1129
|
Example:
|
|
1119
1130
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1120
1131
|
>>> async with AsyncGeoboxClient() as client:
|
|
1121
1132
|
>>> mosaic = await client.get_mosaic_by_name(name='test')
|
|
1122
1133
|
"""
|
|
1123
|
-
return await
|
|
1134
|
+
return await AsyncMosaic.get_mosaic_by_name(self, name, user_id)
|
|
1124
1135
|
|
|
1125
1136
|
|
|
1126
|
-
async def get_models(self, **kwargs) -> Union[List['
|
|
1137
|
+
async def get_models(self, **kwargs) -> Union[List['AsyncModel'], int]:
|
|
1127
1138
|
"""
|
|
1128
1139
|
[async] Get a list of models with optional filtering and pagination.
|
|
1129
1140
|
|
|
@@ -1139,23 +1150,23 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1139
1150
|
shared (bool): Whether to return shared models. default is False.
|
|
1140
1151
|
|
|
1141
1152
|
Returns:
|
|
1142
|
-
List[
|
|
1153
|
+
List[AsyncModel] | int: A list of Model objects or the count number.
|
|
1143
1154
|
|
|
1144
1155
|
Example:
|
|
1145
1156
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1146
1157
|
>>> async with AsyncGeoboxClient() as client:
|
|
1147
1158
|
>>> models = await client.get_models(search="my_model",
|
|
1148
|
-
...
|
|
1149
|
-
...
|
|
1150
|
-
...
|
|
1151
|
-
...
|
|
1152
|
-
...
|
|
1153
|
-
...
|
|
1154
|
-
"""
|
|
1155
|
-
return await
|
|
1159
|
+
... search_fields="name, description",
|
|
1160
|
+
... order_by="name A",
|
|
1161
|
+
... return_count=True,
|
|
1162
|
+
... skip=0,
|
|
1163
|
+
... limit=10,
|
|
1164
|
+
... shared=False)
|
|
1165
|
+
"""
|
|
1166
|
+
return await AsyncModel.get_models(self, **kwargs)
|
|
1156
1167
|
|
|
1157
1168
|
|
|
1158
|
-
async def get_model(self, uuid: str, user_id: int = None) -> '
|
|
1169
|
+
async def get_model(self, uuid: str, user_id: int = None) -> 'AsyncModel':
|
|
1159
1170
|
"""
|
|
1160
1171
|
[async] Get a model by its UUID.
|
|
1161
1172
|
|
|
@@ -1164,7 +1175,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1164
1175
|
user_id (int, optional): Specific user. privileges required.
|
|
1165
1176
|
|
|
1166
1177
|
Returns:
|
|
1167
|
-
|
|
1178
|
+
AsyncModel: The model object.
|
|
1168
1179
|
|
|
1169
1180
|
Raises:
|
|
1170
1181
|
NotFoundError: If the model with the specified UUID is not found.
|
|
@@ -1174,10 +1185,10 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1174
1185
|
>>> async with AsyncGeoboxClient() as client:
|
|
1175
1186
|
>>> model = await client.get_model(uuid="12345678-1234-5678-1234-567812345678")
|
|
1176
1187
|
"""
|
|
1177
|
-
return await
|
|
1188
|
+
return await AsyncModel.get_model(self, uuid, user_id)
|
|
1178
1189
|
|
|
1179
1190
|
|
|
1180
|
-
async def get_model_by_name(self, name: str, user_id: int = None) -> Union['
|
|
1191
|
+
async def get_model_by_name(self, name: str, user_id: int = None) -> Union['AsyncModel', None]:
|
|
1181
1192
|
"""
|
|
1182
1193
|
[async] Get a model by name
|
|
1183
1194
|
|
|
@@ -1186,17 +1197,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1186
1197
|
user_id (int, optional): specific user. privileges required.
|
|
1187
1198
|
|
|
1188
1199
|
Returns:
|
|
1189
|
-
|
|
1200
|
+
AsyncModel | None: returns the model if a model matches the given name, else None
|
|
1190
1201
|
|
|
1191
1202
|
Example:
|
|
1192
1203
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1193
1204
|
>>> async with AsyncGeoboxClient() as client:
|
|
1194
1205
|
>>> model = await client.get_model_by_name(name='test')
|
|
1195
1206
|
"""
|
|
1196
|
-
return await
|
|
1207
|
+
return await AsyncModel.get_model_by_name(self, name, user_id)
|
|
1197
1208
|
|
|
1198
1209
|
|
|
1199
|
-
async def get_maps(self, **kwargs) -> Union[List['
|
|
1210
|
+
async def get_maps(self, **kwargs) -> Union[List['AsyncMap'], int]:
|
|
1200
1211
|
"""
|
|
1201
1212
|
[async] Get list of maps with optional filtering and pagination.
|
|
1202
1213
|
|
|
@@ -1212,24 +1223,24 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1212
1223
|
shared (bool): Whether to return shared maps. default is False.
|
|
1213
1224
|
|
|
1214
1225
|
Returns:
|
|
1215
|
-
List[
|
|
1226
|
+
List[AsyncMap] | int: A list of Map instances or the total number of maps.
|
|
1216
1227
|
|
|
1217
1228
|
Example:
|
|
1218
1229
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1219
1230
|
>>> async with AsyncGeoboxClient() as client:
|
|
1220
1231
|
>>> maps = await client.get_maps(q="name LIKE '%My Map%'")
|
|
1221
1232
|
"""
|
|
1222
|
-
return await
|
|
1233
|
+
return await AsyncMap.get_maps(self, **kwargs)
|
|
1223
1234
|
|
|
1224
1235
|
|
|
1225
1236
|
async def create_map(self,
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1237
|
+
name: str,
|
|
1238
|
+
display_name: str = None,
|
|
1239
|
+
description: str = None,
|
|
1240
|
+
extent: List[float] = None,
|
|
1241
|
+
thumbnail: str = None,
|
|
1242
|
+
style: Dict = None,
|
|
1243
|
+
user_id: int = None) -> 'AsyncMap':
|
|
1233
1244
|
"""
|
|
1234
1245
|
[async] Create a new map.
|
|
1235
1246
|
|
|
@@ -1243,7 +1254,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1243
1254
|
user_id (int, optional): Specific user. privileges required.
|
|
1244
1255
|
|
|
1245
1256
|
Returns:
|
|
1246
|
-
|
|
1257
|
+
AsyncMap: The newly created map instance.
|
|
1247
1258
|
|
|
1248
1259
|
Raises:
|
|
1249
1260
|
ValidationError: If the map data is invalid.
|
|
@@ -1253,10 +1264,10 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1253
1264
|
>>> async with AsyncGeoboxClient() as client:
|
|
1254
1265
|
>>> map = await client.create_map(name="my_map", display_name="My Map", description="This is a description of my map", extent=[10, 20, 30, 40], thumbnail="https://example.com/thumbnail.png", style={"type": "style"})
|
|
1255
1266
|
"""
|
|
1256
|
-
return await
|
|
1267
|
+
return await AsyncMap.create_map(self, name, display_name, description, extent, thumbnail, style, user_id)
|
|
1257
1268
|
|
|
1258
1269
|
|
|
1259
|
-
async def get_map(self, uuid: str, user_id: int = None) -> '
|
|
1270
|
+
async def get_map(self, uuid: str, user_id: int = None) -> 'AsyncMap':
|
|
1260
1271
|
"""
|
|
1261
1272
|
[async] Get a map by its UUID.
|
|
1262
1273
|
|
|
@@ -1265,7 +1276,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1265
1276
|
user_id (int, optional): Specific user. privileges required.
|
|
1266
1277
|
|
|
1267
1278
|
Returns:
|
|
1268
|
-
|
|
1279
|
+
AsyncMap: The map object.
|
|
1269
1280
|
|
|
1270
1281
|
Raises:
|
|
1271
1282
|
NotFoundError: If the map with the specified UUID is not found.
|
|
@@ -1275,10 +1286,10 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1275
1286
|
>>> async with AsyncGeoboxClient() as client:
|
|
1276
1287
|
>>> map = await client.get_map(uuid="12345678-1234-5678-1234-567812345678")
|
|
1277
1288
|
"""
|
|
1278
|
-
return await
|
|
1289
|
+
return await AsyncMap.get_map(self, uuid, user_id)
|
|
1279
1290
|
|
|
1280
1291
|
|
|
1281
|
-
async def get_map_by_name(self, name: str, user_id: int = None) -> Union['
|
|
1292
|
+
async def get_map_by_name(self, name: str, user_id: int = None) -> Union['AsyncMap', None]:
|
|
1282
1293
|
"""
|
|
1283
1294
|
[async] Get a map by name
|
|
1284
1295
|
|
|
@@ -1287,17 +1298,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1287
1298
|
user_id (int, optional): specific user. privileges required.
|
|
1288
1299
|
|
|
1289
1300
|
Returns:
|
|
1290
|
-
|
|
1301
|
+
AsyncMap | None: returns the map if a map matches the given name, else None
|
|
1291
1302
|
|
|
1292
1303
|
Example:
|
|
1293
1304
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1294
1305
|
>>> async with AsyncGeoboxClient() as client:
|
|
1295
1306
|
>>> map = await client.get_map_by_name(name='test')
|
|
1296
1307
|
"""
|
|
1297
|
-
return await
|
|
1308
|
+
return await AsyncMap.get_map_by_name(self, name, user_id)
|
|
1298
1309
|
|
|
1299
1310
|
|
|
1300
|
-
async def get_queries(self, **kwargs) -> Union[List['
|
|
1311
|
+
async def get_queries(self, **kwargs) -> Union[List['AsyncQuery'], int]:
|
|
1301
1312
|
"""
|
|
1302
1313
|
[async] Get Queries
|
|
1303
1314
|
|
|
@@ -1313,17 +1324,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1313
1324
|
shared (bool): Whether to return shared queries. default is False.
|
|
1314
1325
|
|
|
1315
1326
|
Returns:
|
|
1316
|
-
List[
|
|
1327
|
+
List[AsyncQuery] | int: list of queries or the number of queries.
|
|
1317
1328
|
|
|
1318
1329
|
Example:
|
|
1319
1330
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1320
1331
|
>>> async with AsyncGeoboxClient() as client:
|
|
1321
1332
|
>>> queries = await client.get_queries()
|
|
1322
1333
|
"""
|
|
1323
|
-
return await
|
|
1334
|
+
return await AsyncQuery.get_queries(self, **kwargs)
|
|
1324
1335
|
|
|
1325
1336
|
|
|
1326
|
-
async def create_query(self, name: str, display_name: str = None, description: str = None, sql: str = None, params: List = None) -> '
|
|
1337
|
+
async def create_query(self, name: str, display_name: str = None, description: str = None, sql: str = None, params: List = None) -> 'AsyncQuery':
|
|
1327
1338
|
"""
|
|
1328
1339
|
[async] Creates a new query.
|
|
1329
1340
|
|
|
@@ -1335,17 +1346,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1335
1346
|
params (list, optional): The parameters for the SQL statement.
|
|
1336
1347
|
|
|
1337
1348
|
Returns:
|
|
1338
|
-
|
|
1349
|
+
AsyncQuery: The created query instance.
|
|
1339
1350
|
|
|
1340
1351
|
Example:
|
|
1341
1352
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1342
1353
|
>>> async with AsyncGeoboxClient() as client:
|
|
1343
1354
|
>>> query = await client.create_query(name='query_name', display_name='Query Name', sql='SELECT * FROM some_layer')
|
|
1344
1355
|
"""
|
|
1345
|
-
return await
|
|
1356
|
+
return await AsyncQuery.create_query(self, name, display_name, description, sql, params)
|
|
1346
1357
|
|
|
1347
1358
|
|
|
1348
|
-
async def get_query(self, uuid: str, user_id: int = None) -> '
|
|
1359
|
+
async def get_query(self, uuid: str, user_id: int = None) -> 'AsyncQuery':
|
|
1349
1360
|
"""
|
|
1350
1361
|
[async] Retrieves a query by its UUID.
|
|
1351
1362
|
|
|
@@ -1354,17 +1365,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1354
1365
|
user_id (int, optional): specific user ID. privileges required.
|
|
1355
1366
|
|
|
1356
1367
|
Returns:
|
|
1357
|
-
|
|
1368
|
+
AsyncQuery: The retrieved query instance.
|
|
1358
1369
|
|
|
1359
1370
|
Example:
|
|
1360
1371
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1361
1372
|
>>> async with AsyncGeoboxClient() as client:
|
|
1362
1373
|
>>> query = await client.get_query(uuid="12345678-1234-5678-1234-567812345678")
|
|
1363
1374
|
"""
|
|
1364
|
-
return await
|
|
1375
|
+
return await AsyncQuery.get_query(self, uuid, user_id)
|
|
1365
1376
|
|
|
1366
1377
|
|
|
1367
|
-
async def get_query_by_name(self, name: str, user_id: int = None) -> Union['
|
|
1378
|
+
async def get_query_by_name(self, name: str, user_id: int = None) -> Union['AsyncQuery', None]:
|
|
1368
1379
|
"""
|
|
1369
1380
|
[async] Get a query by name
|
|
1370
1381
|
|
|
@@ -1373,17 +1384,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1373
1384
|
user_id (int, optional): specific user. privileges required.
|
|
1374
1385
|
|
|
1375
1386
|
Returns:
|
|
1376
|
-
|
|
1387
|
+
AsyncQuery | None: returns the query if a query matches the given name, else None
|
|
1377
1388
|
|
|
1378
1389
|
Example:
|
|
1379
1390
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1380
1391
|
>>> async with AsyncGeoboxClient() as client:
|
|
1381
1392
|
>>> query = await client.get_query_by_name(name='test')
|
|
1382
1393
|
"""
|
|
1383
|
-
return await
|
|
1394
|
+
return await AsyncQuery.get_query_by_name(self, name, user_id)
|
|
1384
1395
|
|
|
1385
1396
|
|
|
1386
|
-
async def get_system_queries(self, **kwargs) -> List['
|
|
1397
|
+
async def get_system_queries(self, **kwargs) -> List['AsyncQuery']:
|
|
1387
1398
|
"""
|
|
1388
1399
|
[async] Returns the system queries as a list of Query objects.
|
|
1389
1400
|
|
|
@@ -1399,17 +1410,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1399
1410
|
shared (bool): whether to return shared queries. default is False.
|
|
1400
1411
|
|
|
1401
1412
|
Returns:
|
|
1402
|
-
List[
|
|
1413
|
+
List[AsyncQuery]: list of system queries.
|
|
1403
1414
|
|
|
1404
1415
|
Example:
|
|
1405
1416
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1406
1417
|
>>> async with AsyncGeoboxClient() as client:
|
|
1407
1418
|
>>> queries = await client.get_system_queries()
|
|
1408
1419
|
"""
|
|
1409
|
-
return await
|
|
1420
|
+
return await AsyncQuery.get_system_queries(self, **kwargs)
|
|
1410
1421
|
|
|
1411
1422
|
|
|
1412
|
-
async def get_users(self, **kwrags) -> Union[List['
|
|
1423
|
+
async def get_users(self, **kwrags) -> Union[List['AsyncUser'], int]:
|
|
1413
1424
|
"""
|
|
1414
1425
|
[async] Retrieves a list of users (Permission Required)
|
|
1415
1426
|
|
|
@@ -1426,14 +1437,14 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1426
1437
|
shared (bool): Whether to return shared maps. default is False.
|
|
1427
1438
|
|
|
1428
1439
|
Returns:
|
|
1429
|
-
List[
|
|
1440
|
+
List[AsyncUser] | int: list of users or the count number.
|
|
1430
1441
|
|
|
1431
1442
|
Example:
|
|
1432
1443
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1433
1444
|
>>> async with AsyncGeoboxClient() as client:
|
|
1434
1445
|
>>> users = await client.get_users()
|
|
1435
1446
|
"""
|
|
1436
|
-
return await
|
|
1447
|
+
return await AsyncUser.get_users(self, **kwrags)
|
|
1437
1448
|
|
|
1438
1449
|
|
|
1439
1450
|
async def create_user(self,
|
|
@@ -1444,7 +1455,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1444
1455
|
first_name: str,
|
|
1445
1456
|
last_name: str,
|
|
1446
1457
|
mobile: str,
|
|
1447
|
-
status: 'UserStatus') -> '
|
|
1458
|
+
status: 'UserStatus') -> 'AsyncUser':
|
|
1448
1459
|
"""
|
|
1449
1460
|
[async] Create a User (Permission Required)
|
|
1450
1461
|
|
|
@@ -1459,24 +1470,24 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1459
1470
|
status (UserStatus): the status of the user.
|
|
1460
1471
|
|
|
1461
1472
|
Returns:
|
|
1462
|
-
|
|
1473
|
+
AsyncUser: the user object.
|
|
1463
1474
|
|
|
1464
1475
|
Example:
|
|
1465
1476
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1466
1477
|
>>> async with AsyncGeoboxClient() as client:
|
|
1467
1478
|
>>> user = await client.create_user(username="user1",
|
|
1468
|
-
...
|
|
1469
|
-
...
|
|
1470
|
-
...
|
|
1471
|
-
...
|
|
1472
|
-
...
|
|
1473
|
-
...
|
|
1474
|
-
...
|
|
1475
|
-
"""
|
|
1476
|
-
return await
|
|
1479
|
+
... email="user1@example.com",
|
|
1480
|
+
... password="P@ssw0rd",
|
|
1481
|
+
... role=UserRole.ACCOUNT_ADMIN,
|
|
1482
|
+
... first_name="user 1",
|
|
1483
|
+
... last_name="user 1",
|
|
1484
|
+
... mobile="+98 9120123456",
|
|
1485
|
+
... status=UserStatus.ACTIVE)
|
|
1486
|
+
"""
|
|
1487
|
+
return await AsyncUser.create_user(self, username, email, password, role, first_name, last_name, mobile, status)
|
|
1477
1488
|
|
|
1478
1489
|
|
|
1479
|
-
async def search_users(self, search: str = None, skip: int = 0, limit: int = 10) -> List['
|
|
1490
|
+
async def search_users(self, search: str = None, skip: int = 0, limit: int = 10) -> List['AsyncUser']:
|
|
1480
1491
|
"""
|
|
1481
1492
|
[async] Get list of users based on the search term.
|
|
1482
1493
|
|
|
@@ -1486,17 +1497,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1486
1497
|
limit (int, optional): Number of items to return. default is 10.
|
|
1487
1498
|
|
|
1488
1499
|
Returns:
|
|
1489
|
-
List[
|
|
1500
|
+
List[AsyncUser]: A list of User instances.
|
|
1490
1501
|
|
|
1491
1502
|
Example:
|
|
1492
1503
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1493
1504
|
>>> async with AsyncGeoboxClient() as client:
|
|
1494
1505
|
>>> users = await client.get_users(search="John")
|
|
1495
1506
|
"""
|
|
1496
|
-
return await
|
|
1507
|
+
return await AsyncUser.search_users(self, search, skip, limit)
|
|
1497
1508
|
|
|
1498
1509
|
|
|
1499
|
-
async def get_user(self, user_id: str = 'me') -> '
|
|
1510
|
+
async def get_user(self, user_id: str = 'me') -> 'AsyncUser':
|
|
1500
1511
|
"""
|
|
1501
1512
|
[async] Get a user by its id (Permission Required)
|
|
1502
1513
|
|
|
@@ -1516,15 +1527,15 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1516
1527
|
get the current user
|
|
1517
1528
|
>>> user = await client.get_user()
|
|
1518
1529
|
"""
|
|
1519
|
-
return await
|
|
1530
|
+
return await AsyncUser.get_user(self, user_id)
|
|
1520
1531
|
|
|
1521
1532
|
|
|
1522
|
-
async def get_my_sessions(self) -> List['
|
|
1533
|
+
async def get_my_sessions(self) -> List['AsyncSession']:
|
|
1523
1534
|
"""
|
|
1524
1535
|
[async] Get a list of user available sessions (Permission Required)
|
|
1525
1536
|
|
|
1526
1537
|
Returns:
|
|
1527
|
-
List[
|
|
1538
|
+
List[AsyncSession]: list of user sessions.
|
|
1528
1539
|
|
|
1529
1540
|
Example:
|
|
1530
1541
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
@@ -1535,7 +1546,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1535
1546
|
return await user.get_sessions()
|
|
1536
1547
|
|
|
1537
1548
|
|
|
1538
|
-
async def get_workflows(self, **kwargs) -> Union[List['
|
|
1549
|
+
async def get_workflows(self, **kwargs) -> Union[List['AsyncWorkflow'], int]:
|
|
1539
1550
|
"""
|
|
1540
1551
|
[async] Get list of workflows with optional filtering and pagination.
|
|
1541
1552
|
|
|
@@ -1551,23 +1562,23 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1551
1562
|
shared (bool): Whether to return shared workflows. default is False.
|
|
1552
1563
|
|
|
1553
1564
|
Returns:
|
|
1554
|
-
List[
|
|
1565
|
+
List[AsyncWorkflow] | int: A list of workflow instances or the total number of workflows.
|
|
1555
1566
|
|
|
1556
1567
|
Example:
|
|
1557
1568
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1558
1569
|
>>> async with AsyncGeoboxClient() as client:
|
|
1559
1570
|
>>> workflows = await client.get_workflows(q="name LIKE '%My workflow%'")
|
|
1560
1571
|
"""
|
|
1561
|
-
return await
|
|
1572
|
+
return await AsyncWorkflow.get_workflows(self, **kwargs)
|
|
1562
1573
|
|
|
1563
1574
|
|
|
1564
1575
|
async def create_workflow(self,
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1576
|
+
name: str,
|
|
1577
|
+
display_name: str = None,
|
|
1578
|
+
description: str = None,
|
|
1579
|
+
settings: Dict = {},
|
|
1580
|
+
thumbnail: str = None,
|
|
1581
|
+
user_id: int = None) -> 'AsyncWorkflow':
|
|
1571
1582
|
"""
|
|
1572
1583
|
[async] Create a new workflow.
|
|
1573
1584
|
|
|
@@ -1580,7 +1591,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1580
1591
|
user_id (int): Specific user. privileges workflow.
|
|
1581
1592
|
|
|
1582
1593
|
Returns:
|
|
1583
|
-
|
|
1594
|
+
AsyncWorkflow: The newly created workflow instance.
|
|
1584
1595
|
|
|
1585
1596
|
Raises:
|
|
1586
1597
|
ValidationError: If the workflow data is invalid.
|
|
@@ -1590,10 +1601,10 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1590
1601
|
>>> async with AsyncGeoboxClient() as client:
|
|
1591
1602
|
>>> workflow = await client.create_workflow(name="my_workflow")
|
|
1592
1603
|
"""
|
|
1593
|
-
return await
|
|
1604
|
+
return await AsyncWorkflow.create_workflow(self, name, display_name, description, settings, thumbnail, user_id)
|
|
1594
1605
|
|
|
1595
1606
|
|
|
1596
|
-
async def get_workflow(self, uuid: str, user_id: int = None) -> '
|
|
1607
|
+
async def get_workflow(self, uuid: str, user_id: int = None) -> 'AsyncWorkflow':
|
|
1597
1608
|
"""
|
|
1598
1609
|
[async] Get a workflow by its UUID.
|
|
1599
1610
|
|
|
@@ -1602,7 +1613,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1602
1613
|
user_id (int): Specific user. privileges required.
|
|
1603
1614
|
|
|
1604
1615
|
Returns:
|
|
1605
|
-
|
|
1616
|
+
AsyncWorkflow: The workflow object.
|
|
1606
1617
|
|
|
1607
1618
|
Raises:
|
|
1608
1619
|
NotFoundError: If the workflow with the specified UUID is not found.
|
|
@@ -1612,10 +1623,10 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1612
1623
|
>>> async with AsyncGeoboxClient() as client:
|
|
1613
1624
|
>>> workflow = await client.get_workflow(uuid="12345678-1234-5678-1234-567812345678")
|
|
1614
1625
|
"""
|
|
1615
|
-
return await
|
|
1626
|
+
return await AsyncWorkflow.get_workflow(self, uuid, user_id)
|
|
1616
1627
|
|
|
1617
1628
|
|
|
1618
|
-
async def get_workflow_by_name(self, name: str, user_id: int = None) -> Union['
|
|
1629
|
+
async def get_workflow_by_name(self, name: str, user_id: int = None) -> Union['AsyncWorkflow', None]:
|
|
1619
1630
|
"""
|
|
1620
1631
|
[async] Get a workflow by name
|
|
1621
1632
|
|
|
@@ -1624,17 +1635,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1624
1635
|
user_id (int, optional): specific user. privileges required.
|
|
1625
1636
|
|
|
1626
1637
|
Returns:
|
|
1627
|
-
|
|
1638
|
+
AsyncWorkflow | None: returns the workflow if a workflow matches the given name, else None
|
|
1628
1639
|
|
|
1629
1640
|
Example:
|
|
1630
1641
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1631
1642
|
>>> async with AsyncGeoboxClient() as client:
|
|
1632
1643
|
>>> workflow = await client.get_workflow_by_name(name='test')
|
|
1633
1644
|
"""
|
|
1634
|
-
return await
|
|
1645
|
+
return await AsyncWorkflow.get_workflow_by_name(self, name, user_id)
|
|
1635
1646
|
|
|
1636
1647
|
|
|
1637
|
-
async def get_versions(self, **kwargs) -> Union[List['
|
|
1648
|
+
async def get_versions(self, **kwargs) -> Union[List['AsyncVectorLayerVersion'], int]:
|
|
1638
1649
|
"""
|
|
1639
1650
|
[async] Get list of versions with optional filtering and pagination.
|
|
1640
1651
|
|
|
@@ -1651,17 +1662,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1651
1662
|
shared (bool): Whether to return shared versions. default is False.
|
|
1652
1663
|
|
|
1653
1664
|
Returns:
|
|
1654
|
-
List[
|
|
1665
|
+
List[AsyncVectorLayerVersion] | int: A list of vector layer version instances or the total number of versions.
|
|
1655
1666
|
|
|
1656
1667
|
Example:
|
|
1657
1668
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1658
1669
|
>>> async with AsyncGeoboxClient() as client:
|
|
1659
1670
|
>>> versions = await client.get_versions(q="name LIKE '%My version%'")
|
|
1660
1671
|
"""
|
|
1661
|
-
return await
|
|
1672
|
+
return await AsyncVectorLayerVersion.get_versions(self, **kwargs)
|
|
1662
1673
|
|
|
1663
1674
|
|
|
1664
|
-
async def get_version(self, uuid: str, user_id: int = None) -> '
|
|
1675
|
+
async def get_version(self, uuid: str, user_id: int = None) -> 'AsyncVectorLayerVersion':
|
|
1665
1676
|
"""
|
|
1666
1677
|
[async] Get a version by its UUID.
|
|
1667
1678
|
|
|
@@ -1670,7 +1681,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1670
1681
|
user_id (int, optional): Specific user. privileges required.
|
|
1671
1682
|
|
|
1672
1683
|
Returns:
|
|
1673
|
-
|
|
1684
|
+
AsyncVectorLayerVersion: The vector layer version object.
|
|
1674
1685
|
|
|
1675
1686
|
Raises:
|
|
1676
1687
|
NotFoundError: If the version with the specified UUID is not found.
|
|
@@ -1680,10 +1691,10 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1680
1691
|
>>> async with AsyncGeoboxClient() as client:
|
|
1681
1692
|
>>> version = await client.get_version(uuid="12345678-1234-5678-1234-567812345678")
|
|
1682
1693
|
"""
|
|
1683
|
-
return await
|
|
1694
|
+
return await AsyncVectorLayerVersion.get_version(self, uuid, user_id)
|
|
1684
1695
|
|
|
1685
1696
|
|
|
1686
|
-
async def get_version_by_name(self, name: str, user_id: int = None) -> '
|
|
1697
|
+
async def get_version_by_name(self, name: str, user_id: int = None) -> 'AsyncVectorLayerVersion':
|
|
1687
1698
|
"""
|
|
1688
1699
|
[async] Get a version by name
|
|
1689
1700
|
|
|
@@ -1692,17 +1703,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1692
1703
|
user_id (int, optional): specific user. privileges required.
|
|
1693
1704
|
|
|
1694
1705
|
Returns:
|
|
1695
|
-
|
|
1706
|
+
AsyncVectorLayerVersion | None: returns the version if a version matches the given name, else None
|
|
1696
1707
|
|
|
1697
1708
|
Example:
|
|
1698
1709
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1699
1710
|
>>> async with AsyncGeoboxClient() as client:
|
|
1700
1711
|
>>> version = await client.get_version_by_name(name='test')
|
|
1701
1712
|
"""
|
|
1702
|
-
return await
|
|
1713
|
+
return await AsyncVectorLayerVersion.get_version_by_name(self, name, user_id)
|
|
1703
1714
|
|
|
1704
1715
|
|
|
1705
|
-
async def get_layouts(self, **kwargs) -> Union[List['
|
|
1716
|
+
async def get_layouts(self, **kwargs) -> Union[List['AsyncLayout'], int]:
|
|
1706
1717
|
"""
|
|
1707
1718
|
[async] Get list of layouts with optional filtering and pagination.
|
|
1708
1719
|
|
|
@@ -1718,23 +1729,23 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1718
1729
|
shared (bool): Whether to return shared layouts. default is False.
|
|
1719
1730
|
|
|
1720
1731
|
Returns:
|
|
1721
|
-
List[
|
|
1732
|
+
List[AsyncLayout] | int: A list of layout instances or the total number of layouts.
|
|
1722
1733
|
|
|
1723
1734
|
Example:
|
|
1724
1735
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1725
1736
|
>>> async with AsyncGeoboxClient() as client:
|
|
1726
1737
|
>>> layouts = await client.get_layouts(q="name LIKE '%My layout%'")
|
|
1727
1738
|
"""
|
|
1728
|
-
return await
|
|
1739
|
+
return await AsyncLayout.get_layouts(self, **kwargs)
|
|
1729
1740
|
|
|
1730
1741
|
|
|
1731
1742
|
async def create_layout(self,
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1743
|
+
name: str,
|
|
1744
|
+
display_name: str = None,
|
|
1745
|
+
description: str = None,
|
|
1746
|
+
settings: Dict = {},
|
|
1747
|
+
thumbnail: str = None,
|
|
1748
|
+
user_id: int = None) -> 'AsyncLayout':
|
|
1738
1749
|
"""
|
|
1739
1750
|
[async] Create a new layout.
|
|
1740
1751
|
|
|
@@ -1747,7 +1758,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1747
1758
|
user_id (int): Specific user. privileges layout.
|
|
1748
1759
|
|
|
1749
1760
|
Returns:
|
|
1750
|
-
|
|
1761
|
+
AsyncLayout: The newly created layout instance.
|
|
1751
1762
|
|
|
1752
1763
|
Raises:
|
|
1753
1764
|
ValidationError: If the layout data is invalid.
|
|
@@ -1757,10 +1768,10 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1757
1768
|
>>> async with AsyncGeoboxClient() as client:
|
|
1758
1769
|
>>> layout = await client.create_layout(name="my_layout")
|
|
1759
1770
|
"""
|
|
1760
|
-
return await
|
|
1771
|
+
return await AsyncLayout.create_layout(self, name, display_name, description, settings, thumbnail, user_id)
|
|
1761
1772
|
|
|
1762
1773
|
|
|
1763
|
-
async def get_layout(self, uuid: str, user_id: int = None) -> '
|
|
1774
|
+
async def get_layout(self, uuid: str, user_id: int = None) -> 'AsyncLayout':
|
|
1764
1775
|
"""
|
|
1765
1776
|
[async] Get a layout by its UUID.
|
|
1766
1777
|
|
|
@@ -1769,7 +1780,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1769
1780
|
user_id (int): Specific user. privileges required.
|
|
1770
1781
|
|
|
1771
1782
|
Returns:
|
|
1772
|
-
|
|
1783
|
+
AsyncLayout: The layout object.
|
|
1773
1784
|
|
|
1774
1785
|
Raises:
|
|
1775
1786
|
NotFoundError: If the layout with the specified UUID is not found.
|
|
@@ -1779,10 +1790,10 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1779
1790
|
>>> async with AsyncGeoboxClient() as client:
|
|
1780
1791
|
>>> layout = await client.get_layout(uuid="12345678-1234-5678-1234-567812345678")
|
|
1781
1792
|
"""
|
|
1782
|
-
return await
|
|
1793
|
+
return await AsyncLayout.get_layout(self, uuid, user_id)
|
|
1783
1794
|
|
|
1784
1795
|
|
|
1785
|
-
async def get_layout_by_name(self, name: str, user_id: int = None) -> Union['
|
|
1796
|
+
async def get_layout_by_name(self, name: str, user_id: int = None) -> Union['AsyncLayout', None]:
|
|
1786
1797
|
"""
|
|
1787
1798
|
[async] Get a layout by name
|
|
1788
1799
|
|
|
@@ -1791,17 +1802,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1791
1802
|
user_id (int, optional): specific user. privileges required.
|
|
1792
1803
|
|
|
1793
1804
|
Returns:
|
|
1794
|
-
|
|
1805
|
+
AsyncLayout | None: returns the layout if a layout matches the given name, else None
|
|
1795
1806
|
|
|
1796
1807
|
Example:
|
|
1797
1808
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1798
1809
|
>>> async with AsyncGeoboxClient() as client:
|
|
1799
1810
|
>>> layout = await client.get_layout_by_name(name='test')
|
|
1800
1811
|
"""
|
|
1801
|
-
return await
|
|
1812
|
+
return await AsyncLayout.get_layout_by_name(self, name, user_id)
|
|
1802
1813
|
|
|
1803
1814
|
|
|
1804
|
-
async def get_3dtiles(self, **kwargs) -> Union[List['
|
|
1815
|
+
async def get_3dtiles(self, **kwargs) -> Union[List['AsyncTile3d'], int]:
|
|
1805
1816
|
"""
|
|
1806
1817
|
[async] Get list of 3D Tiles with optional filtering and pagination.
|
|
1807
1818
|
|
|
@@ -1817,17 +1828,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1817
1828
|
shared (bool): Whether to return shared maps. default is False.
|
|
1818
1829
|
|
|
1819
1830
|
Returns:
|
|
1820
|
-
List[
|
|
1831
|
+
List[AsyncTile3d] | int: A list of 3D Tile instances or the total number of 3D Tiles.
|
|
1821
1832
|
|
|
1822
1833
|
Example:
|
|
1823
1834
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1824
1835
|
>>> async with AsyncGeoboxClient() as client:
|
|
1825
1836
|
>>> tiles = await client.get_3dtiles(q="name LIKE '%My tile%'")
|
|
1826
1837
|
"""
|
|
1827
|
-
return await
|
|
1838
|
+
return await AsyncTile3d.get_3dtiles(self, **kwargs)
|
|
1828
1839
|
|
|
1829
1840
|
|
|
1830
|
-
async def get_3dtile(self, uuid: str, user_id: int = None) -> '
|
|
1841
|
+
async def get_3dtile(self, uuid: str, user_id: int = None) -> 'AsyncTile3d':
|
|
1831
1842
|
"""
|
|
1832
1843
|
[async] Get a 3D Tile by its UUID.
|
|
1833
1844
|
|
|
@@ -1836,7 +1847,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1836
1847
|
user_id (int): Specific user. privileges required.
|
|
1837
1848
|
|
|
1838
1849
|
Returns:
|
|
1839
|
-
|
|
1850
|
+
AsyncTile3d: The 3D Tile object.
|
|
1840
1851
|
|
|
1841
1852
|
Raises:
|
|
1842
1853
|
NotFoundError: If the 3D Tile with the specified UUID is not found.
|
|
@@ -1846,10 +1857,10 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1846
1857
|
>>> async with AsyncGeoboxClient() as client:
|
|
1847
1858
|
>>> tile = await client.get_3dtile(uuid="12345678-1234-5678-1234-567812345678")
|
|
1848
1859
|
"""
|
|
1849
|
-
return await
|
|
1860
|
+
return await AsyncTile3d.get_3dtile(self, uuid, user_id)
|
|
1850
1861
|
|
|
1851
1862
|
|
|
1852
|
-
async def get_3dtile_by_name(self, name: str, user_id: int = None) -> Union['
|
|
1863
|
+
async def get_3dtile_by_name(self, name: str, user_id: int = None) -> Union['AsyncTile3d', None]:
|
|
1853
1864
|
"""
|
|
1854
1865
|
[async] Get a 3dtile by name
|
|
1855
1866
|
|
|
@@ -1858,32 +1869,32 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1858
1869
|
user_id (int, optional): specific user. privileges required.
|
|
1859
1870
|
|
|
1860
1871
|
Returns:
|
|
1861
|
-
|
|
1872
|
+
AsyncTile3d | None: returns the 3dtile if a 3dtile matches the given name, else None
|
|
1862
1873
|
|
|
1863
1874
|
Example:
|
|
1864
1875
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1865
1876
|
>>> async with AsyncGeoboxClient() as client:
|
|
1866
1877
|
>>> tile3d = await client.get_3dtile_by_name(name='test')
|
|
1867
1878
|
"""
|
|
1868
|
-
return await
|
|
1879
|
+
return await AsyncTile3d.get_3dtile_by_name(self, name, user_id)
|
|
1869
1880
|
|
|
1870
1881
|
|
|
1871
|
-
async def get_system_settings(self) -> '
|
|
1882
|
+
async def get_system_settings(self) -> 'AsyncSystemSettings':
|
|
1872
1883
|
"""
|
|
1873
1884
|
[async] Get System Settings object (Permission Required).
|
|
1874
1885
|
|
|
1875
1886
|
Returns:
|
|
1876
|
-
|
|
1887
|
+
AsyncSystemSetting: the system settings object.
|
|
1877
1888
|
|
|
1878
1889
|
Example:
|
|
1879
1890
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1880
1891
|
>>> async with AsyncGeoboxClient() as client:
|
|
1881
1892
|
>>> setting = await client.get_system_settings()
|
|
1882
1893
|
"""
|
|
1883
|
-
return await
|
|
1894
|
+
return await AsyncSystemSettings.get_system_settings(self)
|
|
1884
1895
|
|
|
1885
1896
|
|
|
1886
|
-
async def get_scenes(self, **kwargs) -> Union[List['
|
|
1897
|
+
async def get_scenes(self, **kwargs) -> Union[List['AsyncScene'], int]:
|
|
1887
1898
|
"""
|
|
1888
1899
|
[async] Get list of scenes with optional filtering and pagination.
|
|
1889
1900
|
|
|
@@ -1899,23 +1910,23 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1899
1910
|
shared (bool): Whether to return shared scenes. default is False.
|
|
1900
1911
|
|
|
1901
1912
|
Returns:
|
|
1902
|
-
List[
|
|
1913
|
+
List[AsyncScene] | int: A list of scene instances or the total number of scenes.
|
|
1903
1914
|
|
|
1904
1915
|
Example:
|
|
1905
1916
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1906
1917
|
>>> async with AsyncGeoboxClient() as client:
|
|
1907
1918
|
>>> scenes = await client.get_scenes(q="name LIKE '%My scene%'")
|
|
1908
1919
|
"""
|
|
1909
|
-
return await
|
|
1920
|
+
return await AsyncScene.get_scenes(self, **kwargs)
|
|
1910
1921
|
|
|
1911
1922
|
|
|
1912
1923
|
async def create_scene(self,
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1924
|
+
name: str,
|
|
1925
|
+
display_name: str = None,
|
|
1926
|
+
description: str = None,
|
|
1927
|
+
settings: Dict = {},
|
|
1928
|
+
thumbnail: str = None,
|
|
1929
|
+
user_id: int = None) -> 'AsyncScene':
|
|
1919
1930
|
"""
|
|
1920
1931
|
[async] Create a new scene.
|
|
1921
1932
|
|
|
@@ -1928,7 +1939,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1928
1939
|
user_id (int, optional): Specific user. privileges required.
|
|
1929
1940
|
|
|
1930
1941
|
Returns:
|
|
1931
|
-
|
|
1942
|
+
AsyncScene: The newly created scene instance.
|
|
1932
1943
|
|
|
1933
1944
|
Raises:
|
|
1934
1945
|
ValidationError: If the scene data is invalid.
|
|
@@ -1938,16 +1949,16 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1938
1949
|
>>> async with AsyncGeoboxClient() as client:
|
|
1939
1950
|
>>> scene = await client.create_scene(name="my_scene")
|
|
1940
1951
|
"""
|
|
1941
|
-
return await
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1952
|
+
return await AsyncScene.create_scene(self,
|
|
1953
|
+
name,
|
|
1954
|
+
display_name,
|
|
1955
|
+
description,
|
|
1956
|
+
settings,
|
|
1957
|
+
thumbnail,
|
|
1958
|
+
user_id)
|
|
1948
1959
|
|
|
1949
1960
|
|
|
1950
|
-
async def get_scene(self, uuid: str, user_id: int = None) -> '
|
|
1961
|
+
async def get_scene(self, uuid: str, user_id: int = None) -> 'AsyncScene':
|
|
1951
1962
|
"""
|
|
1952
1963
|
[async] Get a scene by its UUID.
|
|
1953
1964
|
|
|
@@ -1956,7 +1967,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1956
1967
|
user_id (int, optional): Specific user. privileges required.
|
|
1957
1968
|
|
|
1958
1969
|
Returns:
|
|
1959
|
-
|
|
1970
|
+
AsyncScene: The scene object.
|
|
1960
1971
|
|
|
1961
1972
|
Raises:
|
|
1962
1973
|
NotFoundError: If the scene with the specified UUID is not found.
|
|
@@ -1966,10 +1977,10 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1966
1977
|
>>> async with AsyncGeoboxClient() as client:
|
|
1967
1978
|
>>> scene = await client.get_scene(uuid="12345678-1234-5678-1234-567812345678")
|
|
1968
1979
|
"""
|
|
1969
|
-
return await
|
|
1980
|
+
return await AsyncScene.get_scene(self, uuid, user_id)
|
|
1970
1981
|
|
|
1971
1982
|
|
|
1972
|
-
async def get_scene_by_name(self, name: str, user_id: int = None) -> Union['
|
|
1983
|
+
async def get_scene_by_name(self, name: str, user_id: int = None) -> Union['AsyncScene', None]:
|
|
1973
1984
|
"""
|
|
1974
1985
|
[async] Get a scene by name
|
|
1975
1986
|
|
|
@@ -1978,14 +1989,14 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
1978
1989
|
user_id (int, optional): specific user. privileges required.
|
|
1979
1990
|
|
|
1980
1991
|
Returns:
|
|
1981
|
-
|
|
1992
|
+
AsyncScene | None: returns the scene if a scene matches the given name, else None
|
|
1982
1993
|
|
|
1983
1994
|
Example:
|
|
1984
1995
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
1985
1996
|
>>> async with AsyncGeoboxClient() as client:
|
|
1986
1997
|
>>> scene = await client.get_scene_by_name(name='test')
|
|
1987
1998
|
"""
|
|
1988
|
-
return await
|
|
1999
|
+
return await AsyncScene.get_scene_by_name(self, name, user_id)
|
|
1989
2000
|
|
|
1990
2001
|
|
|
1991
2002
|
async def route(self, stops: str, **kwargs) -> Dict:
|
|
@@ -2009,16 +2020,16 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2009
2020
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
2010
2021
|
>>> async with AsyncGeoboxClient() as client:
|
|
2011
2022
|
>>> route = await client.route(stops="53,33;56,36",
|
|
2012
|
-
...
|
|
2013
|
-
...
|
|
2014
|
-
...
|
|
2015
|
-
...
|
|
2016
|
-
...
|
|
2023
|
+
... alternatives=True,
|
|
2024
|
+
... steps=True,
|
|
2025
|
+
... geometries=RoutingGeometryType.geojson,
|
|
2026
|
+
... overview=RoutingOverviewLevel.full,
|
|
2027
|
+
... annotations=True)
|
|
2017
2028
|
"""
|
|
2018
|
-
return await
|
|
2029
|
+
return await AsyncRouting.route(self, stops, **kwargs)
|
|
2019
2030
|
|
|
2020
2031
|
|
|
2021
|
-
async def get_plans(self, **kwargs) -> Union[List['
|
|
2032
|
+
async def get_plans(self, **kwargs) -> Union[List['AsyncPlan'], int]:
|
|
2022
2033
|
"""
|
|
2023
2034
|
[async] Get list of plans with optional filtering and pagination.
|
|
2024
2035
|
|
|
@@ -2034,30 +2045,30 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2034
2045
|
shared (bool): Whether to return shared plans. default is False.
|
|
2035
2046
|
|
|
2036
2047
|
Returns:
|
|
2037
|
-
List[
|
|
2048
|
+
List[AsyncPlan] | int: A list of plan instances or the total number of plans.
|
|
2038
2049
|
|
|
2039
2050
|
Example:
|
|
2040
2051
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
2041
2052
|
>>> async with AsyncGeoboxClient() as client:
|
|
2042
2053
|
>>> plans = await client.get_plans(q="name LIKE '%My plan%'")
|
|
2043
2054
|
"""
|
|
2044
|
-
return await
|
|
2055
|
+
return await AsyncPlan.get_plans(self, **kwargs)
|
|
2045
2056
|
|
|
2046
2057
|
|
|
2047
2058
|
async def create_plan(self,
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2059
|
+
name: str,
|
|
2060
|
+
plan_color: str,
|
|
2061
|
+
storage: int,
|
|
2062
|
+
concurrent_tasks: int,
|
|
2063
|
+
daily_api_calls: int,
|
|
2064
|
+
monthly_api_calls: int,
|
|
2065
|
+
daily_traffic: int,
|
|
2066
|
+
monthly_traffic: int,
|
|
2067
|
+
daily_process: int,
|
|
2068
|
+
monthly_process: int,
|
|
2069
|
+
number_of_days: int = None,
|
|
2070
|
+
display_name: str = None,
|
|
2071
|
+
description: str = None) -> 'AsyncPlan':
|
|
2061
2072
|
"""
|
|
2062
2073
|
[async] Create a new plan.
|
|
2063
2074
|
|
|
@@ -2077,7 +2088,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2077
2088
|
description (str, optional): description of the plan.
|
|
2078
2089
|
|
|
2079
2090
|
Returns:
|
|
2080
|
-
|
|
2091
|
+
AsyncPlan: The newly created plan instance.
|
|
2081
2092
|
|
|
2082
2093
|
Raises:
|
|
2083
2094
|
ValidationError: If the plan data is invalid.
|
|
@@ -2086,36 +2097,36 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2086
2097
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
2087
2098
|
>>> async with AsyncGeoboxClient() as client:
|
|
2088
2099
|
>>> plan = await client.create_plan(name="new_plan",
|
|
2089
|
-
...
|
|
2090
|
-
...
|
|
2091
|
-
...
|
|
2092
|
-
...
|
|
2093
|
-
...
|
|
2094
|
-
...
|
|
2095
|
-
...
|
|
2096
|
-
...
|
|
2097
|
-
...
|
|
2098
|
-
...
|
|
2099
|
-
...
|
|
2100
|
-
...
|
|
2101
|
-
"""
|
|
2102
|
-
return await
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2100
|
+
... display_name=" New Plan",
|
|
2101
|
+
... description="new plan description",
|
|
2102
|
+
... plan_color="#000000",
|
|
2103
|
+
... storage=10,
|
|
2104
|
+
... concurrent_tasks=10,
|
|
2105
|
+
... daily_api_calls=10,
|
|
2106
|
+
... monthly_api_calls=10,
|
|
2107
|
+
... daily_traffic=10,
|
|
2108
|
+
... monthly_traffic=10,
|
|
2109
|
+
... daily_process=10,
|
|
2110
|
+
... monthly_process=10,
|
|
2111
|
+
... number_of_days=10)
|
|
2112
|
+
"""
|
|
2113
|
+
return await AsyncPlan.create_plan(self,
|
|
2114
|
+
name,
|
|
2115
|
+
plan_color,
|
|
2116
|
+
storage,
|
|
2117
|
+
concurrent_tasks,
|
|
2118
|
+
daily_api_calls,
|
|
2119
|
+
monthly_api_calls,
|
|
2120
|
+
daily_traffic,
|
|
2121
|
+
monthly_traffic,
|
|
2122
|
+
daily_process,
|
|
2123
|
+
monthly_process,
|
|
2124
|
+
number_of_days,
|
|
2125
|
+
display_name,
|
|
2126
|
+
description)
|
|
2116
2127
|
|
|
2117
2128
|
|
|
2118
|
-
async def get_plan(self, plan_id: int) -> '
|
|
2129
|
+
async def get_plan(self, plan_id: int) -> 'AsyncPlan':
|
|
2119
2130
|
"""
|
|
2120
2131
|
[async] Get a plan by its id.
|
|
2121
2132
|
|
|
@@ -2123,7 +2134,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2123
2134
|
plan_id (int): The id of the plan to get.
|
|
2124
2135
|
|
|
2125
2136
|
Returns:
|
|
2126
|
-
|
|
2137
|
+
AsyncPlan: The plan object
|
|
2127
2138
|
|
|
2128
2139
|
Raises:
|
|
2129
2140
|
NotFoundError: If the plan with the specified id is not found.
|
|
@@ -2133,10 +2144,10 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2133
2144
|
>>> async with AsyncGeoboxClient() as client:
|
|
2134
2145
|
>>> plan = await client.get_plan(plan_id=1)
|
|
2135
2146
|
"""
|
|
2136
|
-
return await
|
|
2147
|
+
return await AsyncPlan.get_plan(self, plan_id)
|
|
2137
2148
|
|
|
2138
2149
|
|
|
2139
|
-
async def get_plan_by_name(self, name: str) -> Union['
|
|
2150
|
+
async def get_plan_by_name(self, name: str) -> Union['AsyncPlan', None]:
|
|
2140
2151
|
"""
|
|
2141
2152
|
[async] Get a plan by name
|
|
2142
2153
|
|
|
@@ -2145,17 +2156,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2145
2156
|
name (str): the name of the plan to get
|
|
2146
2157
|
|
|
2147
2158
|
Returns:
|
|
2148
|
-
|
|
2159
|
+
AsyncPlan | None: returns the plan if a plan matches the given name, else None
|
|
2149
2160
|
|
|
2150
2161
|
Example:
|
|
2151
2162
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
2152
2163
|
>>> async with AsyncGeoboxClient() as client:
|
|
2153
2164
|
>>> plan = await client.get_plan_by_name(name='test')
|
|
2154
2165
|
"""
|
|
2155
|
-
return await
|
|
2166
|
+
return await AsyncPlan.get_plan_by_name(self, name)
|
|
2156
2167
|
|
|
2157
2168
|
|
|
2158
|
-
async def get_dashboards(self, **kwargs) -> Union[List['
|
|
2169
|
+
async def get_dashboards(self, **kwargs) -> Union[List['AsyncDashboard'], int]:
|
|
2159
2170
|
"""
|
|
2160
2171
|
[async] Get list of Dashboards
|
|
2161
2172
|
|
|
@@ -2171,23 +2182,23 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2171
2182
|
shared (bool): Whether to return shared Dashboards. default is False.
|
|
2172
2183
|
|
|
2173
2184
|
Returns:
|
|
2174
|
-
List[
|
|
2185
|
+
List[AsyncDashboard] | int: A list of Dashboard instances or the total number of Dashboards.
|
|
2175
2186
|
|
|
2176
2187
|
Example:
|
|
2177
2188
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
2178
2189
|
>>> async with AsyncGeoboxClient() as client:
|
|
2179
2190
|
>>> dashboards = await client.get_dashboards()
|
|
2180
2191
|
"""
|
|
2181
|
-
return await
|
|
2192
|
+
return await AsyncDashboard.get_dashboards(self, **kwargs)
|
|
2182
2193
|
|
|
2183
2194
|
|
|
2184
2195
|
async def create_dashboard(self,
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2196
|
+
name: str,
|
|
2197
|
+
display_name: str = None,
|
|
2198
|
+
description: str = None,
|
|
2199
|
+
settings: Dict = {},
|
|
2200
|
+
thumbnail: str = None,
|
|
2201
|
+
user_id: int = None) -> 'AsyncDashboard':
|
|
2191
2202
|
"""
|
|
2192
2203
|
[async] Create a new Dashboard.
|
|
2193
2204
|
|
|
@@ -2200,7 +2211,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2200
2211
|
user_id (int, optional): Specific user. privileges required.
|
|
2201
2212
|
|
|
2202
2213
|
Returns:
|
|
2203
|
-
|
|
2214
|
+
AsyncDashboard: The newly created Dashboard instance.
|
|
2204
2215
|
|
|
2205
2216
|
Raises:
|
|
2206
2217
|
ValidationError: If the Dashboard data is invalid.
|
|
@@ -2210,16 +2221,16 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2210
2221
|
>>> async with AsyncGeoboxClient() as client:
|
|
2211
2222
|
>>> dashboard = await client.create_dashboard(name="my_dashboard")
|
|
2212
2223
|
"""
|
|
2213
|
-
return await
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2224
|
+
return await AsyncDashboard.create_dashboard(self,
|
|
2225
|
+
name,
|
|
2226
|
+
display_name,
|
|
2227
|
+
description,
|
|
2228
|
+
settings,
|
|
2229
|
+
thumbnail,
|
|
2230
|
+
user_id)
|
|
2220
2231
|
|
|
2221
2232
|
|
|
2222
|
-
async def get_dashboard(self, uuid: str, user_id: int = None) -> '
|
|
2233
|
+
async def get_dashboard(self, uuid: str, user_id: int = None) -> 'AsyncDashboard':
|
|
2223
2234
|
"""
|
|
2224
2235
|
[async] Get a Dashboard by its UUID.
|
|
2225
2236
|
|
|
@@ -2228,7 +2239,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2228
2239
|
user_id (int, optional): Specific user. privileges required.
|
|
2229
2240
|
|
|
2230
2241
|
Returns:
|
|
2231
|
-
|
|
2242
|
+
AsyncDashboard: The dashboard object.
|
|
2232
2243
|
|
|
2233
2244
|
Raises:
|
|
2234
2245
|
NotFoundError: If the Dashboard with the specified UUID is not found.
|
|
@@ -2238,10 +2249,10 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2238
2249
|
>>> async with AsyncGeoboxClient() as client:
|
|
2239
2250
|
>>> dashboard = await client.get_dashboard(uuid="12345678-1234-5678-1234-567812345678")
|
|
2240
2251
|
"""
|
|
2241
|
-
return await
|
|
2252
|
+
return await AsyncDashboard.get_dashboard(self, uuid, user_id)
|
|
2242
2253
|
|
|
2243
2254
|
|
|
2244
|
-
async def get_dashboard_by_name(self, name: str, user_id: int = None) -> Union['
|
|
2255
|
+
async def get_dashboard_by_name(self, name: str, user_id: int = None) -> Union['AsyncDashboard', None]:
|
|
2245
2256
|
"""
|
|
2246
2257
|
[async] Get a dashboard by name
|
|
2247
2258
|
|
|
@@ -2250,32 +2261,32 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2250
2261
|
user_id (int, optional): specific user. privileges required.
|
|
2251
2262
|
|
|
2252
2263
|
Returns:
|
|
2253
|
-
|
|
2264
|
+
AsyncDashboard | None: returns the dashboard if a dashboard matches the given name, else None
|
|
2254
2265
|
|
|
2255
2266
|
Example:
|
|
2256
2267
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
2257
2268
|
>>> async with AsyncGeoboxClient() as client:
|
|
2258
2269
|
>>> dashboard = await client.get_dashboard_by_name(name='test')
|
|
2259
2270
|
"""
|
|
2260
|
-
return await
|
|
2271
|
+
return await AsyncDashboard.get_dashboard_by_name(self, name, user_id)
|
|
2261
2272
|
|
|
2262
2273
|
|
|
2263
|
-
async def get_basemaps(self) -> List['
|
|
2274
|
+
async def get_basemaps(self) -> List['AsyncBasemap']:
|
|
2264
2275
|
"""
|
|
2265
2276
|
[async] Get a list of basemaps
|
|
2266
2277
|
|
|
2267
2278
|
Returns:
|
|
2268
|
-
List[
|
|
2279
|
+
List[AsyncBaseMap]: list of basemaps.
|
|
2269
2280
|
|
|
2270
2281
|
Example:
|
|
2271
2282
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
2272
2283
|
>>> async with AsyncGeoboxClient() as client:
|
|
2273
2284
|
>>> basemaps = await client.get_basemaps()
|
|
2274
2285
|
"""
|
|
2275
|
-
return await
|
|
2286
|
+
return await AsyncBasemap.get_basemaps(self)
|
|
2276
2287
|
|
|
2277
2288
|
|
|
2278
|
-
async def get_basemap(self, name: str) -> '
|
|
2289
|
+
async def get_basemap(self, name: str) -> 'AsyncBasemap':
|
|
2279
2290
|
"""
|
|
2280
2291
|
[async] Get a basemap object
|
|
2281
2292
|
|
|
@@ -2283,7 +2294,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2283
2294
|
name: the basemap name
|
|
2284
2295
|
|
|
2285
2296
|
Returns:
|
|
2286
|
-
|
|
2297
|
+
AsyncBasemap: the basemap object
|
|
2287
2298
|
|
|
2288
2299
|
Raises:
|
|
2289
2300
|
NotFoundError: if the base,ap with the specified name not found
|
|
@@ -2293,7 +2304,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2293
2304
|
>>> async with AsyncGeoboxClient() as client:
|
|
2294
2305
|
>>> basemap = await client.get_basemap(name='test')
|
|
2295
2306
|
"""
|
|
2296
|
-
return await
|
|
2307
|
+
return await AsyncBasemap.get_basemap(self, name)
|
|
2297
2308
|
|
|
2298
2309
|
|
|
2299
2310
|
async def proxy_basemap(self, url: str) -> None:
|
|
@@ -2311,15 +2322,15 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2311
2322
|
>>> async with AsyncGeoboxClient() as client:
|
|
2312
2323
|
>>> await client.proxy_basemap(url='proxy_server_url')
|
|
2313
2324
|
"""
|
|
2314
|
-
return await
|
|
2325
|
+
return await AsyncBasemap.proxy_basemap(self, url)
|
|
2315
2326
|
|
|
2316
2327
|
|
|
2317
|
-
async def get_attachments(self, resource: Union['
|
|
2328
|
+
async def get_attachments(self, resource: Union['AsyncMap', 'AsyncVectorLayer', 'AsyncVectorLayerView'], **kwargs) -> List['AsyncAttachment']:
|
|
2318
2329
|
"""
|
|
2319
2330
|
[async] Get the resouces attachments
|
|
2320
2331
|
|
|
2321
2332
|
Args:
|
|
2322
|
-
resource (
|
|
2333
|
+
resource (AsyncMap | AsyncVectorLayer | AsyncVectorLayerView): options are: Map, Vector, View objects
|
|
2323
2334
|
|
|
2324
2335
|
Keyword Args:
|
|
2325
2336
|
element_id (str): the id of the element with attachment.
|
|
@@ -2330,7 +2341,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2330
2341
|
return_count (bool): Whether to return total count. default is False.
|
|
2331
2342
|
|
|
2332
2343
|
Returns:
|
|
2333
|
-
List[
|
|
2344
|
+
List[AsyncAttachment] | int: A list of attachments instances or the total number of attachments.
|
|
2334
2345
|
|
|
2335
2346
|
Raises:
|
|
2336
2347
|
TypeError: if the resource type is not supported
|
|
@@ -2342,18 +2353,18 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2342
2353
|
>>> map = maps[0]
|
|
2343
2354
|
>>> attachments = await client.get_attachments(resource=map)
|
|
2344
2355
|
"""
|
|
2345
|
-
return await
|
|
2356
|
+
return await AsyncAttachment.get_attachments(self, resource=resource, **kwargs)
|
|
2346
2357
|
|
|
2347
2358
|
|
|
2348
2359
|
async def create_attachment(self,
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2360
|
+
name: str,
|
|
2361
|
+
loc_x: int,
|
|
2362
|
+
loc_y: int,
|
|
2363
|
+
resource: Union['AsyncMap', 'AsyncVectorLayer', 'AsyncVectorLayerView'],
|
|
2364
|
+
file: 'AsyncFile',
|
|
2365
|
+
feature: 'AsyncFeature' = None,
|
|
2366
|
+
display_name: str = None,
|
|
2367
|
+
description: str = None, ) -> 'AsyncAttachment':
|
|
2357
2368
|
"""
|
|
2358
2369
|
[async] Create a new Attachment.
|
|
2359
2370
|
|
|
@@ -2361,9 +2372,9 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2361
2372
|
name (str): The name of the scene.
|
|
2362
2373
|
loc_x (int): x parameter of the attachment location.
|
|
2363
2374
|
loc_y (int): y parameter of the attachment location.
|
|
2364
|
-
resource (
|
|
2365
|
-
file (
|
|
2366
|
-
feature (
|
|
2375
|
+
resource (AsyncMap | AsyncVectorLayer | AsyncVectorLayerView): the resource object.
|
|
2376
|
+
file (AsyncFile): the file object.
|
|
2377
|
+
feature (AsyncFeature, optional): the feature object.
|
|
2367
2378
|
display_name (str, optional): The display name of the scene.
|
|
2368
2379
|
description (str, optional): The description of the scene.
|
|
2369
2380
|
|
|
@@ -2380,23 +2391,23 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2380
2391
|
>>> feature = await layer.get_feature(feature_id=1)
|
|
2381
2392
|
>>> file = await client.get_file(uuid="12345678-1234-5678-1234-567812345678")
|
|
2382
2393
|
>>> attachment = await client.create_attachment(name="my_attachment",
|
|
2383
|
-
...
|
|
2384
|
-
...
|
|
2385
|
-
...
|
|
2386
|
-
...
|
|
2387
|
-
...
|
|
2388
|
-
...
|
|
2389
|
-
...
|
|
2390
|
-
"""
|
|
2391
|
-
return await
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2394
|
+
... loc_x=30,
|
|
2395
|
+
... loc_y=50,
|
|
2396
|
+
... resource=layer,
|
|
2397
|
+
... file=file,
|
|
2398
|
+
... feature=feature,
|
|
2399
|
+
... display_name="My Attachment",
|
|
2400
|
+
... description="Attachment Description")
|
|
2401
|
+
"""
|
|
2402
|
+
return await AsyncAttachment.create_attachment(self,
|
|
2403
|
+
name,
|
|
2404
|
+
loc_x,
|
|
2405
|
+
loc_y,
|
|
2406
|
+
resource,
|
|
2407
|
+
file,
|
|
2408
|
+
feature,
|
|
2409
|
+
display_name,
|
|
2410
|
+
description)
|
|
2400
2411
|
|
|
2401
2412
|
|
|
2402
2413
|
async def update_attachment(self, attachment_id: int, **kwargs) -> Dict:
|
|
@@ -2424,10 +2435,10 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2424
2435
|
>>> async with AsyncGeoboxClient() as client:
|
|
2425
2436
|
>>> await client.update_attachment(attachment_id=1, display_name="New Display Name")
|
|
2426
2437
|
"""
|
|
2427
|
-
return await
|
|
2438
|
+
return await AsyncAttachment.update_attachment(self, attachment_id, **kwargs)
|
|
2428
2439
|
|
|
2429
2440
|
|
|
2430
|
-
async def get_apikeys(self, **kwargs) -> List['
|
|
2441
|
+
async def get_apikeys(self, **kwargs) -> List['AsyncApiKey']:
|
|
2431
2442
|
"""
|
|
2432
2443
|
[async] Get a list of apikeys
|
|
2433
2444
|
|
|
@@ -2438,15 +2449,18 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2438
2449
|
limit (int): Maximum number of layers to return. default is 10.
|
|
2439
2450
|
user_id (int): Specific user. privileges required.
|
|
2440
2451
|
|
|
2452
|
+
Returns:
|
|
2453
|
+
AsyncApiKey: list of apikey objects
|
|
2454
|
+
|
|
2441
2455
|
Example:
|
|
2442
2456
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
2443
2457
|
>>> async with AsyncGeoboxClient() as client:
|
|
2444
2458
|
>>> apikeys = await client.get_apikeys()
|
|
2445
2459
|
"""
|
|
2446
|
-
return await
|
|
2460
|
+
return await AsyncApiKey.get_apikeys(self, **kwargs)
|
|
2447
2461
|
|
|
2448
2462
|
|
|
2449
|
-
async def create_apikey(self, name: str, user_id: int = None) -> '
|
|
2463
|
+
async def create_apikey(self, name: str, user_id: int = None) -> 'AsyncApiKey':
|
|
2450
2464
|
"""
|
|
2451
2465
|
[async] Create an ApiKey
|
|
2452
2466
|
|
|
@@ -2455,17 +2469,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2455
2469
|
user_id (int, optional): Specific user. privileges required.
|
|
2456
2470
|
|
|
2457
2471
|
Returns:
|
|
2458
|
-
|
|
2472
|
+
AsyncApiKey: the apikey object
|
|
2459
2473
|
|
|
2460
2474
|
Example:
|
|
2461
2475
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
2462
2476
|
>>> async with AsyncGeoboxClient() as client:
|
|
2463
2477
|
>>> apikey = await client.create_apikey(name='test')
|
|
2464
2478
|
"""
|
|
2465
|
-
return await
|
|
2479
|
+
return await AsyncApiKey.create_apikey(self, name, user_id)
|
|
2466
2480
|
|
|
2467
2481
|
|
|
2468
|
-
async def get_apikey(self, key_id: int) -> '
|
|
2482
|
+
async def get_apikey(self, key_id: int) -> 'AsyncApiKey':
|
|
2469
2483
|
"""
|
|
2470
2484
|
[async] Get an ApiKey
|
|
2471
2485
|
|
|
@@ -2473,17 +2487,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2473
2487
|
key_id (str): the id of the apikey.
|
|
2474
2488
|
|
|
2475
2489
|
Returns:
|
|
2476
|
-
|
|
2490
|
+
AsyncApiKey: the ApiKey object
|
|
2477
2491
|
|
|
2478
2492
|
Example:
|
|
2479
2493
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
2480
2494
|
>>> async with AsyncGeoboxClient() as client:
|
|
2481
2495
|
>>> apikey = await client.get_apikey(key_id=1)
|
|
2482
2496
|
"""
|
|
2483
|
-
return await
|
|
2497
|
+
return await AsyncApiKey.get_apikey(self, key_id)
|
|
2484
2498
|
|
|
2485
2499
|
|
|
2486
|
-
async def get_apikey_by_name(self, name: str, user_id: int = None) -> '
|
|
2500
|
+
async def get_apikey_by_name(self, name: str, user_id: int = None) -> 'AsyncApiKey':
|
|
2487
2501
|
"""
|
|
2488
2502
|
[async] Get an ApiKey by name
|
|
2489
2503
|
|
|
@@ -2492,17 +2506,17 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2492
2506
|
user_id (int, optional): specific user. privileges required.
|
|
2493
2507
|
|
|
2494
2508
|
Returns:
|
|
2495
|
-
|
|
2509
|
+
AsyncApiKey | None: returns the key if a key matches the given name, else None
|
|
2496
2510
|
|
|
2497
2511
|
Example:
|
|
2498
2512
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
2499
2513
|
>>> async with AsyncGeoboxClient() as client:
|
|
2500
2514
|
>>> apikey = await client.get_apikey_by_name(name='test')
|
|
2501
2515
|
"""
|
|
2502
|
-
return await
|
|
2516
|
+
return await AsyncApiKey.get_apikey_by_name(self, name, user_id)
|
|
2503
2517
|
|
|
2504
2518
|
|
|
2505
|
-
async def get_logs(self, **kwargs) -> List['
|
|
2519
|
+
async def get_logs(self, **kwargs) -> List['AsyncLog']:
|
|
2506
2520
|
"""
|
|
2507
2521
|
[async] Get a list of Logs
|
|
2508
2522
|
|
|
@@ -2518,29 +2532,29 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2518
2532
|
activity_type (str): the user activity type.
|
|
2519
2533
|
|
|
2520
2534
|
Returns:
|
|
2521
|
-
List[
|
|
2535
|
+
List[AsyncLog]: a list of logs
|
|
2522
2536
|
|
|
2523
2537
|
Example:
|
|
2524
2538
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
2525
2539
|
>>> async with AsyncGeoboxClient() as client:
|
|
2526
2540
|
>>> logs = await client.get_logs()
|
|
2527
2541
|
"""
|
|
2528
|
-
return await
|
|
2542
|
+
return await AsyncLog.get_logs(self, **kwargs)
|
|
2529
2543
|
|
|
2530
2544
|
|
|
2531
2545
|
async def get_api_usage(self,
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2546
|
+
resource: Union['AsyncUser', 'AsyncApiKey'],
|
|
2547
|
+
scale: 'UsageScale',
|
|
2548
|
+
param: 'UsageParam',
|
|
2549
|
+
from_date: 'datetime' = None,
|
|
2550
|
+
to_date: 'datetime' = None,
|
|
2551
|
+
days_before_now: int = None,
|
|
2552
|
+
limit: int = None) -> List:
|
|
2539
2553
|
"""
|
|
2540
2554
|
[async] Get the api usage of a user
|
|
2541
2555
|
|
|
2542
2556
|
Args:
|
|
2543
|
-
resource (
|
|
2557
|
+
resource (AsyncUser | AsyncApiKey): User or ApiKey object.
|
|
2544
2558
|
scale (UsageScale): the scale of the report.
|
|
2545
2559
|
param (UsageParam): traffic or calls.
|
|
2546
2560
|
from_date (datetime, optional): datetime object in this format: "%Y-%m-%dT%H:%M:%S".
|
|
@@ -2564,21 +2578,21 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2564
2578
|
... param=UsageParam.Calls,
|
|
2565
2579
|
... days_before_now=5)
|
|
2566
2580
|
"""
|
|
2567
|
-
return await
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2581
|
+
return await AsyncUsage.get_api_usage(self,
|
|
2582
|
+
resource=resource,
|
|
2583
|
+
scale=scale,
|
|
2584
|
+
param=param,
|
|
2585
|
+
from_date=from_date,
|
|
2586
|
+
to_date=to_date,
|
|
2587
|
+
days_before_now=days_before_now,
|
|
2588
|
+
limit=limit)
|
|
2575
2589
|
|
|
2576
2590
|
|
|
2577
2591
|
async def get_process_usage(self,
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2592
|
+
user_id: int = None,
|
|
2593
|
+
from_date: datetime = None,
|
|
2594
|
+
to_date: datetime = None,
|
|
2595
|
+
days_before_now: int = None) -> float:
|
|
2582
2596
|
"""
|
|
2583
2597
|
[async] Get process usage of a user in seconds
|
|
2584
2598
|
|
|
@@ -2599,11 +2613,11 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2599
2613
|
>>> async with AsyncGeoboxClient() as client:
|
|
2600
2614
|
>>> process_usage = await client.get_process_usage(days_before_now=5)
|
|
2601
2615
|
"""
|
|
2602
|
-
return await
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2616
|
+
return await AsyncUsage.get_process_usage(self,
|
|
2617
|
+
user_id=user_id,
|
|
2618
|
+
from_date=from_date,
|
|
2619
|
+
to_date=to_date,
|
|
2620
|
+
days_before_now=days_before_now)
|
|
2607
2621
|
|
|
2608
2622
|
|
|
2609
2623
|
async def get_usage_summary(self, user_id: int = None) -> Dict:
|
|
@@ -2621,7 +2635,7 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2621
2635
|
>>> async with AsyncGeoboxClient() as client:
|
|
2622
2636
|
>>> usage_summary = await client.get_usage_summary()
|
|
2623
2637
|
"""
|
|
2624
|
-
return await
|
|
2638
|
+
return await AsyncUsage.get_usage_summary(self, user_id=user_id)
|
|
2625
2639
|
|
|
2626
2640
|
|
|
2627
2641
|
async def update_usage(self, user_id: int = None) -> Dict:
|
|
@@ -2639,101 +2653,4 @@ class AsyncGeoboxClient(SyncGeoboxClient):
|
|
|
2639
2653
|
>>> async with AsyncGeoboxClient() as client:
|
|
2640
2654
|
>>> await client.update_usage()
|
|
2641
2655
|
"""
|
|
2642
|
-
return await
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
async def raster_calculator(self,
|
|
2646
|
-
variables: str,
|
|
2647
|
-
expr: str,
|
|
2648
|
-
output_raster_name: str,
|
|
2649
|
-
match_raster_uuid: Optional[str] = None,
|
|
2650
|
-
resample: AnalysisResampleMethod = AnalysisResampleMethod.bilinear,
|
|
2651
|
-
out_dtype: AnalysisDataType = AnalysisDataType.float32,
|
|
2652
|
-
dst_nodata: int = -9999,
|
|
2653
|
-
user_id: Optional[int] = None) -> 'Task':
|
|
2654
|
-
"""
|
|
2655
|
-
[async] Perform raster calculator operations on multiple raster datasets.
|
|
2656
|
-
|
|
2657
|
-
it allows you to perform mathematical operations on one or more raster datasets using NumPy expressions.
|
|
2658
|
-
Variables in the expression correspond to raster datasets specified in the variables dictionary.
|
|
2659
|
-
|
|
2660
|
-
Examples:
|
|
2661
|
-
NDVI calculation: variables='{"NIR": "raster_uuid_1", "RED": "raster_uuid_2"}', expr="(NIR-RED)/(NIR+RED)"
|
|
2662
|
-
Slope threshold: variables='{"SLOPE": "raster_uuid_1"}', expr="np.where(SLOPE>30,1,0)"
|
|
2663
|
-
Multi-band operations: variables='{"IMG": ["raster_uuid_1", 2]}', expr="IMG*2"
|
|
2664
|
-
|
|
2665
|
-
Args:
|
|
2666
|
-
variables (str): JSON string mapping variable names to raster specifications. Format: '{"NIR": "raster_uuid_1", "RED": "raster_uuid_2"}' or '{"IMG": ["raster_uuid_1", 2]}' for multi-band operations.
|
|
2667
|
-
expr (str): Mathematical expression using NumPy syntax. Use variable names from the variables dict, e.g., '(NIR-RED)/(NIR+RED)' or 'where(SLOPE>30,1,0)' or 'where((dist_to_highway < 1000) & (slope < 10), 1, 0)' .Supported functions: np, sin, cos, tan, asin, acos, atan, sinh, cosh, tanh, exp, log, log10, sqrt, abs, floor, ceil, round, minimum, maximum, clip, where, isnan, isfinite, pi, e.
|
|
2668
|
-
output_raster_name (str): Name for the output raster dataset.
|
|
2669
|
-
match_raster_uuid (str, optional): Optional raster UUID to match the output grid and projection. If not provided, the first variable becomes the reference grid.
|
|
2670
|
-
resample (CropResample, optional): Resampling method: 'near', 'bilinear', 'cubic', 'lanczos', etc. default: CropResample.near
|
|
2671
|
-
out_dtype (AnalysisDataType, optional): Data type for the output raster (e.g., int16, float32). default: AnalysisDataType.float32
|
|
2672
|
-
dst_nodata (int, optional): NoData value for the output raster. default = -9999
|
|
2673
|
-
user_id (int, optional): specific user. priviledges required!
|
|
2674
|
-
|
|
2675
|
-
Returns:
|
|
2676
|
-
Task: task instance of the process
|
|
2677
|
-
|
|
2678
|
-
Example:
|
|
2679
|
-
>>> from geobox.aio import AsyncGeoboxClient
|
|
2680
|
-
>>> async with AsyncGeoboxClient() as client:
|
|
2681
|
-
>>> task = await client.raster_calculator(api=client, variables={"NIR": "raster_uuid_1", "RED": "raster_uuid_2"},
|
|
2682
|
-
... expr='where(SLOPE>30,1,0)',
|
|
2683
|
-
... output_raster_name='test')
|
|
2684
|
-
"""
|
|
2685
|
-
from .analysis import Analysis
|
|
2686
|
-
return await Analysis.calculator(self,
|
|
2687
|
-
variables=variables,
|
|
2688
|
-
expr=expr,
|
|
2689
|
-
output_raster_name=output_raster_name,
|
|
2690
|
-
match_raster_uuid=match_raster_uuid,
|
|
2691
|
-
resample=resample,
|
|
2692
|
-
out_dtype=out_dtype,
|
|
2693
|
-
dst_nodata=dst_nodata,
|
|
2694
|
-
user_id=user_id)
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
async def create_constant_raster(self,
|
|
2698
|
-
output_raster_name: str,
|
|
2699
|
-
extent: str,
|
|
2700
|
-
value : int,
|
|
2701
|
-
pixel_size: int = 10,
|
|
2702
|
-
dtype: AnalysisDataType = AnalysisDataType.float32,
|
|
2703
|
-
nodata: int = -9999,
|
|
2704
|
-
align_to: Optional[str] = None,
|
|
2705
|
-
user_id: Optional[int] = None) -> 'Task':
|
|
2706
|
-
"""
|
|
2707
|
-
[async] Create a raster filled with a constant value.
|
|
2708
|
-
|
|
2709
|
-
This endpoint creates a north-up GeoTIFF filled with a constant value.
|
|
2710
|
-
Only users with Publisher role or higher can perform this operation.
|
|
2711
|
-
|
|
2712
|
-
Args:
|
|
2713
|
-
output_raster_name (str): Name for the output constant raster dataset.
|
|
2714
|
-
extent (str): Extent as 'minX,minY,maxX,maxY' (e.g., '0,0,100,100').
|
|
2715
|
-
value (int): Constant value to fill the raster with.
|
|
2716
|
-
pixel_size (int, optional): Pixel size for the output raster (must be > 0). default: 10
|
|
2717
|
-
dtype (AnalysisDataType, optoinal): Output data type. default: AnalysisDataType.float32
|
|
2718
|
-
nodata (int, optional): NoData value for the raster. default: -9999
|
|
2719
|
-
align_to (str, optional): Grid origin to snap to as 'x0,y0' (e.g., '0,0').
|
|
2720
|
-
user_id (int, optional): specific user. priviledges required!
|
|
2721
|
-
|
|
2722
|
-
Returns:
|
|
2723
|
-
Task: task instance of the process
|
|
2724
|
-
|
|
2725
|
-
Example:
|
|
2726
|
-
>>> from geobox.aio import AsyncGeoboxClient
|
|
2727
|
-
>>> async with AsyncGeoboxClient() as client:
|
|
2728
|
-
>>> task = await client.create_constant_raster(output_raster_name='test', extent='0,0,100,100', value=10)
|
|
2729
|
-
"""
|
|
2730
|
-
from .analysis import Analysis
|
|
2731
|
-
return await Analysis.constant(self,
|
|
2732
|
-
output_raster_name=output_raster_name,
|
|
2733
|
-
extent=extent,
|
|
2734
|
-
value=value,
|
|
2735
|
-
pixel_size=pixel_size,
|
|
2736
|
-
dtype=dtype,
|
|
2737
|
-
nodata=nodata,
|
|
2738
|
-
align_to=align_to,
|
|
2739
|
-
user_id=user_id)
|
|
2656
|
+
return await AsyncUsage.update_usage(self, user_id=user_id)
|