Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Road graph: don't show 25D data as valid input layers
  • Loading branch information
m-kuhn committed Dec 9, 2013
1 parent 758f5e5 commit 93e0f3d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 2 additions & 4 deletions src/analysis/network/qgslinevectorlayerdirector.cpp
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/roadgraph/linevectorlayerwidget.cpp
Expand Up @@ -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() );
}
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/roadgraph/roadgraphplugin.cpp
Expand Up @@ -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 )
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/roadgraph/shortestpathwidget.cpp
Expand Up @@ -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()
);
Expand Down

0 comments on commit 93e0f3d

Please sign in to comment.