[Gdal-dev] Layer Equality

Simon Perkins sy at perkins.net
Wed Jul 18 19:04:06 EDT 2007


Hi,

I'm trying to do something that on the face of it should be fairly 
straightforward, but I can't quite see how to do it in the best way. 
Basically, I have an open OGRLayer, and I'd like to see if this OGRLayer 
is the same as another layer in the same OGRDataSource, which I only 
know by name. Ultimately, if the named layer already exists, I'd like to 
delete it and replace it with the contents of the OGRLayer. Unless, that 
named layer is actually the same layer as the existing OGRLayer, in 
whcih case nothing needs to happen. The question is, how can I check for 
this? I know the index number of the existing OGRLayer, but I'm not sure 
I see how to determine the index number of the named layer to see if 
they are the same. Similarly, I'm not sure how to get the name of the 
existing OGRLayer to use that as a comparison. Any ideas?

Cheers,

Simon




More information about the Gdal-dev mailing list