Skip to content

Commit 7c52e7d

Browse files
committedNov 6, 2014
GRASS: points removed from topo in GRASS 7
1 parent d8d9edb commit 7c52e7d

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed
 

‎src/providers/grass/qgsgrass.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,9 @@ QStringList GRASS_LIB_EXPORT QgsGrass::vectorLayers( QString gisdbase,
919919
// add topology layers
920920
if ( Vect_get_num_primitives( &map, GV_POINTS ) > 0 )
921921
{
922+
#if GRASS_VERSION_MAJOR < 7 /* no more point in GRASS 7 topo */
922923
list.append( "topo_point" );
924+
#endif
923925
}
924926
if ( Vect_get_num_primitives( &map, GV_LINES ) > 0 )
925927
{

‎src/providers/grass/qgsgrassfeatureiterator.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,12 @@ bool QgsGrassFeatureIterator::fetchFeature( QgsFeature& feature )
275275
else
276276
{
277277
feature.setAttribute( 0, id );
278+
#if GRASS_VERSION_MAJOR < 7
278279
if ( mSource->mLayerType == QgsGrassProvider::TOPO_POINT || mSource->mLayerType == QgsGrassProvider::TOPO_LINE )
280+
#else
281+
/* No more topo points in GRASS 7 */
282+
if ( mSource->mLayerType == QgsGrassProvider::TOPO_LINE )
283+
#endif
279284
{
280285
feature.setAttribute( 1, QgsGrassProvider::primitiveTypeName( type ) );
281286

‎src/providers/grass/qgsgrassprovider.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,7 +1401,13 @@ bool QgsGrassProvider::lineNodes( int line, int *node1, int *node2 )
14011401
return false;
14021402
}
14031403

1404+
#if GRASS_VERSION_MAJOR < 7
14041405
Vect_get_line_nodes( mMap, line, node1, node2 );
1406+
#else
1407+
/* points don't have topology in GRASS >= 7 */
1408+
*node1 = 0;
1409+
*node2 = 0;
1410+
#endif
14051411
return true;
14061412
}
14071413

0 commit comments

Comments
 (0)
Please sign in to comment.