[gdal-dev] GML, MySQL data sources and preserve_fid

Attila Csipa plists at prometheus.org.yu
Sun Apr 6 12:49:36 EDT 2008


I'm just experimenting with having some of my data in MySQL, but I'm getting 
strange results regarding the FID - losing it, that is. It might be just that 
I have overlooked something obvious, but google and the ogr wiki pages turned 
up nothing that caught my eye...

If I dump my data to gml from mysql like this:

ogr2ogr -preserve_fid -f GML test.gml MySQL:test,user=root

the GML will have the correct FID-s, however, if I try to load back that same 
GML into mysql with:

ogr2ogr -preserve_fid -f MySQL MySQL:test,user=root test.gml -overwrite

the features in the tables will have a sequential OGR_FID starting with 1, 
regardless of what the GML contains in the fid attribute of the features. 
This messes things up a bit as one of the feature fields is actually a 
reference to the parent features' FID. I'm using GDAL 1.4.4 on Gutsy (sadly 
no official 1.5.x packages in backports for Ubuntu yet). Any ideas ?


More information about the gdal-dev mailing list