Skip to content
Permalink
Browse files

remove SIP_SKIP and qDebug()

  • Loading branch information
NEDJIMAbelgacem authored and nyalldawson committed Jan 4, 2021
1 parent 9bd4673 commit 72d9eeeb0a3df1bc950d1058ed246b03000ab613
@@ -56,6 +56,20 @@ Ctor

~QgsPointCloudDataProvider();

QVector<QMap<QString, QVariant>> identify( float maxErrorInMapCoords, QgsGeometry extentGeometry, const QgsDoubleRange extentZRange = QgsDoubleRange(), int pointsLimit = 1000 );
%Docstring
Returns the list of points of the point cloud according to a zoom level
defined by ``maxErrorInMapCoords``, an extent ``geometry`` in the 2D plane
and a range ``extentZRange`` for z values. The function will try to limit
the number of points returned to ``pointsLimit`` points

``maxErrorPixels`` : maximum accepted error factor in pixels

.. note::

this function does not handle elevation properties and you need to
change elevation coordinates yourself after returning from the function
%End

virtual QgsPointCloudDataProvider::Capabilities capabilities() const;
%Docstring
@@ -321,29 +321,6 @@ QVector<QMap<QString, QVariant>> QgsPointCloudDataProvider::identify(
QgsGeometry extentGeometry,
const QgsDoubleRange extentZRange, int pointsLimit )
{
if ( extentGeometry.type() == QgsWkbTypes::GeometryType::PointGeometry )
{
QgsPointXY pt = extentGeometry.asPoint();
qDebug() << qSetRealNumberPrecision( 20 ) << __PRETTY_FUNCTION__ << " " << maxErrorInMapCoords << " " << pt.x() << " " << pt.y();
}
else if ( extentGeometry.type() == QgsWkbTypes::GeometryType::PolygonGeometry )
{
QPolygonF polygon = extentGeometry.asQPolygonF();
qDebug() << qSetRealNumberPrecision( 20 ) << __PRETTY_FUNCTION__ << " " << maxErrorInMapCoords;
qDebug() << "Polygon size: " << polygon.size();
qDebug() << "============================================";
qDebug() << " QPolygonF polygon;";
for ( QPointF p : polygon )
{
qDebug() << " polygon.push_back( QgsPointF( " << qSetRealNumberPrecision( 20 ) << p.x() << ", " << p.y() << " ) );";
}
qDebug() << "float maxErrorInMapCoords = " << qSetRealNumberPrecision( 20 ) << maxErrorInMapCoords;
qDebug() << "============================================";
}
else
{
qDebug() << __PRETTY_FUNCTION__ << "Unknown geometry";
}
QVector<QMap<QString, QVariant>> acceptedPoints;

QgsPointCloudIndex *index = this->index();
@@ -363,21 +340,6 @@ QVector<QMap<QString, QVariant>> QgsPointCloudDataProvider::identify(
qgis::overload<const QVector<QMap<QString, QVariant>>&>::of( &QVector<QMap<QString, QVariant>>::append ),
QtConcurrent::UnorderedReduce );

qDebug() << "------------------------------------------------------------------";
qDebug() << "QVector<QMap<QString, QVariant>> expected;";
for ( QMap<QString, QVariant> pt : acceptedPoints )
{
qDebug() << "{";
qDebug() << " " << "QMap<QString, QVariant> point;";
for ( QString key : pt.keys() )
{
qDebug() << qSetRealNumberPrecision( 20 ) << " point[ QStringLiteral(" << key << ") ] = " << pt[key].toString() << ";";
}
qDebug() << " expected.push_back(point);";
qDebug() << "}";
}
qDebug() << "------------------------------------------------------------------";

return acceptedPoints;
}

@@ -85,7 +85,7 @@ class CORE_EXPORT QgsPointCloudDataProvider: public QgsDataProvider
* \note this function does not handle elevation properties and you need to
* change elevation coordinates yourself after returning from the function
*/
QVector<QMap<QString, QVariant>> identify( float maxErrorInMapCoords, QgsGeometry extentGeometry, const QgsDoubleRange extentZRange = QgsDoubleRange(), int pointsLimit = 1000 ) SIP_SKIP;
QVector<QMap<QString, QVariant>> identify( float maxErrorInMapCoords, QgsGeometry extentGeometry, const QgsDoubleRange extentZRange = QgsDoubleRange(), int pointsLimit = 1000 );

/**
* Returns flags containing the supported capabilities for the data provider.
@@ -272,17 +272,6 @@ void TestQgsEptProvider::testIdentify()
polygon.push_back( ring );
float maxErrorInMapCoords = 0.0022857920266687870026;
QVector<QMap<QString, QVariant>> points = layer->dataProvider()->identify( maxErrorInMapCoords, QgsGeometry::fromPolygonXY( polygon ) );
qDebug() << "Points count : " << points.size();
int i = 1;
for ( QMap<QString, QVariant> pt : points )
{
qDebug() << "Point " << i; ++i;
for ( QString attr : pt.keys() )
{
qDebug() << qSetRealNumberPrecision( 20 ) << attr << " -> " << pt[attr];
}
qDebug() << "--------------------------------";
}
QCOMPARE( points.size(), 1 );
QMap<QString, QVariant> identifiedPoint = points[0];
QMap<QString, QVariant> expected;

0 comments on commit 72d9eee

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