Skip to content

Commit

Permalink
More efficiency improvements for map to pixel simplification
Browse files Browse the repository at this point in the history
Refs #17809
  • Loading branch information
nyalldawson committed Feb 11, 2018
1 parent db12f00 commit b60489d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/core/qgsmaptopixelgeometrysimplifier.cpp
Expand Up @@ -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
{
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit b60489d

Please sign in to comment.