Skip to content

Commit

Permalink
remove SIP_SKIP and qDebug()
Browse files Browse the repository at this point in the history
  • Loading branch information
NEDJIMAbelgacem authored and nyalldawson committed Jan 4, 2021
1 parent 9bd4673 commit 72d9eee
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 50 deletions.
Expand Up @@ -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
Expand Down
38 changes: 0 additions & 38 deletions src/core/pointcloud/qgspointclouddataprovider.cpp
Expand Up @@ -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();
Expand All @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/pointcloud/qgspointclouddataprovider.h
Expand Up @@ -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.
Expand Down
11 changes: 0 additions & 11 deletions tests/src/providers/testqgseptprovider.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit 72d9eee

Please sign in to comment.