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