geobox 2.2.3__py3-none-any.whl → 2.2.5__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/query.py CHANGED
@@ -483,7 +483,7 @@ class AsyncQuery(AsyncBase):
483
483
  "sql": kwargs.get('sql'),
484
484
  "params": kwargs.get('params')
485
485
  }
486
- await super()._update(self.endpoint, data)
486
+ return await super()._update(self.endpoint, data)
487
487
 
488
488
 
489
489
  async def save(self) -> None:
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=f'{self.endpoint}features/',
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[AsyncFeature] | int: A list of Feature instances or the features count if return_count is True.
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/enums.py CHANGED
@@ -3,16 +3,16 @@ from enum import Enum
3
3
  # File Enums
4
4
  class InputGeomType(Enum):
5
5
  POINT = 'POINT'
6
- LINE = 'LINE'
6
+ LINESTRING = 'LINESTRING'
7
7
  POLYGON = 'POLYGON'
8
8
  MULTIPOINT = 'MULTIPOINT'
9
- MULTILINE = 'MULTILINE'
9
+ MULTILINESTRING = 'MULTILINESTRING'
10
10
  MULTIPOLYGON = 'MULTIPOLYGON'
11
11
  POINT_Z = 'POINTZ'
12
- LINE_Z = 'LINEZ'
12
+ LINESTRING_Z = 'LINESTRINGZ'
13
13
  POLYGON_Z = 'POLYGONZ'
14
14
  MULTIPOINT_Z = 'MULTIPOINTZ'
15
- MULTILINE_Z = 'MULTILINEZ'
15
+ MULTILINESTRING_Z = 'MULTILINESTRINGZ'
16
16
  MULTIPOLYGON_Z = 'MULTIPOLYGONZ'
17
17
 
18
18
  class PublishFileType(Enum):
geobox/query.py CHANGED
@@ -482,7 +482,7 @@ class Query(Base):
482
482
  "sql": kwargs.get('sql'),
483
483
  "params": kwargs.get('params')
484
484
  }
485
- super()._update(self.endpoint, data)
485
+ return super()._update(self.endpoint, data)
486
486
 
487
487
 
488
488
  def save(self) -> None:
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
- ... skip=0,
695
- ... limit=100,
696
- ... skip_geometry=False,
697
- ... return_count=False,
698
- ... select_fields="fclass, osm_id",
699
- ... out_srid=3857,
700
- ... bbox_srid=3857)
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
- endpoint=f'{self.endpoint}features/',
724
- params=params,
725
- factory_func=lambda api, item, srid: Feature(self, srid, item),
726
- geojson=True)
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
- ... skip=0,
481
- ... limit=100,
482
- ... skip_geometry=False,
483
- ... return_count=False,
484
- ... select_fields="fclass, osm_id",
485
- ... out_srid=4326,
486
- ... bbox_srid=4326)
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':
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: geobox
3
- Version: 2.2.3
3
+ Version: 2.2.5
4
4
  Summary: SDK for Geobox's APIs
5
5
  Author-email: Hamid Heydari <heydari.h62@gmail.com>
6
6
  License: MIT
@@ -5,7 +5,7 @@ geobox/attachment.py,sha256=HA_UUBr4buuivCDI3rizmHqil8olCea3Lv3daRAfMY4,13274
5
5
  geobox/base.py,sha256=paE3-Wshzp4ykpkbXdIZ6MVPDwyTRgrr-OTYd9BK2o8,13353
6
6
  geobox/basemap.py,sha256=BSDb7mJm-Pmm5GRqvsHxKiqBNL_wfzy_GVv1qqTVFLc,5746
7
7
  geobox/dashboard.py,sha256=Gkt66_WqJEco2olFfZ7W8ux3IhhbbudVqfLlB3t8MCs,13039
8
- geobox/enums.py,sha256=jA5KwOdTMkFhXEBgcP-8bgi0cFyD1NFN4QpLelow0HA,8044
8
+ geobox/enums.py,sha256=02QRtUeHSaf3iyLSIcmFKkZNcRA_HWSwAGVI6PxTOEQ,8092
9
9
  geobox/exception.py,sha256=jvpnv0M2Ck1FpxHTL_aKYWxGvLnCQ3d9vOrMIktjw1U,1507
10
10
  geobox/feature.py,sha256=YP-wCSxEin93ji6Hq72LG7j1VjGC0Jk05g06IOW_W8I,20455
11
11
  geobox/field.py,sha256=_5CS3kj3P-BKCbtAUd7dtkPBnN0D0H1ZKPlKx8DValw,11188
@@ -16,7 +16,7 @@ geobox/map.py,sha256=SUHGA5GEGeCHsjZbRgnd7RGTKqSxpk3oyC1RKZfK-FA,39042
16
16
  geobox/model3d.py,sha256=ygzPuFFkXIERm2dMQE5U_kwW_fsS9OLIE_XrPMsw54I,15318
17
17
  geobox/mosaic.py,sha256=ImJ6D2T63v86NKUKMEzWToed0jnfFtFz7HqO4mJU7DQ,25817
18
18
  geobox/plan.py,sha256=-Mw5QkLK7Sd1SoTnwQ_FHIXUyDNCGVZcK8Ba_naIuP0,13348
