@@ -802,6 +802,9 @@ def capabilities(self) -> RESTCapabilities:
802
802
load = lambda : RESTCapabilities (data = self .get ('/' , expected_status = 200 ).json (), url = self ._orig_url )
803
803
)
804
804
805
+ def list_input_formats (self ) -> dict :
806
+ return self .list_file_formats ().get ("input" , {})
807
+
805
808
def list_output_formats (self ) -> dict :
806
809
return self .list_file_formats ().get ("output" , {})
807
810
@@ -1319,7 +1322,6 @@ def load_geojson(
1319
1322
"""
1320
1323
Converts GeoJSON data as defined by RFC 7946 into a vector data cube.
1321
1324
1322
- :param connection: the connection to use to connect with the openEO back-end.
1323
1325
:param data: the geometry to load. One of:
1324
1326
1325
1327
- GeoJSON-style data structure: e.g. a dictionary with ``"type": "Polygon"`` and ``"coordinates"`` fields
@@ -1337,6 +1339,27 @@ def load_geojson(
1337
1339
1338
1340
return VectorCube .load_geojson (connection = self , data = data , properties = properties )
1339
1341
1342
+ @openeo_process
1343
+ def load_url (self , url : str , format : str , options : Optional [dict ] = None ):
1344
+ """
1345
+ Loads a file from a URL
1346
+
1347
+ :param url: The URL to read from. Authentication details such as API keys or tokens may need to be included in the URL.
1348
+ :param format: The file format to use when loading the data.
1349
+ :param options: The file format parameters to use when reading the data.
1350
+ Must correspond to the parameters that the server reports as supported parameters for the chosen ``format``
1351
+ :return: new VectorCube instance
1352
+
1353
+ .. warning:: EXPERIMENTAL: this process is experimental with the potential for major things to change.
1354
+
1355
+ .. versionadded:: 0.22.0
1356
+ """
1357
+ if format not in self .list_input_formats ():
1358
+ # TODO: make this an error?
1359
+ _log .warning (f"Format { format !r} not listed in back-end input formats" )
1360
+ # TODO: Inspect format's gis_data_type to see if we need to load a VectorCube or classic raster DataCube
1361
+ return VectorCube .load_url (connection = self , url = url , format = format , options = options )
1362
+
1340
1363
def create_service (self , graph : dict , type : str , ** kwargs ) -> Service :
1341
1364
# TODO: type hint for graph: is it a nested or a flat one?
1342
1365
req = self ._build_request_with_process_graph (process_graph = graph , type = type , ** kwargs )
0 commit comments