sentinelhub 3.11.2__tar.gz → 3.11.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/PKG-INFO +1 -1
  2. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/__init__.py +0 -2
  3. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/_version.py +1 -1
  4. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/api/__init__.py +0 -1
  5. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/api/batch/process.py +1 -1
  6. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/api/ogc.py +2 -45
  7. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/constants.py +0 -1
  8. sentinelhub-3.11.2/sentinelhub/api/fis.py +0 -143
  9. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/.gitignore +0 -0
  10. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/LICENSE.md +0 -0
  11. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/README.md +0 -0
  12. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/pyproject.toml +0 -0
  13. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/.utmzones.geojson +0 -0
  14. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/api/base.py +0 -0
  15. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/api/base_request.py +0 -0
  16. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/api/batch/__init__.py +0 -0
  17. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/api/batch/base.py +0 -0
  18. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/api/batch/process_v2.py +0 -0
  19. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/api/batch/statistical.py +0 -0
  20. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/api/batch/utils.py +0 -0
  21. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/api/byoc.py +0 -0
  22. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/api/catalog.py +0 -0
  23. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/api/opensearch.py +0 -0
  24. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/api/process.py +0 -0
  25. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/api/statistical.py +0 -0
  26. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/api/utils.py +0 -0
  27. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/api/wfs.py +0 -0
  28. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/areas.py +0 -0
  29. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/aws/__init__.py +0 -0
  30. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/aws/batch.py +0 -0
  31. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/aws/client.py +0 -0
  32. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/aws/commands.py +0 -0
  33. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/aws/constants.py +0 -0
  34. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/aws/data.py +0 -0
  35. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/aws/data_safe.py +0 -0
  36. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/aws/request.py +0 -0
  37. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/base.py +0 -0
  38. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/commands.py +0 -0
  39. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/config.py +0 -0
  40. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/data_collections.py +0 -0
  41. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/data_collections_bands.py +0 -0
  42. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/data_utils.py +0 -0
  43. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/decoding.py +0 -0
  44. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/download/__init__.py +0 -0
  45. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/download/client.py +0 -0
  46. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/download/handlers.py +0 -0
  47. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/download/models.py +0 -0
  48. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/download/rate_limit.py +0 -0
  49. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/download/sentinelhub_client.py +0 -0
  50. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/download/sentinelhub_statistical_client.py +0 -0
  51. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/download/session.py +0 -0
  52. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/evalscript.py +0 -0
  53. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/exceptions.py +0 -0
  54. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/geo_utils.py +0 -0
  55. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/geometry.py +0 -0
  56. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/geopedia/__init__.py +0 -0
  57. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/geopedia/core.py +0 -0
  58. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/geopedia/request.py +0 -0
  59. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/io_utils.py +0 -0
  60. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/py.typed +0 -0
  61. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/testing_utils.py +0 -0
  62. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/time_utils.py +0 -0
  63. {sentinelhub-3.11.2 → sentinelhub-3.11.4}/sentinelhub/types.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sentinelhub
3
- Version: 3.11.2
3
+ Version: 3.11.4
4
4
  Summary: Python API for Sentinel Hub
5
5
  Project-URL: Homepage, https://github.com/sentinel-hub/sentinelhub-py
6
6
  Project-URL: Documentation, https://sentinelhub-py.readthedocs.io
