236 |
236 |
}
|
237 |
237 |
}
|
238 |
238 |
|
|
239 |
bool QgsOracleFeatureIterator::prepareSimplification( const QgsSimplifyMethod& simplifyMethod )
|
|
240 |
{
|
|
241 |
// setup simplification of geometries to fetch
|
|
242 |
if ( !( mRequest.flags() & QgsFeatureRequest::NoGeometry ) &&
|
|
243 |
simplifyMethod.methodType() != QgsSimplifyMethod::NoSimplification &&
|
|
244 |
!simplifyMethod.forceLocalOptimization() )
|
|
245 |
{
|
|
246 |
QgsSimplifyMethod::MethodType methodType = simplifyMethod.methodType();
|
|
247 |
|
|
248 |
if ( methodType == QgsSimplifyMethod::OptimizeForRendering || methodType == QgsSimplifyMethod::PreserveTopology )
|
|
249 |
{
|
|
250 |
return true;
|
|
251 |
}
|
|
252 |
else
|
|
253 |
{
|
|
254 |
QgsDebugMsg( QString( "Simplification method type (%1) is not recognised by OracleFeatureIterator" ).arg( methodType ) );
|
|
255 |
}
|
|
256 |
}
|
|
257 |
return QgsAbstractFeatureIterator::prepareSimplification( simplifyMethod );
|
|
258 |
}
|
|
259 |
|
|
260 |
bool QgsOracleFeatureIterator::providerCanSimplify( QgsSimplifyMethod::MethodType methodType ) const
|
|
261 |
{
|
|
262 |
return methodType == QgsSimplifyMethod::OptimizeForRendering || methodType == QgsSimplifyMethod::PreserveTopology;
|
|
263 |
}
|
|
264 |
|
239 |
265 |
bool QgsOracleFeatureIterator::rewind()
|
240 |
266 |
{
|
241 |
267 |
if ( !mQry.isActive() )
|
... | ... | |
268 |
294 |
|
269 |
295 |
if (( mRequest.flags() & QgsFeatureRequest::NoGeometry ) == 0 && !mSource->mGeometryColumn.isNull() )
|
270 |
296 |
{
|
271 |
|
query += QgsOracleProvider::quotedIdentifier( mSource->mGeometryColumn );
|
|
297 |
QString geom = QgsOracleProvider::quotedIdentifier( mSource->mGeometryColumn );
|
|
298 |
|
|
299 |
if ( !mRequest.simplifyMethod().forceLocalOptimization() &&
|
|
300 |
mRequest.simplifyMethod().methodType() != QgsSimplifyMethod::NoSimplification &&
|
|
301 |
QGis::flatType( QGis::singleType( mSource->mRequestedGeomType != QGis::WKBUnknown
|
|
302 |
? mSource->mRequestedGeomType
|
|
303 |
: mSource->mDetectedGeomType ) ) != QGis::WKBPoint )
|
|
304 |
{
|
|
305 |
if ( mRequest.simplifyMethod().methodType() == QgsSimplifyMethod::OptimizeForRendering )
|
|
306 |
{
|
|
307 |
geom = QString( "%1( %2, %3 )" )
|
|
308 |
.arg( "SDO_UTIL.RECTIFY_GEOMETRY" )
|
|
309 |
.arg( geom )
|
|
310 |
.arg( mRequest.simplifyMethod().tolerance() * 0.8);
|
|
311 |
}
|
|
312 |
else
|
|
313 |
{
|
|
314 |
geom = QString( "%1( %2, %3, %4 )" )
|
|
315 |
.arg( "SDO_UTIL.SIMPLIFY" )
|
|
316 |
.arg( geom )
|
|
317 |
.arg( mRequest.simplifyMethod().tolerance() * 0.8 )
|
|
318 |
.arg( mRequest.simplifyMethod().tolerance() * 0.8 );
|
|
319 |
|
|
320 |
}
|
|
321 |
}
|
|
322 |
|
|
323 |
query += geom;
|
272 |
324 |
delim = ",";
|
273 |
325 |
}
|
274 |
326 |
|