The existing concave hull algorithm is quite restrictive as it
forces operation on an entire layer, which makes it useless eg
to create concave hulls from service area outputs.
Rename the existing one to "concave hull (by layer)", and make
sure all the documentation explains this so its more predictable
for users.
It doesn't make sense to force a single cost for all input points, so
make this parameter dynamic so that the cost can be eg taken from
an input layer field
Fixes#62004
Based on tickets/stackexchange posts/mailing list activity, this
seems to be a highly in demand tool which is fragile and error
prone when run via the SAGA Processing Plugin.
Port to a native tool to avoid this situation, and give a nice
optimised out-of-the-box tool.
Note that this is functionally a 1:1 clone of the SAGA tool. I've
verified that the outputs match SAGAs outputs, but any bugs
present in the SAGA implementation will also be present here.
Adds an API which an algorithm can implement to support auto-setting
parameter values. This is designed to handle the case
of eg an algorithm which does a file format translation, where
it's desirable to default the output parameter value to an input
parameter value with a different extension.
This can now be done by implementing autogenerateParameterValues
in the algorithm, eg:
def autogenerateParameterValues(self, existingParameters, changedParameter, mode):
if changedParameter == self.INPUT:
input_file = existingParameters.get(self.INPUT)
if input_file:
input_path = Path(input_file)
if input_path.exists():
# auto set output parameter to same as input but with 'qgs' extension
return {self.OUTPUT: input_path.with_suffix('.qgs').as_posix()}
return {}
Works for both toolbox and batch modes for algorithms