Skip to content
Permalink
Browse files

Add a const geometry getter to QgsFeature

  • Loading branch information
nyalldawson committed May 11, 2015
1 parent e509fc5 commit 2863f20d67c16d0c3a4b2deadd8b49a385e5d2b8
Showing with 368 additions and 351 deletions.
  1. +2 −2 python/analysis/vector/qgsgeometryanalyzer.sip
  2. +2 −2 python/core/qgsdistancearea.sip
  3. +6 −1 python/core/qgsfeature.sip
  4. +1 −1 python/core/qgsgeometry.sip
  5. +2 −2 python/core/qgsogcutils.sip
  6. +2 −2 python/core/qgspallabeling.sip
  7. +1 −1 python/core/qgsvectorlayer.sip
  8. +1 −1 python/core/qgsvectorlayereditutils.sip
  9. +1 −1 python/gui/qgshighlight.sip
  10. +2 −2 python/gui/qgsrubberband.sip
  11. +2 −2 src/analysis/interpolation/qgsinterpolator.cpp
  12. +1 −1 src/analysis/interpolation/qgsinterpolator.h
  13. +1 −1 src/analysis/interpolation/qgstininterpolator.cpp
  14. +8 −8 src/analysis/network/qgslinevectorlayerdirector.cpp
  15. +29 −28 src/analysis/vector/qgsgeometryanalyzer.cpp
  16. +2 −2 src/analysis/vector/qgsgeometryanalyzer.h
  17. +7 −7 src/analysis/vector/qgsoverlayanalyzer.cpp
  18. +2 −4 src/analysis/vector/qgspointsample.cpp
  19. +3 −4 src/analysis/vector/qgstransectsample.cpp
  20. +1 −1 src/analysis/vector/qgstransectsample.h
  21. +4 −4 src/analysis/vector/qgszonalstatistics.cpp
  22. +2 −2 src/analysis/vector/qgszonalstatistics.h
  23. +1 −1 src/app/nodetool/qgsmaptoolnodetool.cpp
  24. +1 −1 src/app/nodetool/qgsselectedfeature.cpp
  25. +6 −6 src/app/qgisapp.cpp
  26. +3 −3 src/app/qgsclipboard.cpp
  27. +4 −4 src/app/qgsidentifyresultsdialog.cpp
  28. +3 −3 src/app/qgsmaptooladdfeature.cpp
  29. +2 −2 src/app/qgsmaptooldeletepart.cpp
  30. +8 −7 src/app/qgsmaptooldeletering.cpp
  31. +2 −2 src/app/qgsmaptooldeletering.h
  32. +1 −1 src/app/qgsmaptoollabel.cpp
  33. +4 −4 src/app/qgsmaptoolmovefeature.cpp
  34. +3 −3 src/app/qgsmaptooloffsetcurve.cpp
  35. +1 −1 src/app/qgsmaptooloffsetcurve.h
  36. +6 −6 src/app/qgsmaptoolrotatefeature.cpp
  37. +1 −1 src/app/qgsmaptoolselectutils.cpp
  38. +5 −5 src/app/qgsmaptoolsimplify.cpp
  39. +1 −1 src/app/qgsmaptoolsimplify.h
  40. +1 −1 src/app/qgsmergeattributesdialog.cpp
  41. +3 −3 src/core/composer/qgsatlascomposition.cpp
  42. +3 −3 src/core/composer/qgscomposerattributetablev2.cpp
  43. +23 −14 src/core/dxf/qgsdxfexport.cpp
  44. +2 −2 src/core/qgsdistancearea.cpp
  45. +2 −2 src/core/qgsdistancearea.h
  46. +6 −6 src/core/qgsexpression.cpp
  47. +5 −0 src/core/qgsfeature.cpp
  48. +6 −1 src/core/qgsfeature.h
  49. +1 −1 src/core/qgsfeatureiterator.cpp
  50. +1 −1 src/core/qgsfeaturerequest.cpp
  51. +3 −3 src/core/qgsgeometry.cpp
  52. +1 −1 src/core/qgsgeometry.h
  53. +2 −2 src/core/qgsgml.cpp
  54. +1 −1 src/core/qgslabel.cpp
  55. +2 −2 src/core/qgsogcutils.cpp
  56. +2 −2 src/core/qgsogcutils.h
  57. +4 −4 src/core/qgspallabeling.cpp
  58. +2 −2 src/core/qgspallabeling.h
  59. +6 −6 src/core/qgspointlocator.cpp
  60. +4 −3 src/core/qgsspatialindex.cpp
  61. +2 −2 src/core/qgsvectorfilewriter.cpp
  62. +14 −14 src/core/qgsvectorlayer.cpp
  63. +2 −2 src/core/qgsvectorlayer.h
  64. +12 −12 src/core/qgsvectorlayereditutils.cpp
  65. +1 −1 src/core/qgsvectorlayereditutils.h
  66. +2 −2 src/core/qgsvectorlayerfeatureiterator.cpp
  67. +2 −2 src/core/qgsvectorlayerimport.cpp
  68. +4 −4 src/core/qgsvectorlayerrenderer.cpp
  69. +5 −5 src/core/qgsvectorlayerundocommand.cpp
  70. +9 −17 src/core/symbology-ng/qgsheatmaprenderer.cpp
  71. +1 −1 src/core/symbology-ng/qgsheatmaprenderer.h
  72. +3 −3 src/core/symbology-ng/qgsinvertedpolygonrenderer.cpp
  73. +2 −2 src/core/symbology-ng/qgslinesymbollayerv2.cpp
  74. +2 −2 src/core/symbology-ng/qgsmarkersymbollayerv2.cpp
  75. +4 −4 src/core/symbology-ng/qgspointdisplacementrenderer.cpp
  76. +1 −1 src/core/symbology-ng/qgsrendererv2.cpp
  77. +3 −2 src/gui/editorwidgets/qgsrelationreferencewidget.cpp
  78. +5 −5 src/gui/qgshighlight.cpp
  79. +2 −2 src/gui/qgshighlight.h
  80. +1 −1 src/gui/qgsidentifymenu.cpp
  81. +9 −9 src/gui/qgsmaptoolidentify.cpp
  82. +2 −2 src/gui/qgsrubberband.cpp
  83. +2 −2 src/gui/qgsrubberband.h
  84. +2 −2 src/plugins/evis/eventbrowser/evisgenericeventbrowsergui.cpp
  85. +1 −1 src/plugins/heatmap/heatmap.cpp
  86. +2 −2 src/plugins/spatialquery/qgsrubberselectid.cpp
  87. +5 −5 src/plugins/spatialquery/qgsspatialquery.cpp
  88. +4 −4 src/plugins/spatialquery/qgsspatialquerydialog.cpp
  89. +3 −3 src/plugins/topology/checkDock.cpp
  90. +4 −4 src/plugins/topology/topolError.cpp
  91. +11 −11 src/plugins/topology/topolTest.cpp
  92. +2 −2 src/providers/delimitedtext/qgsdelimitedtextprovider.cpp
  93. +2 −2 src/providers/gpx/qgsgpxprovider.cpp
  94. +2 −2 src/providers/memory/qgsmemoryfeatureiterator.cpp
  95. +2 −2 src/providers/memory/qgsmemoryprovider.cpp
  96. +1 −1 src/providers/mssql/qgsmssqlprovider.cpp
  97. +2 −2 src/providers/ogr/qgsogrfeatureiterator.cpp
  98. +3 −3 src/providers/ogr/qgsogrprovider.cpp
  99. +2 −2 src/providers/postgres/qgspostgresprovider.cpp
  100. +1 −1 src/providers/postgres/qgspostgresprovider.h
  101. +3 −3 src/providers/spatialite/qgsspatialiteprovider.cpp
  102. +2 −2 src/providers/wfs/qgswfsfeatureiterator.cpp
  103. +2 −2 src/providers/wfs/qgswfsprovider.cpp
  104. +2 −2 src/providers/wms/qgswmsprovider.cpp
  105. +1 −1 tests/src/core/testqgspointlocator.cpp
  106. +5 −5 tests/src/core/testqgsvectordataprovider.cpp
