@@ -821,15 +821,18 @@ def _check_geometry_path_assumption(path: str, process: str, parameter: str):
821
821
.returns (description = "Output geometry (GeoJSON object) with the added or subtracted buffer" ,
822
822
schema = {"type" : "object" , "subtype" : "geojson" })
823
823
)
824
- def vector_buffer (args : Dict , env : EvalEnv ) -> dict :
825
- if ("geometry" in args ):
826
- #old style, not official
827
- geometry = extract_arg (args , 'geometry' )
824
+ def vector_buffer (args : ProcessArgs , env : EvalEnv ) -> dict :
825
+ if "geometry" in args and "geometries" not in args :
826
+ # TODO drop legacy support for non-standard arg
827
+ _log .warning ("DEPRECATED: vector_buffer expects `geometries` argument, not `geometry`" )
828
+ geometry = args .get_required ("geometry" )
828
829
else :
829
- geometry = extract_arg (args , 'geometries' )
830
- distance = extract_arg (args , 'distance' )
831
- #unit argument is not official spec
832
- unit = args .get ("unit" ,"meter" )
830
+ geometry = args .get_required ("geometries" )
831
+ distance = args .get_required ("distance" , expected_type = (int , float ))
832
+ if "unit" in args :
833
+ # TODO resolve/eliminate non-official unit argument
834
+ _log .warning ("vector_buffer: usage of non-standard 'unit' parameter" )
835
+ unit = args .get_optional ("unit" , default = "meter" )
833
836
input_crs = output_crs = 'epsg:4326'
834
837
buffer_resolution = 3
835
838
0 commit comments