Skip to content
Permalink
Browse files

More efficiency improvements for map to pixel simplification

Refs #17809
  • Loading branch information
nyalldawson committed Feb 11, 2018
1 parent db12f00 commit b60489db49263d85cd4bf2feeb863631439e0170
Showing with 2 additions and 5 deletions.
  1. +2 −5 src/core/qgsmaptopixelgeometrysimplifier.cpp
@@ -91,10 +91,7 @@ static QgsGeometry generalizeWkbGeometryByBoundingBox(
// Write the generalized geometry
if ( geometryType == QgsWkbTypes::LineString )
{
QgsLineString *lineString = new QgsLineString();
lineString->addVertex( QgsPoint( x1, y1 ) );
lineString->addVertex( QgsPoint( x2, y2 ) );
return QgsGeometry( lineString );
return QgsGeometry( qgis::make_unique< QgsLineString >( QVector<double>() << x1 << x2, QVector<double>() << y1 << y2 ) );
}
else
{
@@ -127,9 +124,9 @@ QgsGeometry QgsMapToPixelSimplifier::simplifyGeometry(
// Write the geometry
if ( flatType == QgsWkbTypes::LineString || flatType == QgsWkbTypes::CircularString )
{
const QgsCurve &srcCurve = dynamic_cast<const QgsCurve &>( geometry );
const int numPoints = srcCurve.numPoints();

const QgsCurve &srcCurve = dynamic_cast<const QgsCurve &>( geometry );
std::unique_ptr<QgsCurve> output;

QVector< double > lineStringX;

0 comments on commit b60489d

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