Skip to content
Permalink
Browse files
fix crs handling, remove ellipsoidal measuring, clarify helpstring
  • Loading branch information
root676 authored and nyalldawson committed Oct 24, 2021
1 parent 3a79ddf commit 5c4933d71fff380b91d9f0c0f018559a6a33be9e
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/analysis/processing/qgsalgorithmshortestline.cpp
@@ -61,7 +61,8 @@ QString QgsShortestLineAlgorithm::shortHelpString() const
"feature and the additional field of the distance.\n\n"
"This algorithm uses purely Cartesian calculations for distance, "
"and does not consider geodetic or ellipsoid properties when "
"determining feature proximity."
"determining feature proximity. The measurement and output coordinate "
"system is based on the coordinate system of the source layer."
);
}

@@ -112,7 +113,7 @@ QVariantMap QgsShortestLineAlgorithm::processAlgorithm( const QVariantMap &param
if ( !sink )
throw QgsProcessingException( invalidSinkError( parameters, QStringLiteral( "OUTPUT" ) ) );

const QgsFeatureIterator destinationIterator = mDestination->getFeatures( QgsFeatureRequest().setDestinationCrs( mDestination->sourceCrs(), context.transformContext() ) );
const QgsFeatureIterator destinationIterator = mDestination->getFeatures( QgsFeatureRequest().setDestinationCrs( mSource->sourceCrs(), context.transformContext() ) );
QHash< QgsFeatureId, QgsAttributes > destinationAttributeCache;
double step = mDestination->featureCount() > 0 ? 50.0 / mDestination->featureCount() : 1;
int i = 0;
@@ -134,7 +135,6 @@ QVariantMap QgsShortestLineAlgorithm::processAlgorithm( const QVariantMap &param

QgsDistanceArea da = QgsDistanceArea();
da.setSourceCrs( mSource->sourceCrs(), context.transformContext() );
da.setEllipsoid( context.ellipsoid() );

QgsFeature sourceFeature;
while ( sourceIterator.nextFeature( sourceFeature ) )

0 comments on commit 5c4933d

Please sign in to comment.