19
- geobox/query.py,sha256=Bv9PsXRzcPldm0iX_f2xBXu2swiIoesLB6FMWFCRuz0,25997
19
+ geobox/query.py,sha256=TaVHF2l9T3bpUyqUQMJbkx-E_NZdOMPmOS4_-9VmKzw,26004
20
20
  geobox/raster.py,sha256=3Vl4eX60DVRGgVI51A2AF_o5eaKsM8LLn5ODGE6Dspg,33805
21
21
  geobox/raster_analysis.py,sha256=yoWA5_-GixyAJMpo8cHmZcYrEYUvwo2395BwrGlUBaA,34920
22
22
  geobox/route.py,sha256=cKZTTHBHM8woWbhHIpCvrRX_doJcTkGktouee0z7oG0,2723
@@ -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=QYa_-eBk9WdMYUdGeC8MaqsYm1P6tk5J2tgejrzgv_g,58701
32
+ geobox/vectorlayer.py,sha256=R4EFFrfJkGbIj63VnqKE2YW1Io-FqGET2lb6DEv1N5I,58803
33
33
  geobox/version.py,sha256=KcPCSe9vD6rc11qaTVO8UxYwXRX-0r0tQVaF-CJPfB0,10797
34
- geobox/view.py,sha256=DJL1wdccZC_ZR6V5hYDYDFZCC9lqle4wheaIOxOa__I,43266
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
@@ -49,7 +49,7 @@ geobox/aio/map.py,sha256=YZNaOBh9E38-bbeYsLxKjiVHhC-hoi3KDbG1fgIJsRs,41228
49
49
  geobox/aio/model3d.py,sha256=KFm5h2lW_WR6BvFshRtfVnniCc0yOS1F9Djhj_Q-tOA,16440
50
50
  geobox/aio/mosaic.py,sha256=07DLl1xO92OXlJxAsxHO1NmBWRlfyWo5aBgoX6hlVxc,27960
51
51
  geobox/aio/plan.py,sha256=3RrDjDHWBlFO3fA-FdL_IWC5W5mtZjm8SeJA2NzuJOE,13879
52
- geobox/aio/query.py,sha256=1rackooJ46llzrw0cxAhfw0_1asNo7RKSIVuJnVrT9I,27770
52
+ geobox/aio/query.py,sha256=d2voJ7A38wxdlRZH7Hv5xJXJUqzDrsUFe7FECjsadjg,27777
53
53
  geobox/aio/raster.py,sha256=t4oY5As0_3o1Z2JVYwwyQ_Rks-Oa4t4zJkWVTnD_C_g,35912
54
54
  geobox/aio/raster_analysis.py,sha256=aSU_E8TXrex2x9w3S4WCWGTu0q81qOBN0rXo5uG5IgM,36672
55
55
  geobox/aio/route.py,sha256=dkKsK4ZjL7XikgoZ3lJfkr2UXwrmxct4Qt2DzZg0upE,2860
@@ -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=d7BAPjp1MsFWhrgDh3gJ8LBAIA_2-vCGCT0ji9-e1O4,59426
64
+ geobox/aio/vectorlayer.py,sha256=qucLKg76sVSZt6WxU9PL5C6ROJ4uxdxSBXm5dUfIsBA,59801
65
65
  geobox/aio/version.py,sha256=Yt7tKUqHS8rKfTPAm77yAaDajFn0ZEo0UWhA5DN7_uM,11422
66
- geobox/aio/view.py,sha256=CMULdkierGeIvRWdyfqy6FO_9_fgQeSAA1-xdcrl9Uw,45146
66
+ geobox/aio/view.py,sha256=u6TpBsd5PzqCLv6XRJtReeB68C7mxS-WqqDt2BDtxPs,45439
67
67
  geobox/aio/workflow.py,sha256=UwOVMDRjJIiveXbYB8rGO02s5A7fn2BhEvQXkWMSApU,13707
68
- geobox-2.2.3.dist-info/licenses/LICENSE,sha256=AvFB7W94sJYKLDhBxLRshL3upexCOG8HQY_1JibB96w,1063
69
- geobox-2.2.3.dist-info/METADATA,sha256=rhrWYWX5FpB_3a3LdlHJd-X_tiWw3CZcy25EJdgysJU,3082
70
- geobox-2.2.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
71
- geobox-2.2.3.dist-info/top_level.txt,sha256=ppXH8Bu2mlB-pLQ6lsoWEm2Gr6wZx1uzkhetsYA5ins,7
72
- geobox-2.2.3.dist-info/RECORD,,
68
+ geobox-2.2.5.dist-info/licenses/LICENSE,sha256=AvFB7W94sJYKLDhBxLRshL3upexCOG8HQY_1JibB96w,1063
69
+ geobox-2.2.5.dist-info/METADATA,sha256=XZQ7x4T4IW7YYNsnDIxeJi_ItmBOowmqNIIAP7o49FQ,3082
70
+ geobox-2.2.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
71
+ geobox-2.2.5.dist-info/top_level.txt,sha256=ppXH8Bu2mlB-pLQ6lsoWEm2Gr6wZx1uzkhetsYA5ins,7
72
+ geobox-2.2.5.dist-info/RECORD,,
File without changes