Skip to content

Commit c1f8230

Browse files
committed
followup 55135d6
1 parent 562aec3 commit c1f8230

File tree

3 files changed

+24
-24
lines changed

3 files changed

+24
-24
lines changed

python/core/qgsgeometry.sip

+21-21
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@ class QgsGeometry
8282
/**
8383
* Returns the size of the WKB in asWkb().
8484
*/
85-
size_t wkbSize();
85+
size_t wkbSize() const;
8686

8787
/** Returns type of wkb (point / linestring / polygon etc.) */
88-
QGis::WkbType wkbType();
88+
QGis::WkbType wkbType() const;
8989

9090
/** Returns type of the vector */
9191
QGis::GeometryType type();
@@ -253,41 +253,41 @@ class QgsGeometry
253253
QgsRectangle boundingBox();
254254

255255
/** Test for intersection with a rectangle (uses GEOS) */
256-
bool intersects( const QgsRectangle& r );
256+
bool intersects( const QgsRectangle& r ) const;
257257

258258
/** Test for intersection with a geometry (uses GEOS) */
259-
bool intersects( QgsGeometry* geometry );
259+
bool intersects( const QgsGeometry* geometry ) const;
260260

261261
/** Test for containment of a point (uses GEOS) */
262-
bool contains( QgsPoint* p );
262+
bool contains( const QgsPoint* p ) const;
263263

264264
/** Test for if geometry is contained in an other (uses GEOS)
265265
* @note added in 1.5 */
266-
bool contains( QgsGeometry* geometry );
266+
bool contains( const QgsGeometry* geometry ) const;
267267

268268
/** Test for if geometry is disjoint of an other (uses GEOS)
269269
* @note added in 1.5 */
270-
bool disjoint( QgsGeometry* geometry );
270+
bool disjoint( const QgsGeometry* geometry ) const;
271271

272272
/** Test for if geometry equals an other (uses GEOS)
273273
* @note added in 1.5 */
274-
bool equals( QgsGeometry* geometry );
274+
bool equals( const QgsGeometry* geometry ) const;
275275

276276
/** Test for if geometry touch an other (uses GEOS)
277277
* @note added in 1.5 */
278-
bool touches( QgsGeometry* geometry );
278+
bool touches( const QgsGeometry* geometry ) const;
279279

280280
/** Test for if geometry overlaps an other (uses GEOS)
281281
* @note added in 1.5 */
282-
bool overlaps( QgsGeometry* geometry );
282+
bool overlaps( const QgsGeometry* geometry ) const;
283283

284284
/** Test for if geometry is within an other (uses GEOS)
285285
* @note added in 1.5 */
286-
bool within( QgsGeometry* geometry );
286+
bool within( const QgsGeometry* geometry ) const;
287287

288288
/** Test for if geometry crosses an other (uses GEOS)
289289
* @note added in 1.5 */
290-
bool crosses( QgsGeometry* geometry );
290+
bool crosses( const QgsGeometry* geometry ) const;
291291

292292
/** Returns a buffer region around this geometry having the given width and with a specified number
293293
of segments used to approximate curves */
@@ -326,44 +326,44 @@ class QgsGeometry
326326
/** Exports the geometry to mWkt
327327
* @return true in case of success and false else
328328
*/
329-
QString exportToWkt();
329+
QString exportToWkt() const;
330330

331331
/** Exports the geometry to mGeoJSON
332332
* @return true in case of success and false else
333333
* @note added in 1.8
334334
* @note python binding added in 1.9
335335
*/
336-
QString exportToGeoJSON();
336+
QString exportToGeoJSON() const;
337337

338338
/* Accessor functions for getting geometry data */
339339

340340
/** return contents of the geometry as a point
341341
if wkbType is WKBPoint, otherwise returns [0,0] */
342-
QgsPoint asPoint();
342+
QgsPoint asPoint() const;
343343

344344
/** return contents of the geometry as a polyline
345345
if wkbType is WKBLineString, otherwise an empty list */
346-
QgsPolyline asPolyline();
346+
QgsPolyline asPolyline() const;
347347

348348
/** return contents of the geometry as a polygon
349349
if wkbType is WKBPolygon, otherwise an empty list */
350-
QgsPolygon asPolygon();
350+
QgsPolygon asPolygon() const;
351351

352352
/** return contents of the geometry as a multi point
353353
if wkbType is WKBMultiPoint, otherwise an empty list */
354-
QgsMultiPoint asMultiPoint();
354+
QgsMultiPoint asMultiPoint() const;
355355

356356
/** return contents of the geometry as a multi linestring
357357
if wkbType is WKBMultiLineString, otherwise an empty list */
358-
QgsMultiPolyline asMultiPolyline();
358+
QgsMultiPolyline asMultiPolyline() const;
359359

360360
/** return contents of the geometry as a multi polygon
361361
if wkbType is WKBMultiPolygon, otherwise an empty list */
362-
QgsMultiPolygon asMultiPolygon();
362+
QgsMultiPolygon asMultiPolygon() const;
363363

364364
/** return contents of the geometry as a list of geometries
365365
@note added in version 1.1 */
366-
QList<QgsGeometry*> asGeometryCollection() /Factory/;
366+
QList<QgsGeometry*> asGeometryCollection() const /Factory/;
367367

368368
/** delete a ring in polygon or multipolygon.
369369
Ring 0 is outer ring and can't be deleted.

src/providers/oracle/qgsoracleprovider.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1679,12 +1679,12 @@ bool QgsOracleProvider::changeAttributeValues( const QgsChangedAttributesMap & a
16791679
return returnvalue;
16801680
}
16811681

1682-
void QgsOracleProvider::appendGeomParam( QgsGeometry *geom, QSqlQuery &qry ) const
1682+
void QgsOracleProvider::appendGeomParam( const QgsGeometry *geom, QSqlQuery &qry ) const
16831683
{
16841684
QOCISpatialGeometry g;
16851685

16861686
wkbPtr ptr;
1687-
ptr.ucPtr = geom ? geom->asWkb() : 0;
1687+
ptr.ucPtr = geom ? ( unsigned char * ) geom->asWkb() : 0;
16881688
g.isNull = !ptr.ucPtr;
16891689
g.gtype = -1;
16901690
g.srid = mSrid < 1 ? -1 : mSrid;

src/providers/oracle/qgsoracleprovider.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ class QgsOracleProvider : public QgsVectorDataProvider
264264
QString whereClause( QgsFeatureId featureId ) const;
265265
QString pkParamWhereClause() const;
266266
QString paramValue( QString fieldvalue, const QString &defaultValue ) const;
267-
void appendGeomParam( QgsGeometry *geom, QSqlQuery &qry ) const;
267+
void appendGeomParam( const QgsGeometry *geom, QSqlQuery &qry ) const;
268268
void appendPkParams( QgsFeatureId fid, QSqlQuery &qry ) const;
269269

270270
bool hasSufficientPermsAndCapabilities();

0 commit comments

Comments
 (0)