[gdal-dev] Fields

Ari Jolma ari.jolma at gmail.com
Sun Apr 15 03:11:59 EDT 2012


On 04/14/2012 11:16 PM, Even Rouault wrote:
> Le samedi 14 avril 2012 13:35:51, Ari Jolma a écrit :
>> Folks,
>>
>> While extending the method set of Geo::OGR::Layer in the Perl bindings I
>> noticed that it is perfectly possible to create two fields with the same
>> name into a layer. This seems too relaxed. Or are there use cases where
>> one would like to have more than one field which has the same name?
> Ari,
>
> I doubt there are really valid use cases where this would make sense, and I
> know that for instance, ogr2ogr will not be able to correctly deal with that
> (it will only keep one field for several fields with same name).
>
> However it would require quite a bit of effort to guarantee field name
> uniqueness, because all drivers should be updated to implement the logic to
> avoid that.

Hm. I thought that only as an interface issue with methods such as 
Layer::CreateField and Layer::AlterField. As I usually consider 
interactive use, I try to build in checks against common mistakes - and 
I was wondering is it always a mistake. The database theory usually 
assumes an unordered set of attributes identified by names. I'm 
wondering is there a reason for the user to even know about the indexes 
of the fields.

The broader issue is that I'm trying to think about and build support 
for "complete" algebra for feature layers - a bit similar to raster 
algebra. I think the fundamental object the user works with is a Layer. 
There is for example a method "Union" in ArcObjects and QGIS has 
something too. BTW, does anybody know about any theoretical work on this 
issue?

Ari

>
> Even
>
>> Ari
>>
>> _______________________________________________
>> gdal-dev mailing list
>> gdal-dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/gdal-dev



More information about the gdal-dev mailing list