@@ -95,9 +95,9 @@ class QgsGeometryAnalyzer
bool forceSingleGeometry = false, QgsVectorDataProvider* memoryProvider = 0, QProgressDialog* p = 0 );

/**Returns linear reference geometry as a multiline (or 0 if no match). Currently, the z-coordinates are considered to be the measures (no support for m-values in QGIS)*/
QgsGeometry* locateBetweenMeasures( double fromMeasure, double toMeasure, QgsGeometry* lineGeom );
QgsGeometry* locateBetweenMeasures( double fromMeasure, double toMeasure, const QgsGeometry* lineGeom );
/**Returns linear reference geometry. Unlike the PostGIS function, this method always returns multipoint or 0 if no match (not geometry collection).
Currently, the z-coordinates are considered to be the measures (no support for m-values in QGIS)*/
QgsGeometry* locateAlongMeasure( double measure, QgsGeometry* lineGeom );
QgsGeometry* locateAlongMeasure( double measure, const QgsGeometry* lineGeom );

};
@@ -56,10 +56,10 @@ class QgsDistanceArea
double ellipsoidInverseFlattening() const;

//! general measurement (line distance or polygon area)
double measure( QgsGeometry* geometry );
double measure( const QgsGeometry* geometry );

//! measures perimeter of polygon
double measurePerimeter( QgsGeometry* geometry );
double measurePerimeter( const QgsGeometry* geometry );