@@ -14,7 +14,6 @@ from .api import (
14
14
  ByocCollectionAdditionalData,
15
15
  ByocCollectionBand,
16
16
  ByocTile,
17
- FisRequest,
18
17
  SentinelHubBatchStatistical,
19
18
  SentinelHubBYOC,
20
19
  SentinelHubCatalog,
@@ -30,7 +29,6 @@ from .api import (
30
29
  monitor_batch_statistical_job,
31
30
  opensearch,
32
31
  )
33
- from .api.fis import HistogramType
34
32
  from .api.ogc import CustomUrlParam
35
33
  from .api.opensearch import get_area_dates, get_area_info, get_tile_info, get_tile_info_id
36
34
  from .areas import (
@@ -1,3 +1,3 @@
1
1
  """Version of the sentinelhub package."""
2
2
 
3
- __version__ = "3.11.2"
3
+ __version__ = "3.11.4"
@@ -16,7 +16,6 @@ from .batch import (
16
16
  )
17
17
  from .byoc import ByocCollection, ByocCollectionAdditionalData, ByocCollectionBand, ByocTile, SentinelHubBYOC
18
18
  from .catalog import SentinelHubCatalog
19
- from .fis import FisRequest
20
19
  from .ogc import WcsRequest, WmsRequest
21
20
  from .process import AsyncProcessRequest, SentinelHubRequest, get_async_running_status
22
21
  from .statistical import SentinelHubStatistical
@@ -87,7 +87,7 @@ class BatchProcessClient(BaseBatchClient):
87
87
  "processRequest": request_dict,
88
88
  "input": input,
89
89
  "output": output,
90
- "instance_type": instance_type,
90
+ "instanceType": instance_type,
91
91
  "description": description,
92
92
  **kwargs,
93
93
  }
@@ -19,7 +19,7 @@ from ..data_collections import DataCollection
19
19
  from ..download import DownloadRequest, SentinelHubDownloadClient
20
20
  from ..geo_utils import get_image_dimension
21
21
  from ..geometry import BBox, Geometry
22
- from ..time_utils import RawTimeIntervalType, RawTimeType, filter_times, parse_time_interval, serialize_time
22
+ from ..time_utils import RawTimeIntervalType, RawTimeType, filter_times, serialize_time
23
23
  from .wfs import WebFeatureService
24
24
 
25
25
  LOGGER = logging.getLogger(__name__)
@@ -147,9 +147,6 @@ class OgcRequest(DataRequest):
147
147
  if param not in CustomUrlParam:
148
148
  raise ValueError(f"Parameter {param} is not a valid custom url parameter. Please check and fix.")
149
149
 
150
- if self.service_type is ServiceType.FIS and CustomUrlParam.GEOMETRY in self.custom_url_params:
151
- raise ValueError(f"{CustomUrlParam.GEOMETRY} should not be a custom url parameter of a FIS request")
152
-
153
150
  def create_request(self, reset_wfs_iterator: bool = False) -> None:
154
151
  """Set download requests
155
152
 
@@ -346,7 +343,6 @@ class OgcImageService:
346
343
  date: datetime.datetime | None = None,
347
344
  size_x: None | str | int = None,
348
345
  size_y: None | str | int = None,
349
- geometry: None | BBox | Geometry = None,
350
346
  ) -> str:
351
347
  """Returns url to Sentinel Hub's OGC service for the product specified by the OgcRequest and date.
352
348
 
@@ -366,8 +362,6 @@ class OgcImageService:
366
362
  params = {**params, **self._get_wms_url_parameters(request, size_x, size_y)} # type: ignore[arg-type]
367
363
  elif request.service_type is ServiceType.WCS:
368
364
  params = {**params, **self._get_wcs_url_parameters(request, size_x, size_y)} # type: ignore[arg-type]
369
- elif request.service_type is ServiceType.FIS:
370
- params = {**params, **self._get_fis_parameters(request, geometry)} # type: ignore[arg-type]
371
365
 
372
366
  return f"{url}/{authority}?{urlencode(params)}"
373
367
 
@@ -386,7 +380,7 @@ class OgcImageService:
386
380
 
387
381
  @staticmethod
388
382
  def _get_common_url_parameters(request: OgcRequest) -> dict[str, Any]:
389
- """Returns parameters common dictionary for WMS, WCS and FIS request.
383
+ """Returns parameters common dictionary for WMS, and WCS request.
390
384
 
391
385
  :param request: OGC-type request with specified bounding box, cloud coverage for specific product.
392
386
  :return: dictionary with parameters
@@ -477,43 +471,6 @@ class OgcImageService:
477
471
  """
478
472
  return {"RESX": size_x, "RESY": size_y, "COVERAGE": request.layer, "REQUEST": "GetCoverage", "VERSION": "1.1.2"}
479
473
 
480
- @staticmethod
481
- def _get_fis_parameters(request: OgcRequest, geometry: BBox | Geometry) -> dict[str, Any]:
482
- """Returns parameters dictionary for FIS request.
483
-
484
- :param request: OGC-type request with specified bounding box, cloud coverage for specific product.
485
- :param geometry: list of bounding boxes or geometries
486
- :return: dictionary with parameters
487
- """
488
- start_time, end_time = serialize_time(parse_time_interval(request.time), use_tz=True)
489
-
490
- params = {
491
- "CRS": CRS.ogc_string(geometry.crs),
492
- "LAYER": request.layer,
493
- "RESOLUTION": request.resolution, # type: ignore[attr-defined]
494
- "TIME": f"{start_time}/{end_time}",
495
- }
496
-
497
- if not isinstance(geometry, (BBox, Geometry)):
498
- raise ValueError(
499
- f"Each geometry must be an instance of sentinelhub.{BBox.__name__} or "
500
- f"sentinelhub.{Geometry.__name__} but {geometry} found"
501
- )
502
- if geometry.crs is CRS.WGS84:
503
- geometry = geometry.reverse()
504
- if isinstance(geometry, Geometry):
505
- params["GEOMETRY"] = geometry.wkt
506
- else:
507
- params["BBOX"] = str(geometry)
508
-
509
- if request.bins: # type: ignore[attr-defined]
510
- params["BINS"] = request.bins # type: ignore[attr-defined]
511
-
512
- if request.histogram_type: # type: ignore[attr-defined]
513
- params["TYPE"] = request.histogram_type.value # type: ignore[attr-defined]
514
-
515
- return params
516
-
517
474
  def get_dates(self, request: OgcRequest) -> list[datetime.datetime | None]:
518
475
  """Get available Sentinel-2 acquisitions at least time_difference apart
519
476
 
@@ -41,7 +41,6 @@ class ServiceType(Enum):
41
41
  WFS = "wfs"
42
42
  AWS = "aws"
43
43
  IMAGE = "image"
44
- FIS = "fis"
45
44
  PROCESSING_API = "processing"
46
45
 
47
46
 
@@ -1,143 +0,0 @@
1
- """
2
- Module for working with Sentinel Hub FIS service
3
- """
4
-
5
- from __future__ import annotations
6
-
7
- import datetime
8
- import warnings
9
- from enum import Enum
10
- from typing import Any
11
-
12
- from ..constants import MimeType, RequestType, ServiceType
13
- from ..download import DownloadRequest
14
- from ..exceptions import SHDeprecationWarning
15
- from ..geometry import BBox, Geometry
16
- from ..time_utils import RawTimeIntervalType, RawTimeType
17
- from .ogc import OgcImageService, OgcRequest
18
- from .wfs import WebFeatureService
19
-
20
-
21
- class HistogramType(Enum):
22
- """Enum class for types of histogram supported by Sentinel Hub FIS service
23
-
24
- Supported histogram types are EQUALFREQUENCY, EQUIDISTANT and STREAMING
25
- """
26
-
27
- EQUALFREQUENCY = "equalfrequency"
28
- EQUIDISTANT = "equidistant"
29
- STREAMING = "streaming"
30
-
31
-
32
- class FisRequest(OgcRequest):
33
- """``Deprecated - use Statistical API instead!``
34
-
35
- The class for interacting with Feature Info Service.
36
-
37
- For more info check `FIS documentation <https://www.sentinel-hub.com/develop/api/ogc/fis-request/>`__.
38
- """
39
-
40
- DEPRECATION_MESSAGE = (
41
- "Fis service is being deprecated in favour of SentinelHubStatistical. Although no immediate action is needed as"
42
- " FIS is still supported, consider switching to Statistical API because it provides additional functionalities."
43
- )
44
-
45
- def __init__(
46
- self,
47
- layer: str,
48
- time: RawTimeType | RawTimeIntervalType,
49
- geometry_list: list[Geometry | BBox],
50
- *,
51
- resolution: str = "10m",
52
- bins: str | None = None,
53
- histogram_type: HistogramType | None = None,
54
- **kwargs: Any,
55
- ):
56
- """
57
- :param layer: An ID of a layer configured in Sentinel Hub Dashboard. It has to be configured for the same
58
- instance ID which will be used for this request. The satellite collection of the layer in Dashboard
59
- must also match the one given by `data_collection` parameter.
60
- :param time: time or time range for which to return the results, in ISO8601 format
61
- (year-month-date, for example: ``2016-01-01``, or year-month-dateThours:minutes:seconds format,
62
- i.e. ``2016-01-01T16:31:21``). Examples: ``'2016-01-01'``, or ``('2016-01-01', ' 2016-01-31')``
63
- (datetime.datetime, datetime.datetime)
64
- :param geometry_list: A WKT representation of a geometry describing the region of interest.
65
- Note that WCS 1.1.1 standard is used here, so for EPSG:4326 coordinates should be in latitude/longitude
66
- order.
67
- :param resolution: Specifies the spatial resolution, in meters per pixel, of the image from which the statistics
68
- are to be estimated. When using CRS=EPSG:4326 one has to add the "m" suffix to
69
- enforce resolution in meters per pixel (e.g. RESOLUTION=10m).
70
- :param bins: The number of bins (a positive integer) in the histogram. If this parameter is absent no histogram
71
- is computed.
72
- :param histogram_type: type of histogram
73
- :param data_collection: A collection of requested satellite data. It has to be the same as defined in Sentinel
74
- Hub Dashboard for the given layer. Default is Sentinel-2 L1C.
75
- :param maxcc: maximum accepted cloud coverage of an image. Float between 0.0 and 1.0. Default is ``1.0``.
76
- :param custom_url_params: Dictionary of CustomUrlParameters and their values supported by Sentinel Hub's WMS
77
- and WCS services. All available parameters are described in
78
- `documentation <https://www.sentinel-hub.com/develop/api/ogc/custom-parameters/>`__. Note: in
79
- case of constants.CustomUrlParam.EVALSCRIPT the dictionary value must be a string
80
- of Javascript code that is not encoded into base64.
81
- :param data_folder: location of the directory where the fetched data will be saved.
82
- :param config: A custom instance of config class to override parameters from the saved configuration.
83
- """
84
- self.geometry_list = geometry_list
85
- self.resolution = resolution
86
- self.bins = bins
87
- self.histogram_type = HistogramType(histogram_type) if histogram_type else None
88
-
89
- super().__init__(
90
- bbox=None, layer=layer, time=time, service_type=ServiceType.FIS, **kwargs # type: ignore[arg-type]
91
- )
92
-
93
- def create_request(self) -> None: # type: ignore[override]
94
- """Set download requests
95
-
96
- Create a list of DownloadRequests for all Sentinel-2 acquisitions within request's time interval and
97
- acceptable cloud coverage.
98
- """
99
-
100
- warnings.warn(self.DEPRECATION_MESSAGE, category=SHDeprecationWarning, stacklevel=2)
101
- fis_service = _FisService(config=self.config)
102
- self.download_list = fis_service.get_request(self)
103
-
104
- def get_dates(self) -> list[datetime.datetime | None]:
105
- """This method is not supported for FIS request"""
106
- raise NotImplementedError
107
-
108
- def get_tiles(self) -> WebFeatureService | None:
109
- """This method is not supported for FIS request"""
110
- raise NotImplementedError
111
-
112
-
113
- class _FisService(OgcImageService):
114
- """Sentinel Hub OGC services class for providing FIS data
115
-
116
- Intermediate layer between FIS requests and the Sentinel Hub FIS services.
117
- """
118
-
119
- def get_request(self, request: FisRequest) -> list[DownloadRequest]: # type: ignore[override]
120
- """Get download requests
121
-
122
- Create a list of DownloadRequests for all Sentinel-2 acquisitions within request's time interval and
123
- acceptable cloud coverage.
124
-
125
- :param request: OGC-type request with specified bounding box, time interval, and cloud coverage for specific
126
- product.
127
- """
128
-
129
- return [self._create_request(request=request, geometry=geometry) for geometry in request.geometry_list]
130
-
131
- def _create_request(self, request: FisRequest, geometry: BBox | Geometry) -> DownloadRequest:
132
- url = self.get_base_url(request)
133
-
134
- post_data = {**self._get_common_url_parameters(request), **self._get_fis_parameters(request, geometry)}
135
- post_data = {k.lower(): v for k, v in post_data.items()} # lowercase required on SH service
136
-
137
- return DownloadRequest(
138
- url=f"{url}/{self.config.instance_id}",
139
- post_values=post_data,
140
- data_type=MimeType.JSON,
141
- headers={"Content-Type": MimeType.JSON.get_string()},
142
- request_type=RequestType.POST,
143
- )
File without changes
File without changes
File without changes