Skip to content

Commit

Permalink
Add interoplate to QgsGeometry
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanW2 committed Jul 29, 2012
1 parent 80c251d commit e8bbc2d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions python/core/qgsgeometry.sip
Expand Up @@ -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/;
Expand Down
18 changes: 18 additions & 0 deletions src/core/qgsgeometry.cpp
Expand Up @@ -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 )
Expand Down
2 changes: 2 additions & 0 deletions src/core/qgsgeometry.h
Expand Up @@ -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 );

Expand Down

0 comments on commit e8bbc2d

Please sign in to comment.