//! measures line
double measureLine( const QList<QgsPoint>& points );
@@ -313,7 +313,12 @@ class QgsFeature
/**
* Get the geometry object associated with this feature
*/
QgsGeometry *geometry() const;
QgsGeometry* geometry() const;

/** Gets a const pointer to the geometry object associated with this feature
* @note added in QGIS 2.9
*/
const QgsGeometry* constGeometry() const;

/**
* Get the geometry object associated with this feature
@@ -282,7 +282,7 @@ class QgsGeometry
/**Changes this geometry such that it does not intersect the other geometry
@param other geometry that should not be intersect
@return 0 in case of success*/
int makeDifference( QgsGeometry* other );
int makeDifference( const QgsGeometry* other );

/**Returns the bounding box of this feature*/
QgsRectangle boundingBox() const;
@@ -28,12 +28,12 @@ class QgsOgcUtils
/** Exports the geometry to GML2 or GML3
@return QDomElement
*/
static QDomElement geometryToGML( QgsGeometry* geometry, QDomDocument& doc, QString format, const int &precision = 17 );
static QDomElement geometryToGML( const QgsGeometry* geometry, QDomDocument& doc, QString format, const int &precision = 17 );

/** Exports the geometry to GML2
@return QDomElement
*/
static QDomElement geometryToGML( QgsGeometry* geometry, QDomDocument& doc, const int &precision = 17 );
static QDomElement geometryToGML( const QgsGeometry* geometry, QDomDocument& doc, const int &precision = 17 );

/** Exports the rectangle to GML2 Box
@return QDomElement
@@ -752,7 +752,7 @@ class QgsPalLabeling : QgsLabelingEngineInterface
* @returns prepared geometry
* @note added in QGIS 2.9
*/
static QgsGeometry* prepareGeometry( QgsGeometry *geometry, const QgsRenderContext &context, const QgsCoordinateTransform *ct, double minSize = 0, QgsGeometry *clipGeometry = 0 ) /Factory/;
static QgsGeometry* prepareGeometry( const QgsGeometry *geometry, const QgsRenderContext &context, const QgsCoordinateTransform *ct, double minSize = 0, QgsGeometry *clipGeometry = 0 ) /Factory/;

