Skip to content
Permalink
Browse files
fix for #1169, added check for isle's area
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12678 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
rblazek committed Jan 6, 2010
1 parent efee46c commit 513436cd0ccb60b13d73eedeb812b278612ee8a5
@@ -892,10 +892,10 @@ int QgsGrassEdit::lineSymbFromMap( int line )

if ( !( mProvider->lineAreas( line, &left, &right ) ) ) return 0;

/* Count areas/isles on both sides */
/* Count areas on both sides */
nareas = 0;
if ( left != 0 ) nareas++;
if ( right != 0 ) nareas++;
if ( left > 0 || (left < 0 && mProvider->isleArea(-left) > 0 ) ) nareas++;
if ( right > 0 || (right < 0 && mProvider->isleArea(-right) > 0 ) ) nareas++;
if ( nareas == 0 ) return SYMB_BOUNDARY_0;
else if ( nareas == 1 ) return SYMB_BOUNDARY_1;
else return SYMB_BOUNDARY_2;
@@ -1749,6 +1749,18 @@ bool QgsGrassProvider::lineAreas( int line, int *left, int *right )
return true;
}

int QgsGrassProvider::isleArea( int isle )
{
QgsDebugMsgLevel( "entered.", 3 );

if ( !Vect_isle_alive( mMap, isle ) )
{
return 0;
}

return ( Vect_get_isle_area( mMap, isle ) );
}

int QgsGrassProvider::centroidArea( int centroid )
{
QgsDebugMsgLevel( "entered.", 3 );
@@ -280,6 +280,12 @@ class GRASS_EXPORT QgsGrassProvider : public QgsVectorDataProvider
*/
bool lineAreas( int line, int *left, int *right );

/** Get isle area
* @param isle number
* @return area number
*/
int isleArea( int isle );

/** Get centroid area
* @param centroid line number
* @return area number (negative for island)

0 comments on commit 513436c

Please sign in to comment.