Skip to content
Permalink
Browse files

don't measure empty geometries and also return success when exports g…

…eos points to wkb

git-svn-id: http://svn.osgeo.org/qgis/trunk@12617 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Dec 24, 2009
1 parent 8cc3c65 commit 9acd8b58fb5f72e9008dda9f4ec0378f217d4166
Showing with 7 additions and 3 deletions.
  1. +3 −0 src/core/qgsdistancearea.cpp
  2. +4 −3 src/core/qgsgeometry.cpp
@@ -175,6 +175,9 @@ bool QgsDistanceArea::setEllipsoid( const QString& ellipsoid )

double QgsDistanceArea::measure( QgsGeometry* geometry )
{
if ( !geometry )
return 0.0;

unsigned char* wkb = geometry->asWkb();
unsigned char* ptr;
unsigned int wkbType;
@@ -1198,8 +1198,8 @@ bool QgsGeometry::insertVertex( double x, double y,
// Bounds checking
if ( beforeVertex < 0 )
{
( *new_sequence ) = 0;
return FALSE;
*new_sequence = 0;
return false;
}

unsigned int numPoints;
@@ -4335,7 +4335,8 @@ bool QgsGeometry::exportGeosToWkb()
memcpy( mGeometry + 5, &x, sizeof( double ) );
memcpy( mGeometry + 13, &y, sizeof( double ) );

break;
mDirtyWkb = false;
return true;
} // case GEOS_GEOM::GEOS_POINT

case GEOS_LINESTRING: // a linestring

0 comments on commit 9acd8b5

Please sign in to comment.
You can’t perform that action at this time.