/** Checks whether a geometry requires preparation before registration with PAL
* @param geometry geometry to prepare
@@ -762,7 +762,7 @@ class QgsPalLabeling : QgsLabelingEngineInterface
* @returns true if geometry requires preparation
* @note added in QGIS 2.9
*/
static bool geometryRequiresPreparation( QgsGeometry *geometry, const QgsRenderContext &context, const QgsCoordinateTransform *ct, QgsGeometry *clipGeometry = 0 );
static bool geometryRequiresPreparation( const QgsGeometry *geometry, const QgsRenderContext &context, const QgsCoordinateTransform *ct, QgsGeometry *clipGeometry = 0 );


protected:
@@ -694,7 +694,7 @@ class QgsVectorLayer : QgsMapLayer
* @note geom is not going to be modified by the function
* @return 0 in case of success
*/
int addTopologicalPoints( QgsGeometry* geom );
int addTopologicalPoints( const QgsGeometry* geom );

/** Adds a vertex to segments which intersect point p but don't
* already have a vertex there. If a feature already has a vertex at position p,
@@ -76,7 +76,7 @@ class QgsVectorLayerEditUtils
* @note geom is not going to be modified by the function
* @return 0 in case of success
*/
int addTopologicalPoints( QgsGeometry* geom );
int addTopologicalPoints( const QgsGeometry* geom );

/** Adds a vertex to segments which intersect point p but don't
* already have a vertex there. If a feature already has a vertex at position p,
@@ -4,7 +4,7 @@ class QgsHighlight : QgsMapCanvasItem
#include <qgshighlight.h>
%End
public:
QgsHighlight( QgsMapCanvas *mapCanvas, QgsGeometry *geom, QgsVectorLayer *layer );
QgsHighlight( QgsMapCanvas *mapCanvas, const QgsGeometry *geom, QgsVectorLayer *layer );
~QgsHighlight();

/** Set line/outline to color, polygon fill to color with alpha = 63.
@@ -161,7 +161,7 @@ class QgsRubberBand: QgsMapCanvasItem
* @param layer the layer containing the feature, used for coord transformation to map
* crs. In case of 0 pointer, the coordinates are not going to be transformed.
*/
void setToGeometry( QgsGeometry* geom, QgsVectorLayer* layer );
void setToGeometry( const QgsGeometry* geom, QgsVectorLayer* layer );

/**
* Sets this rubber band to a map canvas rectangle
@@ -180,7 +180,7 @@ class QgsRubberBand: QgsMapCanvasItem
* @param layer the layer containing the feature, used for coord transformation to map
* crs. In case of 0 pointer, the coordinates are not going to be transformed.
*/
void addGeometry( QgsGeometry* geom, QgsVectorLayer* layer );
void addGeometry( const QgsGeometry* geom, QgsVectorLayer* layer );

/**
* Adds translation to original coordinates (all in map coordinates)
@@ -93,7 +93,7 @@ int QgsInterpolator::cacheBaseData()
}
}

if ( addVerticesToCache( theFeature.geometry(), v_it->zCoordInterpolation, attributeValue ) != 0 )
if ( addVerticesToCache( theFeature.constGeometry(), v_it->zCoordInterpolation, attributeValue ) != 0 )
{
return 3;
}
@@ -103,7 +103,7 @@ int QgsInterpolator::cacheBaseData()
return 0;
}

int QgsInterpolator::addVerticesToCache( QgsGeometry* geom, bool zCoord, double attributeValue )
int QgsInterpolator::addVerticesToCache( const QgsGeometry *geom, bool zCoord, double attributeValue )
{
if ( !geom )
return 1;
@@ -88,7 +88,7 @@ class ANALYSIS_EXPORT QgsInterpolator
@param zCoord true if the z-coordinate of the geometry is to be interpolated
@param attributeValue the attribute value for interpolation (if not interpolated from z-coordinate)
@return 0 in case of success*/
int addVerticesToCache( QgsGeometry* geom, bool zCoord, double attributeValue );
int addVerticesToCache( const QgsGeometry* geom, bool zCoord, double attributeValue );
};

