use WKB in QgsGeometry::vertexAt() only:

- includes multipolygons and inner rings again
- fixes #1300



git-svn-id: http://svn.osgeo.org/qgis/trunk@9321 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
jef 2008-09-13 19:28:35 +00:00
parent 5facf32f5c
commit 92c56d4ec4

View File

@ -2096,27 +2096,17 @@ QgsPoint QgsGeometry::vertexAt( int atVertex )
{ {
double x, y; double x, y;
if ( mGeos ) //try to find the vertex from the Geos geometry (it present) if ( mDirtyWkb )
{ {
try exportGeosToWkb();
{ }
const GEOSGeometry *g = GEOSGetExteriorRing( mGeos );
if ( !g )
return QgsPoint( 0, 0 );
const GEOSCoordSequence *cs = GEOSGeom_getCoordSeq( g ); if ( !mGeometry )
GEOSCoordSeq_getX( cs, atVertex, &x );
GEOSCoordSeq_getY( cs, atVertex, &y );
return QgsPoint( x, y );
}
catch ( GEOSException &e )
{ {
Q_UNUSED( e ); QgsDebugMsg( "WKB geometry not available!" );
return QgsPoint( 0, 0 ); return QgsPoint( 0, 0 );
} }
}
else if ( mGeometry )
{
QGis::WKBTYPE wkbType; QGis::WKBTYPE wkbType;
bool hasZValue = false; bool hasZValue = false;
unsigned char* ptr; unsigned char* ptr;
@ -2302,13 +2292,6 @@ QgsPoint QgsGeometry::vertexAt( int atVertex )
QgsDebugMsg( "error: mGeometry type not recognized" ); QgsDebugMsg( "error: mGeometry type not recognized" );
return QgsPoint( 0, 0 ); return QgsPoint( 0, 0 );
} }
}
else
{
QgsDebugMsg( "error: no mGeometry pointer" );
}
return QgsPoint( 0, 0 );
} }