Skip to content
Permalink
Browse files
fix for #1169, added check for isle's area
git-svn-id: http://svn.osgeo.org/qgis/trunk@12678 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
rblazek committed Jan 6, 2010
1 parent 6eb6076 commit 74312693ec9f7d8af9ba4e7860226b4d8b5512d0
Showing with 21 additions and 3 deletions.
  1. +3 −3 src/plugins/grass/qgsgrassedit.cpp
  2. +12 −0 src/providers/grass/qgsgrassprovider.cpp
  3. +6 −0 src/providers/grass/qgsgrassprovider.h
@@ -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 7431269

Please sign in to comment.