Skip to content

Commit b60489d

Browse files
committedFeb 11, 2018
More efficiency improvements for map to pixel simplification
Refs #17809
1 parent db12f00 commit b60489d

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed
 

‎src/core/qgsmaptopixelgeometrysimplifier.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,7 @@ static QgsGeometry generalizeWkbGeometryByBoundingBox(
9191
// Write the generalized geometry
9292
if ( geometryType == QgsWkbTypes::LineString )
9393
{
94-
QgsLineString *lineString = new QgsLineString();
95-
lineString->addVertex( QgsPoint( x1, y1 ) );
96-
lineString->addVertex( QgsPoint( x2, y2 ) );
97-
return QgsGeometry( lineString );
94+
return QgsGeometry( qgis::make_unique< QgsLineString >( QVector<double>() << x1 << x2, QVector<double>() << y1 << y2 ) );
9895
}
9996
else
10097
{
@@ -127,9 +124,9 @@ QgsGeometry QgsMapToPixelSimplifier::simplifyGeometry(
127124
// Write the geometry
128125
if ( flatType == QgsWkbTypes::LineString || flatType == QgsWkbTypes::CircularString )
129126
{
127+
const QgsCurve &srcCurve = dynamic_cast<const QgsCurve &>( geometry );
130128
const int numPoints = srcCurve.numPoints();
131129

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

135132
QVector< double > lineStringX;

0 commit comments

Comments
 (0)
Please sign in to comment.