mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-06 00:07:29 -04:00
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:
parent
5facf32f5c
commit
92c56d4ec4
@ -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;
|
||||
@ -2302,13 +2292,6 @@ QgsPoint QgsGeometry::vertexAt( int atVertex )
|
||||
QgsDebugMsg( "error: mGeometry type not recognized" );
|
||||
return QgsPoint( 0, 0 );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
QgsDebugMsg( "error: no mGeometry pointer" );
|
||||
}
|
||||
|
||||
return QgsPoint( 0, 0 );
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user