Hi List,<br><br> I have observed a puzzling behaviour of the reported extent of an ogr layer after geometries of features have been modified, with the file opened in update mode. I use gdal 1.7 via the pyhton bindings, open a dataset with ogr.Open(fname,update=True), then loop through layers and features and modify geometries like: <br>
geom=feature.GetGeometryRef(), new_geom=some_modification(geom), feature.SetGeometry(new_geom), layer.SetFeature(feature). However, ogr (and Qgis, which uses ogr for that I suppose) reports the new layer extent as, the "minimal bounding box" of the new and old extents. So somehow, the extent before geometry modification is still stored somewhere in the dataset. The same observations also hold for a dataset which is modified by hand using the editing tools in Qgis! Consider the following ogrinfo output from a file with one layer, containing one point:<br>
INFO: Open of `qgis_test.shp'<br> using driver `ESRI Shapefile' successful.<br><br>Layer name: qgis_test<br>Geometry: Point<br>Feature Count: 1<br>Extent: (0.077586, 0.577586) - (10.670690, 31.805172)<br>Layer SRS WKT:<br>
GEOGCS["GCS_WGS_1984",<br> DATUM["WGS_1984",<br> SPHEROID["WGS_1984",6378137,298.257223563]],<br> PRIMEM["Greenwich",0],<br> UNIT["Degree",0.017453292519943295]]<br>
test: String (80.0)<br>OGRFeature(qgis_test):0<br> test (String) = nothing<br> POINT (10.670689655172414 31.805172413793112)<br><br>Even though the point clearly lies at (10.67,31.80) the previous position is still included in the extent. Is this a bug or is there some reasoning behind this behaviour?<br>
<br>Best Regards,<br>Simon. National Survey and Cadastre of Denmark<br><br>