mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-17 00:04:02 -04:00
fix #29630 spatialindex for NaN points
This commit is contained in:
parent
789a758464
commit
c2042a2ee3
@ -668,13 +668,17 @@ bool QgsPointLocator::rebuildIndex( int maxFeaturesToIndex )
|
||||
}
|
||||
}
|
||||
|
||||
SpatialIndex::Region r( rect2region( f.geometry().boundingBox() ) );
|
||||
dataList << new RTree::Data( 0, nullptr, r, f.id() );
|
||||
const QgsRectangle bbox = f.geometry().boundingBox();
|
||||
if ( bbox.isFinite() )
|
||||
{
|
||||
SpatialIndex::Region r( rect2region( bbox ) );
|
||||
dataList << new RTree::Data( 0, nullptr, r, f.id() );
|
||||
|
||||
if ( mGeoms.contains( f.id() ) )
|
||||
delete mGeoms.take( f.id() );
|
||||
mGeoms[f.id()] = new QgsGeometry( f.geometry() );
|
||||
++indexedCount;
|
||||
if ( mGeoms.contains( f.id() ) )
|
||||
delete mGeoms.take( f.id() );
|
||||
mGeoms[f.id()] = new QgsGeometry( f.geometry() );
|
||||
++indexedCount;
|
||||
}
|
||||
|
||||
if ( maxFeaturesToIndex != -1 && indexedCount > maxFeaturesToIndex )
|
||||
{
|
||||
@ -777,8 +781,8 @@ void QgsPointLocator::onFeatureAdded( QgsFeatureId fid )
|
||||
}
|
||||
}
|
||||
|
||||
QgsRectangle bbox = f.geometry().boundingBox();
|
||||
if ( !bbox.isNull() )
|
||||
const QgsRectangle bbox = f.geometry().boundingBox();
|
||||
if ( bbox.isFinite() )
|
||||
{
|
||||
SpatialIndex::Region r( rect2region( bbox ) );
|
||||
mRTree->insertData( 0, nullptr, r, f.id() );
|
||||
|
@ -379,6 +379,10 @@ bool QgsSpatialIndex::featureInfo( const QgsFeature &f, QgsRectangle &rect, QgsF
|
||||
|
||||
id = f.id();
|
||||
rect = f.geometry().boundingBox();
|
||||
|
||||
if ( !rect.isFinite() )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user