Skip to content

Commit

Permalink
GRASS: points removed from topo in GRASS 7
Browse files Browse the repository at this point in the history
  • Loading branch information
blazek committed Nov 6, 2014
1 parent d8d9edb commit 7c52e7d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/providers/grass/qgsgrass.cpp
Expand Up @@ -919,7 +919,9 @@ QStringList GRASS_LIB_EXPORT QgsGrass::vectorLayers( QString gisdbase,
// add topology layers
if ( Vect_get_num_primitives( &map, GV_POINTS ) > 0 )
{
#if GRASS_VERSION_MAJOR < 7 /* no more point in GRASS 7 topo */
list.append( "topo_point" );
#endif
}
if ( Vect_get_num_primitives( &map, GV_LINES ) > 0 )
{
Expand Down
5 changes: 5 additions & 0 deletions src/providers/grass/qgsgrassfeatureiterator.cpp
Expand Up @@ -275,7 +275,12 @@ bool QgsGrassFeatureIterator::fetchFeature( QgsFeature& feature )
else
{
feature.setAttribute( 0, id );
#if GRASS_VERSION_MAJOR < 7
if ( mSource->mLayerType == QgsGrassProvider::TOPO_POINT || mSource->mLayerType == QgsGrassProvider::TOPO_LINE )
#else
/* No more topo points in GRASS 7 */
if ( mSource->mLayerType == QgsGrassProvider::TOPO_LINE )
#endif
{
feature.setAttribute( 1, QgsGrassProvider::primitiveTypeName( type ) );

Expand Down
6 changes: 6 additions & 0 deletions src/providers/grass/qgsgrassprovider.cpp
Expand Up @@ -1401,7 +1401,13 @@ bool QgsGrassProvider::lineNodes( int line, int *node1, int *node2 )
return false;
}

#if GRASS_VERSION_MAJOR < 7
Vect_get_line_nodes( mMap, line, node1, node2 );
#else
/* points don't have topology in GRASS >= 7 */
*node1 = 0;
*node2 = 0;
#endif
return true;
}

Expand Down

0 comments on commit 7c52e7d

Please sign in to comment.