Opened 12 years ago
Closed 12 years ago
#4079 closed defect (fixed)
OCI: layer extents not updated in metadata when SyncToDisk() called.
Reported by: | warmerdam | Owned by: | warmerdam |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | OGR_SF | Version: | unspecified |
Severity: | normal | Keywords: | oci |
Cc: | andersmoe, msmitherdc |
Description
When saving a new layer it seems as if it is not comitted as expected. To reproduce :
OGRLayer* layer = datasource->ExecuteSQL("SELECT * FROM mylayer"); datasource->CopyLayer (layer, "newlayer", ....) datasource->SyncToDisc();
If I now list SDO_GEOM_METADATA I dont see the laye listed until I close the DataSource. Is there any way to have this comitted ?
Attachments (2)
Change History (10)
comment:1 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 by , 12 years ago
Priority: | normal → high |
---|---|
Resolution: | fixed |
Status: | closed → reopened |
Frank,
On existing datasets, where the amount of data is large, this is causing a big problem, as its have to re-read all the geometries to set the new extents. We might have to make this an option of in some way disable this for some datasets. Or just read the existing metadata and expand it by the new extents only if the new data is not within the current extents.
comment:3 by , 12 years ago
Looking through the changes, looks like the logic makes sense, you are only updating the metadata where the new data is not in the extent of the existing metadata. But I set a data layer to have -180, -90, +180, +90 extents in the metadata and then ran an update. The result was that after the data was loaded, it did run a select against the data and the metadata. And that is where the problem is. I think you just want to run the check against the existing metadata rather than against both. So change lines 1333- 1347 of /gdal/ogr/ogrsf_frmts/oci/ogrocitablelayer.cpp
to
osCommand.Printf(
"select min(case when r=1 then sdo_lb else null end) minx, min(case when r=2 then sdo_lb else null end) miny, "
"min(case when r=1 then sdo_ub else null end) maxx, min(case when r=2 then sdo_ub else null end) maxy"
"from( select sdo_dimname, sdo_lb, sdo_ub, sdo_tolerance, rownum r from table" "(SELECT m.sdo_diminfo FROM MDSYS.SDO_GEOM_METADATA_TABLE m" "where m.sdo_table_name = UPPER('%s') and m.SDO_COLUMN_NAME = UPPER('%s')"
osTableName.c_str(), pszGeomName );
if( osOwner != "" )
{
osMoreCmd.Printf( "AND SDO_OWNER = UPPER('%s')", osOwner.c_str() );
}
osMoreCmd.Printf("))");
Mike
comment:4 by , 12 years ago
Cc: | added |
---|
comment:6 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Mike,
Thanks! I have applied this in trunk (r22544).
comment:7 by , 12 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
comment:8 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
updated patch (approximately) applied in trunk (r22563) but not yet tested.
I have made significant modifications so that layer extents are now written or updated in the metadata each time SyncToDisk() is called on the layer. Note that previously, there was no attempt to update the layer extents of existing layers when new features were written so this aspect is new too (r22346).