@@ -802,6 +802,9 @@ def capabilities(self) -> RESTCapabilities:
802802 load = lambda : RESTCapabilities (data = self .get ('/' , expected_status = 200 ).json (), url = self ._orig_url )
803803 )
804804
805+ def list_input_formats (self ) -> dict :
806+ return self .list_file_formats ().get ("input" , {})
807+
805808 def list_output_formats (self ) -> dict :
806809 return self .list_file_formats ().get ("output" , {})
807810
@@ -1319,7 +1322,6 @@ def load_geojson(
13191322 """
13201323 Converts GeoJSON data as defined by RFC 7946 into a vector data cube.
13211324
1322- :param connection: the connection to use to connect with the openEO back-end.
13231325 :param data: the geometry to load. One of:
13241326
13251327 - GeoJSON-style data structure: e.g. a dictionary with ``"type": "Polygon"`` and ``"coordinates"`` fields
@@ -1337,6 +1339,27 @@ def load_geojson(
13371339
13381340 return VectorCube .load_geojson (connection = self , data = data , properties = properties )
13391341
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+
13401363 def create_service (self , graph : dict , type : str , ** kwargs ) -> Service :
13411364 # TODO: type hint for graph: is it a nested or a flat one?
13421365 req = self ._build_request_with_process_graph (process_graph = graph , type = type , ** kwargs )
0 commit comments