@@ -1053,7 +1053,7 @@ def _merge_operator_binary_cubes(
10531053
10541054 def _get_geometry_argument (
10551055 self ,
1056- geometry : Union [
1056+ argument : Union [
10571057 shapely .geometry .base .BaseGeometry ,
10581058 dict ,
10591059 str ,
@@ -1070,14 +1070,14 @@ def _get_geometry_argument(
10701070 :param crs: value that encodes a coordinate reference system.
10711071 See :py:func:`openeo.util.normalize_crs` for more details about additional normalization that is applied to this argument.
10721072 """
1073- if isinstance (geometry , Parameter ):
1074- return geometry
1075- elif isinstance (geometry , _FromNodeMixin ):
1076- return geometry .from_node ()
1073+ if isinstance (argument , Parameter ):
1074+ return argument
1075+ elif isinstance (argument , _FromNodeMixin ):
1076+ return argument .from_node ()
10771077
1078- if isinstance (geometry , str ) and re .match (r"^https?://" , geometry , flags = re .I ):
1078+ if isinstance (argument , str ) and re .match (r"^https?://" , argument , flags = re .I ):
10791079 # Geometry provided as URL: load with `load_url` (with best-effort format guess)
1080- url = urllib .parse .urlparse (geometry )
1080+ url = urllib .parse .urlparse (argument )
10811081 suffix = pathlib .Path (url .path .lower ()).suffix
10821082 format = {
10831083 ".json" : "GeoJSON" ,
@@ -1086,18 +1086,20 @@ def _get_geometry_argument(
10861086 ".parquet" : "Parquet" ,
10871087 ".geoparquet" : "Parquet" ,
10881088 }.get (suffix , suffix .split ("." )[- 1 ])
1089- return self .connection .load_url (url = geometry , format = format )
1089+ return self .connection .load_url (url = argument , format = format )
10901090
1091- if isinstance (geometry , (str , pathlib .Path )):
1091+ if isinstance (argument , (str , pathlib .Path )):
10921092 # Assumption: `geometry` is path to polygon is a path to vector file at backend.
10931093 # TODO #104: `read_vector` is non-standard process.
10941094 # TODO: If path exists client side: load it client side?
1095- return PGNode (process_id = "read_vector" , arguments = {"filename" : str (geometry )})
1095+ return PGNode (process_id = "read_vector" , arguments = {"filename" : str (argument )})
10961096
1097- if isinstance (geometry , shapely .geometry .base .BaseGeometry ):
1098- geometry = mapping (geometry )
1099- if not isinstance (geometry , dict ):
1100- raise OpenEoClientException ("Invalid geometry argument: {g!r}" .format (g = geometry ))
1097+ if isinstance (argument , shapely .geometry .base .BaseGeometry ):
1098+ geometry = mapping (argument )
1099+ elif isinstance (argument , dict ):
1100+ geometry = argument
1101+ else :
1102+ raise OpenEoClientException ("Invalid geometry argument: {g!r}" .format (g = argument ))
11011103
11021104 if geometry .get ("type" ) not in valid_geojson_types :
11031105 raise OpenEoClientException ("Invalid geometry type {t!r}, must be one of {s}" .format (
0 commit comments