Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Aug 13, 2021
1 parent 1acedba commit 34c9bd8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/analysis/vector/qgsgeometrysnapper.cpp
Expand Up @@ -209,7 +209,7 @@ void QgsSnapIndex::addPoint( const CoordIdx *idx, bool isEndPoint )

GEOSContextHandle_t geosctxt = QgsGeos::getGEOSHandler();
#if GEOS_VERSION_MAJOR>3 || GEOS_VERSION_MINOR>=8
const geos::unique_ptr point( GEOSGeom_createPointFromXY_r( geosctxt, row, col ) );
geos::unique_ptr point( GEOSGeom_createPointFromXY_r( geosctxt, row, col ) );
#else
GEOSCoordSequence *seq = GEOSCoordSeq_create_r( geosctxt, 1, 2 );
GEOSCoordSeq_setX_r( geosctxt, seq, 0, row );
Expand Down Expand Up @@ -240,7 +240,7 @@ void QgsSnapIndex::addSegment( const CoordIdx *idxFrom, const CoordIdx *idxTo )
for ( ; rt.isValid(); rt.next() )
{
#if GEOS_VERSION_MAJOR>3 || GEOS_VERSION_MINOR>=8
const geos::unique_ptr point( GEOSGeom_createPointFromXY_r( geosctxt, rt.curRow(), rt.curCol() ) );
geos::unique_ptr point( GEOSGeom_createPointFromXY_r( geosctxt, rt.curRow(), rt.curCol() ) );
#else
GEOSCoordSequence *seq = GEOSCoordSeq_create_r( geosctxt, 1, 2 );
GEOSCoordSeq_setX_r( geosctxt, seq, 0, rt.curRow() );
Expand Down Expand Up @@ -317,7 +317,7 @@ QgsPoint QgsSnapIndex::getClosestSnapToPoint( const QgsPoint &p, const QgsPoint
for ( ; rt.isValid(); rt.next() )
{
#if GEOS_VERSION_MAJOR>3 || GEOS_VERSION_MINOR>=8
const geos::unique_ptr searchPoint( GEOSGeom_createPointFromXY_r( geosctxt, rt.curRow(), rt.curCol() ) );
geos::unique_ptr searchPoint( GEOSGeom_createPointFromXY_r( geosctxt, rt.curRow(), rt.curCol() ) );
#else
GEOSCoordSequence *seq = GEOSCoordSeq_create_r( geosctxt, 1, 2 );
GEOSCoordSeq_setX_r( geosctxt, seq, 0, rt.curRow() );
Expand Down Expand Up @@ -369,7 +369,7 @@ QgsSnapIndex::SnapItem *QgsSnapIndex::getSnapItem( const QgsPoint &pos, double t
GEOSCoordSeq_setY_r( geosctxt, coord, 1, colEnd );
#endif

const geos::unique_ptr searchDiagonal( GEOSGeom_createLineString_r( geosctxt, coord ) );
geos::unique_ptr searchDiagonal( GEOSGeom_createLineString_r( geosctxt, coord ) );

QList<SnapItem *> items;
struct _GEOSQueryCallbackData callbackData;
Expand Down
2 changes: 1 addition & 1 deletion src/core/pal/geomfunction.cpp
Expand Up @@ -359,7 +359,7 @@ bool GeomFunction::containsCandidate( const GEOSPreparedGeometry *geom, double x
GEOSCoordSeq_setY_r( geosctxt, coord, 4, y );
#endif

const geos::unique_ptr bboxGeos( GEOSGeom_createLinearRing_r( geosctxt, coord ) );
geos::unique_ptr bboxGeos( GEOSGeom_createLinearRing_r( geosctxt, coord ) );
const bool result = ( GEOSPreparedContainsProperly_r( geosctxt, geom, bboxGeos.get() ) == 1 );
return result;
}
Expand Down
8 changes: 4 additions & 4 deletions src/core/pal/pointset.cpp
Expand Up @@ -269,7 +269,7 @@ bool PointSet::containsPoint( double x, double y ) const
try
{
#if GEOS_VERSION_MAJOR>3 || GEOS_VERSION_MINOR>=8
const geos::unique_ptr point( GEOSGeom_createPointFromXY_r( geosctxt, x, y ) );
geos::unique_ptr point( GEOSGeom_createPointFromXY_r( geosctxt, x, y ) );
#else
GEOSCoordSequence *seq = GEOSCoordSeq_create_r( geosctxt, 1, 2 );
GEOSCoordSeq_setX_r( geosctxt, seq, 0, x );
Expand Down Expand Up @@ -862,7 +862,7 @@ double PointSet::minDistanceToPoint( double px, double py, double *rx, double *r
try
{
#if GEOS_VERSION_MAJOR>3 || GEOS_VERSION_MINOR>=8
const geos::unique_ptr geosPt( GEOSGeom_createPointFromXY_r( geosctxt, px, py ) );
geos::unique_ptr geosPt( GEOSGeom_createPointFromXY_r( geosctxt, px, py ) );
#else
GEOSCoordSequence *coord = GEOSCoordSeq_create_r( geosctxt, 1, 2 );
GEOSCoordSeq_setX_r( geosctxt, coord, 0, px );
Expand Down Expand Up @@ -940,7 +940,7 @@ void PointSet::getCentroid( double &px, double &py, bool forceInside ) const
try
{
GEOSContextHandle_t geosctxt = QgsGeos::getGEOSHandler();
const geos::unique_ptr centroidGeom( GEOSGetCentroid_r( geosctxt, mGeos ) );
geos::unique_ptr centroidGeom( GEOSGetCentroid_r( geosctxt, mGeos ) );
if ( centroidGeom )
{
const GEOSCoordSequence *coordSeq = GEOSGeom_getCoordSeq_r( geosctxt, centroidGeom.get() );
Expand All @@ -959,7 +959,7 @@ void PointSet::getCentroid( double &px, double &py, bool forceInside ) const
// check if centroid inside in polygon
if ( forceInside && !containsPoint( px, py ) )
{
const geos::unique_ptr pointGeom( GEOSPointOnSurface_r( geosctxt, mGeos ) );
geos::unique_ptr pointGeom( GEOSPointOnSurface_r( geosctxt, mGeos ) );

if ( pointGeom )
{
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/topology/topolTest.cpp
Expand Up @@ -37,7 +37,7 @@

static bool _canExportToGeos( const QgsGeometry &geom )
{
const geos::unique_ptr geosGeom = QgsGeos::asGeos( geom );
geos::unique_ptr geosGeom = QgsGeos::asGeos( geom );
return static_cast<bool>( geosGeom );
}

Expand Down

0 comments on commit 34c9bd8

Please sign in to comment.