Skip to content

Commit

Permalink
Fix labeling positions are reversed on certain negative offsets
Browse files Browse the repository at this point in the history
on builds based on GEOS >= 3.11

Refs #49234
  • Loading branch information
nyalldawson committed Dec 9, 2022
1 parent cf8737c commit 6a985bb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/pal/pointset.cpp
Expand Up @@ -589,15 +589,17 @@ void PointSet::offsetCurveByDistance( double distance )
newGeos = std::move( longestPartClone );
}

#if GEOS_VERSION_MAJOR==3 && GEOS_VERSION_MINOR<11
if ( distance < 0 )
{
// geos reverses the direction of offset curves with negative distances -- we don't want that!
// geos < 3.11 reverses the direction of offset curves with negative distances -- we don't want that!
geos::unique_ptr reversed( GEOSReverse_r( geosctxt, newGeos.get() ) );
if ( !reversed )
return;

newGeos = std::move( reversed );
}
#endif

const int newNbPoints = GEOSGeomGetNumPoints_r( geosctxt, newGeos.get() );
const GEOSCoordSequence *coordSeq = GEOSGeom_getCoordSeq_r( geosctxt, newGeos.get() );
Expand Down

0 comments on commit 6a985bb

Please sign in to comment.