Add interoplate to QgsGeometry

This commit is contained in:
Nathan Woodrow 2012-07-29 22:32:17 +10:00
parent 80c251d2a9
commit e8bbc2de71
3 changed files with 22 additions and 0 deletions

View File

@ -297,6 +297,8 @@ not disjoint with existing polygons of the feature*/
/** Returns the smallest convex polygon that contains all the points in the geometry. */
QgsGeometry* convexHull() /Factory/;
QgsGeometry* interoplate( double distance ) /Factory/;
/** Returns a geometry representing the points shared by this geometry and other. */
QgsGeometry* intersection(QgsGeometry* geometry) /Factory/;

View File

@ -6409,6 +6409,24 @@ QgsGeometry* QgsGeometry::convexHull()
CATCH_GEOS( 0 )
}
QgsGeometry* QgsGeometry::interpolate( double distance )
{
if ( !mGeos )
{
exportWkbToGeos();
}
if ( !mGeos )
{
return 0;
}
try
{
return fromGeosGeom( GEOSInterpolate( mGeos, distance ) );
}
CATCH_GEOS( 0 )
}
QgsGeometry* QgsGeometry::intersection( QgsGeometry* geometry )
{
if ( !geometry )

View File

@ -343,6 +343,8 @@ class CORE_EXPORT QgsGeometry
/** Returns the smallest convex polygon that contains all the points in the geometry. */
QgsGeometry* convexHull();
QgsGeometry* interpolate( double distance );
/** Returns a geometry representing the points shared by this geometry and other. */
QgsGeometry* intersection( QgsGeometry* geometry );