#endif
@@ -172,7 +172,7 @@ int QgsTINInterpolator::insertData( QgsFeature* f, bool zCoord, int attr, InputT
return 1;
}

QgsGeometry* g = f->geometry();
const QgsGeometry* g = f->constGeometry();
{
if ( !g )
{
@@ -166,10 +166,10 @@ void QgsLineVectorLayerDirector::makeGraph( QgsGraphBuilderInterface *builder, c
while ( fit.nextFeature( feature ) )
{
QgsMultiPolyline mpl;
if ( feature.geometry()->wkbType() == QGis::WKBMultiLineString )
mpl = feature.geometry()->asMultiPolyline();
else if ( feature.geometry()->wkbType() == QGis::WKBLineString )
mpl.push_back( feature.geometry()->asPolyline() );
if ( feature.constGeometry()->wkbType() == QGis::WKBMultiLineString )
mpl = feature.constGeometry()->asMultiPolyline();
else if ( feature.constGeometry()->wkbType() == QGis::WKBLineString )
mpl.push_back( feature.constGeometry()->asPolyline() );

QgsMultiPolyline::iterator mplIt;
for ( mplIt = mpl.begin(); mplIt != mpl.end(); ++mplIt )
@@ -300,10 +300,10 @@ void QgsLineVectorLayerDirector::makeGraph( QgsGraphBuilderInterface *builder, c

// begin features segments and add arc to the Graph;
QgsMultiPolyline mpl;
if ( feature.geometry()->wkbType() == QGis::WKBMultiLineString )
mpl = feature.geometry()->asMultiPolyline();
else if ( feature.geometry()->wkbType() == QGis::WKBLineString )
mpl.push_back( feature.geometry()->asPolyline() );
if ( feature.constGeometry()->wkbType() == QGis::WKBMultiLineString )
mpl = feature.constGeometry()->asMultiPolyline();
else if ( feature.constGeometry()->wkbType() == QGis::WKBLineString )
mpl.push_back( feature.constGeometry()->asPolyline() );

QgsMultiPolyline::iterator mplIt;
for ( mplIt = mpl.begin(); mplIt != mpl.end(); ++mplIt )
@@ -122,13 +122,14 @@ bool QgsGeometryAnalyzer::simplify( QgsVectorLayer* layer,

void QgsGeometryAnalyzer::simplifyFeature( QgsFeature& f, QgsVectorFileWriter* vfw, double tolerance )
{
QgsGeometry* featureGeometry = f.geometry();
QgsGeometry* tmpGeometry = 0;

if ( !featureGeometry )
if ( !f.constGeometry() )
{
return;
}

const QgsGeometry* featureGeometry = f.constGeometry();
QgsGeometry* tmpGeometry = 0;

// simplify feature
tmpGeometry = featureGeometry->simplify( tolerance );

@@ -238,14 +239,14 @@ bool QgsGeometryAnalyzer::centroids( QgsVectorLayer* layer, const QString& shape

void QgsGeometryAnalyzer::centroidFeature( QgsFeature& f, QgsVectorFileWriter* vfw )
{
QgsGeometry* featureGeometry = f.geometry();
QgsGeometry* tmpGeometry = 0;

if ( !featureGeometry )
if ( !f.constGeometry() )
{
return;
}

const QgsGeometry* featureGeometry = f.constGeometry();
QgsGeometry* tmpGeometry = 0;

tmpGeometry = featureGeometry->centroid();

QgsFeature newFeature;
@@ -572,15 +573,15 @@ bool QgsGeometryAnalyzer::convexHull( QgsVectorLayer* layer, const QString& shap

void QgsGeometryAnalyzer::convexFeature( QgsFeature& f, int nProcessedFeatures, QgsGeometry** dissolveGeometry )
{
QgsGeometry* featureGeometry = f.geometry();
QgsGeometry* tmpGeometry = 0;
QgsGeometry* convexGeometry = 0;

if ( !featureGeometry )
if ( !f.constGeometry() )
{
return;
}

const QgsGeometry* featureGeometry = f.constGeometry();
QgsGeometry* tmpGeometry = 0;
QgsGeometry* convexGeometry = 0;

convexGeometry = featureGeometry->convexHull();

if ( nProcessedFeatures == 0 )
@@ -732,13 +733,13 @@ bool QgsGeometryAnalyzer::dissolve( QgsVectorLayer* layer, const QString& shapef

void QgsGeometryAnalyzer::dissolveFeature( QgsFeature& f, int nProcessedFeatures, QgsGeometry** dissolveGeometry )
{
QgsGeometry* featureGeometry = f.geometry();

if ( !featureGeometry )
if ( !f.constGeometry() )
{
return;
}

const QgsGeometry* featureGeometry = f.constGeometry();

if ( nProcessedFeatures == 0 )
{
size_t geomSize = featureGeometry->wkbSize();
@@ -862,16 +863,16 @@ bool QgsGeometryAnalyzer::buffer( QgsVectorLayer* layer, const QString& shapefil
void QgsGeometryAnalyzer::bufferFeature( QgsFeature& f, int nProcessedFeatures, QgsVectorFileWriter* vfw, bool dissolve,
QgsGeometry** dissolveGeometry, double bufferDistance, int bufferDistanceField )
{
double currentBufferDistance;
QgsGeometry* featureGeometry = f.geometry();
QgsGeometry* tmpGeometry = 0;
QgsGeometry* bufferGeometry = 0;

if ( !featureGeometry )
if ( !f.constGeometry() )
{
return;
}

double currentBufferDistance;
const QgsGeometry* featureGeometry = f.constGeometry();
QgsGeometry* tmpGeometry = 0;
QgsGeometry* bufferGeometry = 0;

//create buffer
if ( bufferDistanceField == -1 )
{
@@ -997,16 +998,16 @@ bool QgsGeometryAnalyzer::eventLayer( QgsVectorLayer* lineLayer, QgsVectorLayer*
}

QList<QgsFeature> featureIdList = lineLayerIdMap.values( fet.attribute( eventField ).toString() );
QList<QgsFeature>::const_iterator featureIdIt = featureIdList.constBegin();
for ( ; featureIdIt != featureIdList.constEnd(); ++featureIdIt )
QList<QgsFeature>::iterator featureIdIt = featureIdList.begin();
for ( ; featureIdIt != featureIdList.end(); ++featureIdIt )
{
if ( locationField2 == -1 )
{
lrsGeom = locateAlongMeasure( measure1, featureIdIt->geometry() );
lrsGeom = locateAlongMeasure( measure1, featureIdIt->constGeometry() );
}
else
{
lrsGeom = locateBetweenMeasures( measure1, measure2, featureIdIt->geometry() );
lrsGeom = locateBetweenMeasures( measure1, measure2, featureIdIt->constGeometry() );
}

if ( lrsGeom )
@@ -1194,7 +1195,7 @@ QgsPoint QgsGeometryAnalyzer::createPointOffset( double x, double y, double dist
return QgsPoint( x - normalX, y - normalY ); //negative values -> left side, positive values -> right side
}

QgsGeometry* QgsGeometryAnalyzer::locateBetweenMeasures( double fromMeasure, double toMeasure, QgsGeometry* lineGeom )
QgsGeometry* QgsGeometryAnalyzer::locateBetweenMeasures( double fromMeasure, double toMeasure, const QgsGeometry* lineGeom )
{
if ( !lineGeom )
{
@@ -1238,7 +1239,7 @@ QgsGeometry* QgsGeometryAnalyzer::locateBetweenMeasures( double fromMeasure, dou
return QgsGeometry::fromMultiPolyline( resultGeom );
}

QgsGeometry* QgsGeometryAnalyzer::locateAlongMeasure( double measure, QgsGeometry* lineGeom )
QgsGeometry* QgsGeometryAnalyzer::locateAlongMeasure( double measure, const QgsGeometry *lineGeom )
{
if ( !lineGeom )
{
@@ -121,10 +121,10 @@ class ANALYSIS_EXPORT QgsGeometryAnalyzer
bool forceSingleGeometry = false, QgsVectorDataProvider* memoryProvider = 0, QProgressDialog* p = 0 );

/**Returns linear reference geometry as a multiline (or 0 if no match). Currently, the z-coordinates are considered to be the measures (no support for m-values in QGIS)*/
QgsGeometry* locateBetweenMeasures( double fromMeasure, double toMeasure, QgsGeometry* lineGeom );
QgsGeometry* locateBetweenMeasures( double fromMeasure, double toMeasure, const QgsGeometry *lineGeom );
/**Returns linear reference geometry. Unlike the PostGIS function, this method always returns multipoint or 0 if no match (not geometry collection).
Currently, the z-coordinates are considered to be the measures (no support for m-values in QGIS)*/
QgsGeometry* locateAlongMeasure( double measure, QgsGeometry* lineGeom );
QgsGeometry* locateAlongMeasure( double measure, const QgsGeometry* lineGeom );

private:

@@ -142,15 +142,15 @@ bool QgsOverlayAnalyzer::intersection( QgsVectorLayer* layerA, QgsVectorLayer* l
void QgsOverlayAnalyzer::intersectFeature( QgsFeature& f, QgsVectorFileWriter* vfw,
QgsVectorLayer* vl, QgsSpatialIndex* index )
{
QgsGeometry* featureGeometry = f.geometry();
QgsGeometry* intersectGeometry = 0;
QgsFeature overlayFeature;

if ( !featureGeometry )
if ( !f.constGeometry() )
{
return;
}

const QgsGeometry* featureGeometry = f.constGeometry();
QgsGeometry* intersectGeometry = 0;
QgsFeature overlayFeature;

QList<QgsFeatureId> intersects;
intersects = index->intersects( featureGeometry->boundingBox() );
QList<QgsFeatureId>::const_iterator it = intersects.constBegin();
@@ -162,9 +162,9 @@ void QgsOverlayAnalyzer::intersectFeature( QgsFeature& f, QgsVectorFileWriter* v
continue;
}

if ( featureGeometry->intersects( overlayFeature.geometry() ) )
if ( featureGeometry->intersects( overlayFeature.constGeometry() ) )
{
intersectGeometry = featureGeometry->intersection( overlayFeature.geometry() );
intersectGeometry = featureGeometry->intersection( overlayFeature.constGeometry() );

outFeature.setGeometry( intersectGeometry );
QgsAttributes attributesA = f.attributes();
@@ -83,12 +83,10 @@ int QgsPointSample::createRandomPoints( QProgressDialog* pd )

void QgsPointSample::addSamplePoints( QgsFeature& inputFeature, QgsVectorFileWriter& writer, int nPoints, double minDistance )
{
QgsGeometry* geom = inputFeature.geometry();
if ( !geom )
{
if ( !inputFeature.constGeometry() )
return;
}

const QgsGeometry* geom = inputFeature.constGeometry();
QgsRectangle geomRect = geom->boundingBox();
if ( geomRect.isEmpty() )
{

0 comments on commit 2863f20

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