Skip to content
Prev 12612 / 29559 Next

Setting FID values when saving GML files with writeOGR

Dear list members,

Is it possible to define which FID values should be used when 
saving a SpatialPointsDataFrame to a GML files using writeOGR 
(rgdal package)?

The FID values are stored as <ogr:layername fid="F0"> (and F1, 
F2, ?). If I insert a new row in the SPDF, most features change 
their FID, which creates much unneccessary noise in our VCS,
so I would like to use an already existing ID as the FID.

I have tried change both the row.names and adding columns named
?fid? and ?gml_id?, the writeOGR still only uses F0, F1, ? as 
the FIDs.