Frank: As best I can tell the data layer is recognized as an OGROCITableLayer but the call to GetExtent only goes down to the OGRLayer. It is not passed down to the specific (OCI) driver. The calls to ResetReading and GetNextFeature in the GetExtent method are passed to the OCI driver but the GetGeometryRef and GetEvelope are not. The process flows into the "if (poGeom && !bExtentSet)" and the first getEnvelope inside the while statement then goes into the else portion for all of the remaining features in the dataset.
Bruce -----Original Message----- From: Frank Warmerdam [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 02, 2008 11:55 AM To: Clay, Bruce Cc: [email protected] Subject: Re: [gdal-dev] GetExtent method Clay, Bruce wrote: > When I used the debugger to step into the OGRLayer GetExtent method I > noticed that it walks through all of the features in the dataset and > tests the envelope of each feature in the set. > > > > Are there any driver specific optimizations (i.e. OCI) that could be > called instead of this one since it does take a long time for a large > dataset? > > > > I realize we can create our own but I would like to use a built in > function if it is available. > > > > Frank: Since you are working in the OCI driver would this be a good time > to add something like: > > select min(a1.SHAPE.SDO_POINT.X), > > max(a1.SHAPE.SDO_POINT.X), > > min(a1.SHAPE.SDO_POINT.Y), > > max(a1.SHAPE.SDO_POINT.Y) from DatasetName a1; > > > > Of course that falls back on the first question, is there already a > built in method. Bruce, We already have a specialized implementation of OGROCITableLayer::GetExtent() at: http://trac.osgeo.org/gdal/browser/trunk/gdal/ogr/ogrsf_frmts/oci/ogroci tablelayer.cpp#L1072 I wonder if this optimized case is failing for some reason for you? Or perhaps you are working with an result from ExecuteSQL()? Best regards, -- ---------------------------------------+-------------------------------- ------ I set the clouds in motion - turn up | Frank Warmerdam, [EMAIL PROTECTED] light and sound - activate the windows | http://pobox.com/~warmerdam and watch the world go round - Rush | Geospatial Programmer for Rent This message and any enclosures are intended only for the addressee. Please notify the sender by email if you are not the intended recipient. If you are not the intended recipient, you may not use, copy, disclose, or distribute this message or its contents or enclosures to any other person and any such actions may be unlawful. Ball reserves the right to monitor and review all messages and enclosures sent to or from this email address. _______________________________________________ gdal-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/gdal-dev
