hi list,

in the gdal java bindings I need to delete a feature from layer, but it
seems the only way to delete the feature is its FID, which in my case is
unknown. Is there anyway to find the true FID of a feature in layer or
remove a feature by reference just like it can be updated or re-written.

my code ..


Feature f = layer.GetFeature(i); // i is index of loop that runs till total
feature count

g=f.GetGeometryRef();

layer.SetSpatialFilter(g); //reducing layer content to features with same
geom...here its a point

Feature comparefeature = layer.GetNextFeature();

*do*{

*if*(!f.Equal(comparefeature))

{

comparefeature.delete(); // not the right method...

delcount++;

}

 comparefeature = layer.GetNextFeature();

}*while*(comparefeature!=*null*);

layer.ResetReading();

layer.SetSpatialFilter(*null*); //remove spatial filter
-----------------------
regards,
Imran

-- 
I.R
_______________________________________________
gdal-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to