Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge remote-tracking branch 'alvaro/Issue_10433'
  • Loading branch information
wonder-sk committed Jun 11, 2014
2 parents 7f434a0 + 7e0ef8f commit f520f31
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/core/qgsmaptopixelgeometrysimplifier.cpp
Expand Up @@ -247,10 +247,17 @@ bool QgsMapToPixelSimplifier::simplifyWkbGeometry( int simplifyFlags, QGis::WkbT
// Fix the topology of the geometry
if ( numTargetPoints <= ( isaLinearRing ? 2 : 1 ) )
{
unsigned char* targetTempWkb = targetWkb;
int targetWkbTempSize = targetWkbSize;

sourceWkb = sourcePrevWkb;
targetWkb = targetPrevWkb;
targetWkbSize = targetWkbPrevSize;
return generalizeWkbGeometry( wkbType, sourceWkb, sourceWkbSize, targetWkb, targetWkbSize, QgsRectangle( xmin, ymin, xmax, ymax ), writeHeader );
bool isok = generalizeWkbGeometry( wkbType, sourceWkb, sourceWkbSize, targetWkb, targetWkbSize, QgsRectangle( xmin, ymin, xmax, ymax ), writeHeader );
if ( isok ) return true;

targetWkb = targetTempWkb;
targetWkbSize = targetWkbTempSize;
}
if ( isaLinearRing )
{
Expand Down
3 changes: 2 additions & 1 deletion src/core/qgspallabeling.cpp
Expand Up @@ -1917,7 +1917,8 @@ void QgsPalLayerSettings::registerFeature( QgsFeature& f, const QgsRenderContext
// fix invalid polygons
if ( geom->type() == QGis::Polygon && !geom->isGeosValid() )
{
geom->fromGeos( GEOSBuffer( geom->asGeos(), 0, 0 ) );
const GEOSGeometry* geos = geom->asGeos();
if ( geos ) geom->fromGeos( GEOSBuffer( geos, 0, 0 ) );
}

// CLIP the geometry if it is bigger than the extent
Expand Down

0 comments on commit f520f31

Please sign in to comment.