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
With this change, `projectedPoint` is reset to an empty QgsPointXY
before the search begins. This ensures that an empty point is returned
is the search fails.
This commit does not do any functional change. It moves the existing
`closestEdge()` method closer to `snapOnVertex` and
`snapOnFace`. Indeed, the following commits will introduce functional
changes to these functions by introducing `closestFace` and
`closestVertex`.
Don't add empty inSR/outSR arguments to the query, as these
cause errors with third-party servers which implement the
FeatureServer API (e.g. Earthsoft EQuIS)
Funded by North Road, thanks to SLYR