Skip to content
Permalink
Browse files

Road graph: don't show 25D data as valid input layers

  • Loading branch information
m-kuhn committed Dec 9, 2013
1 parent 758f5e5 commit 93e0f3d88f0be6f59b0ccab7689d69b33d4a444b
@@ -166,11 +166,9 @@ void QgsLineVectorLayerDirector::makeGraph( QgsGraphBuilderInterface *builder, c
while ( fit.nextFeature( feature ) )
{
QgsMultiPolyline mpl;
if ( feature.geometry()->wkbType() == QGis::WKBMultiLineString
|| feature.geometry()->wkbType() == QGis::WKBMultiLineString25D )
if ( feature.geometry()->wkbType() == QGis::WKBMultiLineString )
mpl = feature.geometry()->asMultiPolyline();
else if ( feature.geometry()->wkbType() == QGis::WKBLineString
|| feature.geometry()->wkbType() == QGis::WKBLineString25D )
else if ( feature.geometry()->wkbType() == QGis::WKBLineString )
mpl.push_back( feature.geometry()->asPolyline() );

QgsMultiPolyline::iterator mplIt;
@@ -132,7 +132,8 @@ RgLineVectorLayerSettingsWidget::RgLineVectorLayerSettingsWidget( RgLineVectorLa
QgsVectorLayer* vl = dynamic_cast<QgsVectorLayer*>( layer_it.value() );
if ( !vl )
continue;
if ( vl->geometryType() != QGis::Line )
if ( vl->wkbType() != QGis::WKBLineString
|| vl->wkbType() != QGis::WKBMultiLineString )
continue;
mcbLayers->insertItem( 0, vl->name() );
}
@@ -211,7 +211,8 @@ const QgsGraphDirector* RoadGraphPlugin::director() const
}
if ( layer == NULL )
return NULL;
if ( layer->geometryType() == QGis::Line )
if ( layer->wkbType() == QGis::WKBLineString
|| layer->wkbType() == QGis::WKBMultiLineString)
{
QgsVectorDataProvider *provider = dynamic_cast< QgsVectorDataProvider* >( layer->dataProvider() );
if ( provider == NULL )
@@ -289,7 +289,7 @@ QgsGraph* RgShortestPathWidget::getPath( QgsPoint& p1, QgsPoint& p2 )
{
mPlugin->iface()->messageBar()->pushMessage(
tr( "Cannot calculate path" ),
tr( "The graph is empty. Does the layer have a supported geometry type?" ),
tr( "The created graph is empty. Please check your input data." ),
QgsMessageBar::WARNING,
mPlugin->iface()->messageTimeout()
);

0 comments on commit 93e0f3d

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