geobox 2.2.3__py3-none-any.whl → 2.2.4__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/aio/vectorlayer.py +12 -3
- geobox/aio/view.py +7 -3
- geobox/vectorlayer.py +22 -13
- geobox/view.py +15 -11
- {geobox-2.2.3.dist-info → geobox-2.2.4.dist-info}/METADATA +1 -1
- {geobox-2.2.3.dist-info → geobox-2.2.4.dist-info}/RECORD +9 -9
- {geobox-2.2.3.dist-info → geobox-2.2.4.dist-info}/WHEEL +0 -0
- {geobox-2.2.3.dist-info → geobox-2.2.4.dist-info}/licenses/LICENSE +0 -0
- {geobox-2.2.3.dist-info → geobox-2.2.4.dist-info}/top_level.txt +0 -0
geobox/aio/vectorlayer.py
CHANGED
|
@@ -658,10 +658,14 @@ class AsyncVectorLayer(AsyncBase):
|
|
|
658
658
|
return response
|
|
659
659
|
|
|
660
660
|
|
|
661
|
-
async def get_features(self, **kwargs) -> Union[List['AsyncFeature'], int]:
|
|
661
|
+
async def get_features(self, geojson: bool = False, **kwargs) -> Union[List['AsyncFeature'], Dict, int]:
|
|
662
662
|
"""
|
|
663
663
|
[async] Get features from the layer with optional filtering and pagination.
|
|
664
664
|
|
|
665
|
+
Args:
|
|
666
|
+
geojson (bool, optional): If True, returns the raw API response (GeoJSON dict).
|
|
667
|
+
If False, returns a list of Feature objects. default: False.
|
|
668
|
+
|
|
665
669
|
Keyword Args:
|
|
666
670
|
quant_factor (int): Quantization factor. This parameter is only used by topojson encoder and is ignored for other formats. Higher quantizaion value means higher geometry precision. default is 1000000.
|
|
667
671
|
skip (int): Number of features to skip. default is 0.
|
|
@@ -681,7 +685,7 @@ class AsyncVectorLayer(AsyncBase):
|
|
|
681
685
|
bbox_srid (int): srid (epsg code) of bbox. e.g. 4326. default is 3857.
|
|
682
686
|
|
|
683
687
|
Returns:
|
|
684
|
-
List[Feature] | int: A list of Feature instances or the features count if return_count is True.
|
|
688
|
+
List[Feature] | Dict | int: A list of Feature instances or the geojson api response if geojson=True or the features count if return_count is True.
|
|
685
689
|
|
|
686
690
|
Example:
|
|
687
691
|
>>> from geobox.aio import AsyncGeoboxClient
|
|
@@ -718,8 +722,13 @@ class AsyncVectorLayer(AsyncBase):
|
|
|
718
722
|
'bbox_srid': kwargs.get('bbox_srid', 3857)
|
|
719
723
|
}
|
|
720
724
|
|
|
725
|
+
endpoint = f'{self.endpoint}features/'
|
|
726
|
+
|
|
727
|
+
if geojson:
|
|
728
|
+
return await self.api.get(endpoint)
|
|
729
|
+
|
|
721
730
|
return await super()._get_list(api=self.api,
|
|
722
|
-
endpoint=
|
|
731
|
+
endpoint=endpoint,
|
|
723
732
|
params=params,
|
|
724
733
|
factory_func=lambda api, item, srid: AsyncFeature(self, srid, item),
|
|
725
734
|
geojson=True)
|
geobox/aio/view.py
CHANGED
|
@@ -451,10 +451,14 @@ class AsyncVectorLayerView(AsyncVectorLayer):
|
|
|
451
451
|
return await super().calculate_field(target_field, expression, q, bbox, bbox_srid, feature_ids, run_async, user_id)
|
|
452
452
|
|
|
453
453
|
|
|
454
|
-
async def get_features(self, **kwargs) -> Union[List['AsyncFeature'], int]:
|
|
454
|
+
async def get_features(self, geojson: bool = False, **kwargs) -> Union[List['AsyncFeature'], Dict, int]:
|
|
455
455
|
"""
|
|
456
456
|
[async] Get features from the layer with optional filtering and pagination.
|
|
457
457
|
|
|
458
|
+
Args:
|
|
459
|
+
geojson (bool, optional): If True, returns the raw API response (GeoJSON dict).
|
|
460
|
+
If False, returns a list of Feature objects. default: False.
|
|
461
|
+
|
|
458
462
|
Keyword Args:
|
|
459
463
|
quant_factor (int): Quantization factor. This parameter is only used by topojson encoder and is ignored for other formats. Higher quantizaion value means higher geometry precision. default is 1000000.
|
|
460
464
|
skip (int): Number of features to skip. default is 0.
|
|
@@ -474,7 +478,7 @@ class AsyncVectorLayerView(AsyncVectorLayer):
|
|
|
474
478
|
bbox_srid (int): srid (epsg code) of bbox. e.g. 4326. default is 3857.
|
|
475
479
|
|
|
476
480
|
Returns:
|
|
477
|
-
List[
|
|
481
|
+
List[Feature] | Dict | int: A list of Feature instances or the geojson api response if geojson=True or the features count if return_count is True.
|
|
478
482
|
|
|
479
483
|
|
|
480
484
|
Example:
|
|
@@ -491,7 +495,7 @@ class AsyncVectorLayerView(AsyncVectorLayer):
|
|
|
491
495
|
... out_srid=4326,
|
|
492
496
|
... bbox_srid=4326)
|
|
493
497
|
"""
|
|
494
|
-
return await super().get_features(**kwargs)
|
|
498
|
+
return await super().get_features(geojson=geojson, **kwargs)
|
|
495
499
|
|
|
496
500
|
|
|
497
501
|
async def get_feature(self, feature_id: int, out_srid: int = AsyncFeature.BASE_SRID) -> 'AsyncFeature':
|
geobox/vectorlayer.py
CHANGED
|
@@ -660,10 +660,14 @@ class VectorLayer(Base):
|
|
|
660
660
|
return response
|
|
661
661
|
|
|
662
662
|
|
|
663
|
-
def get_features(self, **kwargs) -> Union[List['Feature'], int]:
|
|
663
|
+
def get_features(self, geojson: bool = False, **kwargs) -> Union[List['Feature'], Dict, int]:
|
|
664
664
|
"""
|
|
665
665
|
Get features from the layer with optional filtering and pagination.
|
|
666
666
|
|
|
667
|
+
Args:
|
|
668
|
+
geojson (bool, optional): If True, returns the raw API response (GeoJSON dict).
|
|
669
|
+
If False, returns a list of Feature objects. default: False.
|
|
670
|
+
|
|
667
671
|
Keyword Args:
|
|
668
672
|
quant_factor (int): Quantization factor. This parameter is only used by topojson encoder and is ignored for other formats. Higher quantizaion value means higher geometry precision. default is 1000000.
|
|
669
673
|
skip (int): Number of features to skip. default is 0.
|
|
@@ -683,7 +687,7 @@ class VectorLayer(Base):
|
|
|
683
687
|
bbox_srid (int): srid (epsg code) of bbox. e.g. 4326. default is 3857.
|
|
684
688
|
|
|
685
689
|
Returns:
|
|
686
|
-
List[Feature] | int: A list of Feature instances or the features count if return_count is True.
|
|
690
|
+
List[Feature] | Dict | int: A list of Feature instances or the geojson api response if geojson=True or the features count if return_count is True.
|
|
687
691
|
|
|
688
692
|
Example:
|
|
689
693
|
>>> from geobox import GeoboxClient
|
|
@@ -691,13 +695,13 @@ class VectorLayer(Base):
|
|
|
691
695
|
>>> client = GeoboxClient()
|
|
692
696
|
>>> layer = VectorLayer.get_vector(api=client, uuid="12345678-1234-5678-1234-567812345678")
|
|
693
697
|
>>> features = layer.get_features(quant_factor=1000000,
|
|
694
|
-
...
|
|
695
|
-
...
|
|
696
|
-
...
|
|
697
|
-
...
|
|
698
|
-
...
|
|
699
|
-
...
|
|
700
|
-
...
|
|
698
|
+
... skip=0,
|
|
699
|
+
... limit=100,
|
|
700
|
+
... skip_geometry=False,
|
|
701
|
+
... return_count=False,
|
|
702
|
+
... select_fields="fclass, osm_id",
|
|
703
|
+
... out_srid=3857,
|
|
704
|
+
... bbox_srid=3857)
|
|
701
705
|
"""
|
|
702
706
|
params = {
|
|
703
707
|
'f': 'json',
|
|
@@ -719,11 +723,16 @@ class VectorLayer(Base):
|
|
|
719
723
|
'bbox_srid': kwargs.get('bbox_srid', 3857)
|
|
720
724
|
}
|
|
721
725
|
|
|
726
|
+
endpoint = f'{self.endpoint}features/'
|
|
727
|
+
|
|
728
|
+
if geojson:
|
|
729
|
+
return self.api.get(endpoint)
|
|
730
|
+
|
|
722
731
|
return super()._get_list(api=self.api,
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
732
|
+
endpoint=endpoint,
|
|
733
|
+
params=params,
|
|
734
|
+
factory_func=lambda api, item, srid: Feature(self, srid, item),
|
|
735
|
+
geojson=True)
|
|
727
736
|
|
|
728
737
|
|
|
729
738
|
def get_feature(self, feature_id: int, out_srid: int = Feature.BASE_SRID) -> 'Feature':
|
geobox/view.py
CHANGED
|
@@ -445,10 +445,14 @@ class VectorLayerView(VectorLayer):
|
|
|
445
445
|
return super().calculate_field(target_field, expression, q, bbox, bbox_srid, feature_ids, run_async, user_id)
|
|
446
446
|
|
|
447
447
|
|
|
448
|
-
def get_features(self, **kwargs) -> Union[List['Feature'], int]:
|
|
448
|
+
def get_features(self, geojson: bool = False, **kwargs) -> Union[List['Feature'], Dict, int]:
|
|
449
449
|
"""
|
|
450
450
|
Get features from the layer with optional filtering and pagination.
|
|
451
451
|
|
|
452
|
+
Args:
|
|
453
|
+
geojson (bool, optional): If True, returns the raw API response (GeoJSON dict).
|
|
454
|
+
If False, returns a list of Feature objects. default: False.
|
|
455
|
+
|
|
452
456
|
Keyword Args:
|
|
453
457
|
quant_factor (int): Quantization factor. This parameter is only used by topojson encoder and is ignored for other formats. Higher quantizaion value means higher geometry precision. default is 1000000.
|
|
454
458
|
skip (int): Number of features to skip. default is 0.
|
|
@@ -468,7 +472,7 @@ class VectorLayerView(VectorLayer):
|
|
|
468
472
|
bbox_srid (int): srid (epsg code) of bbox. e.g. 4326. default is 3857.
|
|
469
473
|
|
|
470
474
|
Returns:
|
|
471
|
-
List[Feature] | int: A list of Feature instances or the features count if return_count is True.
|
|
475
|
+
List[Feature] | Dict | int: A list of Feature instances or the geojson api response if geojson=True or the features count if return_count is True.
|
|
472
476
|
|
|
473
477
|
|
|
474
478
|
Example:
|
|
@@ -477,15 +481,15 @@ class VectorLayerView(VectorLayer):
|
|
|
477
481
|
>>> client = GeoboxClient()
|
|
478
482
|
>>> layer = VectorLayerView(api=client, name="my_layer", layer_type=LayerType.Point)
|
|
479
483
|
>>> features = layer.get_features(quant_factor=1000000,
|
|
480
|
-
...
|
|
481
|
-
...
|
|
482
|
-
...
|
|
483
|
-
...
|
|
484
|
-
...
|
|
485
|
-
...
|
|
486
|
-
...
|
|
487
|
-
"""
|
|
488
|
-
return super().get_features(**kwargs)
|
|
484
|
+
... skip=0,
|
|
485
|
+
... limit=100,
|
|
486
|
+
... skip_geometry=False,
|
|
487
|
+
... return_count=False,
|
|
488
|
+
... select_fields="fclass, osm_id",
|
|
489
|
+
... out_srid=4326,
|
|
490
|
+
... bbox_srid=4326)
|
|
491
|
+
"""
|
|
492
|
+
return super().get_features(geojson=geojson, **kwargs)
|
|
489
493
|
|
|
490
494
|
|
|
491
495
|
def get_feature(self, feature_id: int, out_srid: int = Feature.BASE_SRID) -> 'Feature':
|
|
@@ -29,9 +29,9 @@ geobox/usage.py,sha256=nnFq95fB4jdR8Uo0T09izejrrv14jpqoqbvQ8nixajg,9185
|
|
|
29
29
|
geobox/user.py,sha256=1tbIfBRko56kHk3BKp3-Jjqm61xlqcmKZq6aKqbxNAY,17953
|
|
30
30
|
geobox/utils.py,sha256=JmlRqDVIo0vBikzH1XakRrCrEIfLA7_eTJnBWBvGhJI,2243
|
|
31
31
|
geobox/vector_tool.py,sha256=q6bKhuUI6Zy6DVJU7s5OnooGlfdCRa1EPHnaLXfjeZo,86273
|
|
32
|
-
geobox/vectorlayer.py,sha256=
|
|
32
|
+
geobox/vectorlayer.py,sha256=R4EFFrfJkGbIj63VnqKE2YW1Io-FqGET2lb6DEv1N5I,58803
|
|
33
33
|
geobox/version.py,sha256=KcPCSe9vD6rc11qaTVO8UxYwXRX-0r0tQVaF-CJPfB0,10797
|
|
34
|
-
geobox/view.py,sha256=
|
|
34
|
+
geobox/view.py,sha256=GLC2ZA7SN_I8bP8KkZjUKYDZHw9RMg00Y7x7LQNyEJY,43361
|
|
35
35
|
geobox/workflow.py,sha256=SWq4y6J4-6GwYn8uKWTAdYj0rX6romF_s20C0Cth8d0,12931
|
|
36
36
|
geobox/aio/__init__.py,sha256=4Ufsv-VOW7FQGD1OmSRKH7E3sLCaKC0MpEMsSMBC3ro,1933
|
|
37
37
|
geobox/aio/api.py,sha256=am3Yl77WWBVibSOuid4vh-L6vca_Y4q4Ff_0Fgd-t0I,110041
|
|
@@ -61,12 +61,12 @@ geobox/aio/tileset.py,sha256=t2pcC2NmS1uVrpJqci9XUuSKEuq4v05fW2AS5QBTK3w,27639
|
|
|
61
61
|
geobox/aio/usage.py,sha256=_I153m0uza7ZooMdHInBVmTt14SCu1qmvvmr80zmVLM,9506
|
|
62
62
|
geobox/aio/user.py,sha256=-7DJW-mi6_wrJFIfL3oto7YqNoLTg7fLAZEFn9yiAhQ,19056
|
|
63
63
|
geobox/aio/vector_tool.py,sha256=_6sFu7WllK82M7E6zl0Tteb7at05OsgMnWUEDlD41sk,92886
|
|
64
|
-
geobox/aio/vectorlayer.py,sha256=
|
|
64
|
+
geobox/aio/vectorlayer.py,sha256=qucLKg76sVSZt6WxU9PL5C6ROJ4uxdxSBXm5dUfIsBA,59801
|
|
65
65
|
geobox/aio/version.py,sha256=Yt7tKUqHS8rKfTPAm77yAaDajFn0ZEo0UWhA5DN7_uM,11422
|
|
66
|
-
geobox/aio/view.py,sha256=
|
|
66
|
+
geobox/aio/view.py,sha256=u6TpBsd5PzqCLv6XRJtReeB68C7mxS-WqqDt2BDtxPs,45439
|
|
67
67
|
geobox/aio/workflow.py,sha256=UwOVMDRjJIiveXbYB8rGO02s5A7fn2BhEvQXkWMSApU,13707
|
|
68
|
-
geobox-2.2.
|
|
69
|
-
geobox-2.2.
|
|
70
|
-
geobox-2.2.
|
|
71
|
-
geobox-2.2.
|
|
72
|
-
geobox-2.2.
|
|
68
|
+
geobox-2.2.4.dist-info/licenses/LICENSE,sha256=AvFB7W94sJYKLDhBxLRshL3upexCOG8HQY_1JibB96w,1063
|
|
69
|
+
geobox-2.2.4.dist-info/METADATA,sha256=ahdZI2Yls6TXeQaGgFtvc3A24CK5jDlBTqumE-Guxa8,3082
|
|
70
|
+
geobox-2.2.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
71
|
+
geobox-2.2.4.dist-info/top_level.txt,sha256=ppXH8Bu2mlB-pLQ6lsoWEm2Gr6wZx1uzkhetsYA5ins,7
|
|
72
|
+
geobox-2.2.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|