Skip to content
Permalink
Browse files

[processing] Adjust code for line intersection with collection inters…

…ections
  • Loading branch information
gacarrillor committed Apr 24, 2018
1 parent 49ee8bb commit ac348686fece09f65d3ceb70dd9483cbe1cacf5b
Showing with 10 additions and 13 deletions.
  1. +10 −13 src/analysis/processing/qgsalgorithmlineintersection.cpp
@@ -196,10 +196,10 @@ QVariantMap QgsLineIntersectionAlgorithm::processAlgorithm( const QVariantMap &p
{
outAttributes.append( inFeatureB.attribute( b ) );
}
if ( intersectGeom.wkbType() == QgsWkbTypes::GeometryCollection )
if ( QgsWkbTypes::flatType( intersectGeom.wkbType() ) == QgsWkbTypes::GeometryCollection )
{
QVector<QgsGeometry> geomCollection = intersectGeom.asGeometryCollection();
for ( const QgsGeometry &part : qgis::as_const( geomCollection ) )
const QVector<QgsGeometry> geomCollection = intersectGeom.asGeometryCollection();
for ( const QgsGeometry &part : geomCollection )
{
if ( part.type() == QgsWkbTypes::PointGeometry )
{
@@ -214,18 +214,15 @@ QVariantMap QgsLineIntersectionAlgorithm::processAlgorithm( const QVariantMap &p
}
}
}
else
else if ( intersectGeom.type() == QgsWkbTypes::PointGeometry )
{
if ( intersectGeom.type() == QgsWkbTypes::PointGeometry )
if ( intersectGeom.isMultipart() )
{
if ( intersectGeom.isMultipart() )
{
points = intersectGeom.asMultiPoint();
}
else
{
points.append( intersectGeom.asPoint() );
}
points = intersectGeom.asMultiPoint();
}
else
{
points.append( intersectGeom.asPoint() );
}
}
for ( const QgsPointXY &j : qgis::as_const( points ) )

0 comments on commit ac34868

Please sign in to comment.
You can’t perform that action at this time.