mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-27 00:33:48 -05:00
More efficiency improvements for map to pixel simplification
Refs #17809
This commit is contained in:
parent
db12f006d9
commit
b60489db49
@ -91,10 +91,7 @@ static QgsGeometry generalizeWkbGeometryByBoundingBox(
|
|||||||
// Write the generalized geometry
|
// Write the generalized geometry
|
||||||
if ( geometryType == QgsWkbTypes::LineString )
|
if ( geometryType == QgsWkbTypes::LineString )
|
||||||
{
|
{
|
||||||
QgsLineString *lineString = new QgsLineString();
|
return QgsGeometry( qgis::make_unique< QgsLineString >( QVector<double>() << x1 << x2, QVector<double>() << y1 << y2 ) );
|
||||||
lineString->addVertex( QgsPoint( x1, y1 ) );
|
|
||||||
lineString->addVertex( QgsPoint( x2, y2 ) );
|
|
||||||
return QgsGeometry( lineString );
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -127,9 +124,9 @@ QgsGeometry QgsMapToPixelSimplifier::simplifyGeometry(
|
|||||||
// Write the geometry
|
// Write the geometry
|
||||||
if ( flatType == QgsWkbTypes::LineString || flatType == QgsWkbTypes::CircularString )
|
if ( flatType == QgsWkbTypes::LineString || flatType == QgsWkbTypes::CircularString )
|
||||||
{
|
{
|
||||||
|
const QgsCurve &srcCurve = dynamic_cast<const QgsCurve &>( geometry );
|
||||||
const int numPoints = srcCurve.numPoints();
|
const int numPoints = srcCurve.numPoints();
|
||||||
|
|
||||||
const QgsCurve &srcCurve = dynamic_cast<const QgsCurve &>( geometry );
|
|
||||||
std::unique_ptr<QgsCurve> output;
|
std::unique_ptr<QgsCurve> output;
|
||||||
|
|
||||||
QVector< double > lineStringX;
|
QVector< double > lineStringX;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user