mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-03 00:02:25 -05:00
address review comments
This commit is contained in:
parent
9a53837946
commit
744d2d6b6d
@ -86,12 +86,12 @@ QVariantMap QgsServiceAreaFromLayerAlgorithm::processAlgorithm( const QVariantMa
|
||||
if ( !startPoints )
|
||||
throw QgsProcessingException( invalidSourceError( parameters, QStringLiteral( "START_POINTS" ) ) );
|
||||
|
||||
double travelCost = parameterAsDouble( parameters, QStringLiteral( "TRAVEL_COST" ), context );
|
||||
if ( !travelCost )
|
||||
travelCost = parameterAsDouble( parameters, QStringLiteral( "TRAVEL_COST2" ), context );
|
||||
// use older deprecated travel cost style if specified, to maintain old api
|
||||
const bool useOldTravelCost = parameters.value( QStringLiteral( "TRAVEL_COST" ) ).isValid();
|
||||
double travelCost = parameterAsDouble( parameters, useOldTravelCost ? QStringLiteral( "TRAVEL_COST" ) : QStringLiteral( "TRAVEL_COST2" ), context );
|
||||
|
||||
int strategy = parameterAsInt( parameters, QStringLiteral( "STRATEGY" ), context );
|
||||
if ( strategy )
|
||||
if ( strategy && !useOldTravelCost )
|
||||
travelCost *= mMultiplier;
|
||||
|
||||
bool includeBounds = true; // default to true to maintain 3.0 API
|
||||
|
@ -83,12 +83,13 @@ QVariantMap QgsServiceAreaFromPointAlgorithm::processAlgorithm( const QVariantMa
|
||||
loadCommonParams( parameters, context, feedback );
|
||||
|
||||
QgsPointXY startPoint = parameterAsPoint( parameters, QStringLiteral( "START_POINT" ), context, mNetwork->sourceCrs() );
|
||||
double travelCost = parameterAsDouble( parameters, QStringLiteral( "TRAVEL_COST" ), context );
|
||||
if ( !travelCost )
|
||||
travelCost = parameterAsDouble( parameters, QStringLiteral( "TRAVEL_COST2" ), context );
|
||||
|
||||
// use older deprecated travel cost style if specified, to maintain old api
|
||||
const bool useOldTravelCost = parameters.value( QStringLiteral( "TRAVEL_COST" ) ).isValid();
|
||||
double travelCost = parameterAsDouble( parameters, useOldTravelCost ? QStringLiteral( "TRAVEL_COST" ) : QStringLiteral( "TRAVEL_COST2" ), context );
|
||||
|
||||
int strategy = parameterAsInt( parameters, QStringLiteral( "STRATEGY" ), context );
|
||||
if ( strategy )
|
||||
if ( strategy && !useOldTravelCost )
|
||||
travelCost *= mMultiplier;
|
||||
|
||||
bool includeBounds = true; // default to true to maintain 3.0 API
|
||||
|
Loading…
x
Reference in New Issue
Block a user