Skip to content

Commit

Permalink
use QgsWKBTypes to check layer wkb type (follow up 904dc21)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed Jun 23, 2016
1 parent afa0335 commit e6970ba
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/analysis/network/qgslinevectorlayerdirector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <qgspoint.h>
#include <qgsgeometry.h>
#include <qgsdistancearea.h>
#include <qgswkbtypes.h>

// QT includes
#include <QString>
Expand Down Expand Up @@ -162,9 +163,9 @@ void QgsLineVectorLayerDirector::makeGraph( QgsGraphBuilderInterface *builder, c
while ( fit.nextFeature( feature ) )
{
QgsMultiPolyline mpl;
if ( feature.constGeometry()->wkbType() == QGis::WKBMultiLineString || feature.constGeometry()->wkbType() == QGis::WKBMultiLineString25D )
if ( QgsWKBTypes::flatType( feature.constGeometry()->geometry()->wkbType() ) == QgsWKBTypes::MultiLineString )
mpl = feature.constGeometry()->asMultiPolyline();
else if ( feature.constGeometry()->wkbType() == QGis::WKBLineString || feature.constGeometry()->wkbType() == QGis::WKBLineString25D )
else if ( QgsWKBTypes::flatType( feature.constGeometry()->geometry()->wkbType() ) == QgsWKBTypes::LineString )
mpl.push_back( feature.constGeometry()->asPolyline() );

QgsMultiPolyline::iterator mplIt;
Expand Down Expand Up @@ -296,9 +297,9 @@ void QgsLineVectorLayerDirector::makeGraph( QgsGraphBuilderInterface *builder, c

// begin features segments and add arc to the Graph;
QgsMultiPolyline mpl;
if ( feature.constGeometry()->wkbType() == QGis::WKBMultiLineString )
if ( QgsWKBTypes::flatType( feature.constGeometry()->geometry()->wkbType() ) == QgsWKBTypes::MultiLineString )
mpl = feature.constGeometry()->asMultiPolyline();
else if ( feature.constGeometry()->wkbType() == QGis::WKBLineString )
else if ( QgsWKBTypes::flatType( feature.constGeometry()->geometry()->wkbType() ) == QgsWKBTypes::LineString )
mpl.push_back( feature.constGeometry()->asPolyline() );

QgsMultiPolyline::iterator mplIt;
Expand Down

0 comments on commit e6970ba

Please sign in to comment.