pygeobox 1.0.1__py3-none-any.whl → 1.0.2__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.
- pygeobox/__init__.py +63 -63
- pygeobox/api.py +2517 -2517
- pygeobox/apikey.py +232 -232
- pygeobox/attachment.py +297 -297
- pygeobox/base.py +364 -364
- pygeobox/basemap.py +162 -162
- pygeobox/dashboard.py +316 -316
- pygeobox/enums.py +354 -354
- pygeobox/exception.py +47 -47
- pygeobox/field.py +309 -309
- pygeobox/map.py +858 -858
- pygeobox/model3d.py +334 -334
- pygeobox/mosaic.py +647 -647
- pygeobox/plan.py +260 -260
- pygeobox/query.py +668 -668
- pygeobox/raster.py +756 -756
- pygeobox/route.py +63 -63
- pygeobox/scene.py +317 -317
- pygeobox/settings.py +165 -165
- pygeobox/task.py +354 -354
- pygeobox/tile3d.py +294 -294
- pygeobox/tileset.py +585 -585
- pygeobox/user.py +423 -423
- pygeobox/utils.py +43 -43
- pygeobox/vectorlayer.py +1149 -1149
- pygeobox/version.py +248 -248
- pygeobox/view.py +859 -859
- pygeobox/workflow.py +315 -315
- {pygeobox-1.0.1.dist-info → pygeobox-1.0.2.dist-info}/METADATA +18 -24
- pygeobox-1.0.2.dist-info/RECORD +37 -0
- {pygeobox-1.0.1.dist-info → pygeobox-1.0.2.dist-info}/licenses/LICENSE +21 -21
- pygeobox-1.0.1.dist-info/RECORD +0 -37
- {pygeobox-1.0.1.dist-info → pygeobox-1.0.2.dist-info}/WHEEL +0 -0
- {pygeobox-1.0.1.dist-info → pygeobox-1.0.2.dist-info}/top_level.txt +0 -0
pygeobox/route.py
CHANGED
@@ -1,63 +1,63 @@
|
|
1
|
-
from typing import Dict, TYPE_CHECKING
|
2
|
-
from urllib.parse import urljoin, urlencode
|
3
|
-
|
4
|
-
from .enums import RoutingGeometryType, RoutingOverviewLevel
|
5
|
-
from .utils import clean_data
|
6
|
-
|
7
|
-
if TYPE_CHECKING:
|
8
|
-
from . import GeoboxClient
|
9
|
-
|
10
|
-
class Routing:
|
11
|
-
|
12
|
-
BASE_ENDPOINT = 'routing/'
|
13
|
-
|
14
|
-
@classmethod
|
15
|
-
def route(cls, api: 'GeoboxClient', stops: str, **kwargs) -> Dict:
|
16
|
-
"""
|
17
|
-
Find best driving routes between coordinates and return results.
|
18
|
-
|
19
|
-
Args:
|
20
|
-
api (GeoboxClient): The GeoboxClient instance for making requests.
|
21
|
-
stops (str): Comma-separated list of stop coordinates in the format lon,lat;lon,lat.
|
22
|
-
|
23
|
-
Keyword Args:
|
24
|
-
alternatives (bool): Whether to return alternative routes. Default value : False.
|
25
|
-
steps (bool): Whether to include step-by-step navigation instructions. Default value : False.
|
26
|
-
geometries (RoutingGeometryType): Format of the returned geometry.
|
27
|
-
overview (RoutingOverviewLevel): Level of detail in the returned geometry.
|
28
|
-
annotations (bool): Whether to include additional metadata like speed, weight, etc.
|
29
|
-
|
30
|
-
Returns:
|
31
|
-
Dict: the routing output
|
32
|
-
|
33
|
-
Example:
|
34
|
-
>>> from geobox import GeoboxClient
|
35
|
-
>>> from geobox.route import Routing
|
36
|
-
>>> client = GeoboxClient()
|
37
|
-
>>> route = routing.route(client,
|
38
|
-
... stops="53,33;56,36",
|
39
|
-
... alternatives=True,
|
40
|
-
... steps=True,
|
41
|
-
... geometries=RoutingGeometryType.geojson,
|
42
|
-
... overview=RoutingOverviewLevel.full,
|
43
|
-
... annotations=True)
|
44
|
-
or
|
45
|
-
>>> route = client.route(stops="53,33;56,36",
|
46
|
-
... alternatives=True,
|
47
|
-
... steps=True,
|
48
|
-
... geometries=RoutingGeometryType.geojson,
|
49
|
-
... overview=RoutingOverviewLevel.full,
|
50
|
-
... annotations=True)
|
51
|
-
"""
|
52
|
-
params = clean_data({
|
53
|
-
'stops': stops,
|
54
|
-
'alternatives': kwargs.get('alternatives'),
|
55
|
-
'steps': kwargs.get('steps'),
|
56
|
-
'geometries': kwargs.get('geometries').value if kwargs.get('geometries') else None,
|
57
|
-
'overview': kwargs.get('overview').value if kwargs.get('geometries') else None,
|
58
|
-
'annotaions': kwargs.get('annotations')
|
59
|
-
})
|
60
|
-
query_string = urlencode(params)
|
61
|
-
endpoint = f"{cls.BASE_ENDPOINT}route?{query_string}"
|
62
|
-
return api.get(endpoint)
|
63
|
-
|
1
|
+
from typing import Dict, TYPE_CHECKING
|
2
|
+
from urllib.parse import urljoin, urlencode
|
3
|
+
|
4
|
+
from .enums import RoutingGeometryType, RoutingOverviewLevel
|
5
|
+
from .utils import clean_data
|
6
|
+
|
7
|
+
if TYPE_CHECKING:
|
8
|
+
from . import GeoboxClient
|
9
|
+
|
10
|
+
class Routing:
|
11
|
+
|
12
|
+
BASE_ENDPOINT = 'routing/'
|
13
|
+
|
14
|
+
@classmethod
|
15
|
+
def route(cls, api: 'GeoboxClient', stops: str, **kwargs) -> Dict:
|
16
|
+
"""
|
17
|
+
Find best driving routes between coordinates and return results.
|
18
|
+
|
19
|
+
Args:
|
20
|
+
api (GeoboxClient): The GeoboxClient instance for making requests.
|
21
|
+
stops (str): Comma-separated list of stop coordinates in the format lon,lat;lon,lat.
|
22
|
+
|
23
|
+
Keyword Args:
|
24
|
+
alternatives (bool): Whether to return alternative routes. Default value : False.
|
25
|
+
steps (bool): Whether to include step-by-step navigation instructions. Default value : False.
|
26
|
+
geometries (RoutingGeometryType): Format of the returned geometry.
|
27
|
+
overview (RoutingOverviewLevel): Level of detail in the returned geometry.
|
28
|
+
annotations (bool): Whether to include additional metadata like speed, weight, etc.
|
29
|
+
|
30
|
+
Returns:
|
31
|
+
Dict: the routing output
|
32
|
+
|
33
|
+
Example:
|
34
|
+
>>> from geobox import GeoboxClient
|
35
|
+
>>> from geobox.route import Routing
|
36
|
+
>>> client = GeoboxClient()
|
37
|
+
>>> route = routing.route(client,
|
38
|
+
... stops="53,33;56,36",
|
39
|
+
... alternatives=True,
|
40
|
+
... steps=True,
|
41
|
+
... geometries=RoutingGeometryType.geojson,
|
42
|
+
... overview=RoutingOverviewLevel.full,
|
43
|
+
... annotations=True)
|
44
|
+
or
|
45
|
+
>>> route = client.route(stops="53,33;56,36",
|
46
|
+
... alternatives=True,
|
47
|
+
... steps=True,
|
48
|
+
... geometries=RoutingGeometryType.geojson,
|
49
|
+
... overview=RoutingOverviewLevel.full,
|
50
|
+
... annotations=True)
|
51
|
+
"""
|
52
|
+
params = clean_data({
|
53
|
+
'stops': stops,
|
54
|
+
'alternatives': kwargs.get('alternatives'),
|
55
|
+
'steps': kwargs.get('steps'),
|
56
|
+
'geometries': kwargs.get('geometries').value if kwargs.get('geometries') else None,
|
57
|
+
'overview': kwargs.get('overview').value if kwargs.get('geometries') else None,
|
58
|
+
'annotaions': kwargs.get('annotations')
|
59
|
+
})
|
60
|
+
query_string = urlencode(params)
|
61
|
+
endpoint = f"{cls.BASE_ENDPOINT}route?{query_string}"
|
62
|
+
return api.get(endpoint)
|
63
|
+
|