[gdal-dev] RFC 29: OGR Set Desired Fields

Martin Dobias wonder.sk at gmail.com
Thu Jul 29 09:41:51 EDT 2010


On Thu, Jul 29, 2010 at 3:15 PM, Daniel Morissette
<dmorissette at mapgears.com> wrote:
> Martin Dobias wrote:
>>
>> I've updated the RFC to reflect your suggestions:
>>
>> http://trac.osgeo.org/gdal/wiki/rfc29_desired_fields
>>
>> Given that there has been no further discussion, can we mark the RFC
>> as proposed and start the voting?
>>
>
> Sorry if this comment comes late, but I didn't realize until now that
> the SetIgnoredFields() suggestion was the preferred choice in the end.
>
> Personally I find that SetIgnoredFields() is less natural and more
> error-prone than the original proposed SetDesiredFields(), so I would
> still prefer SetDesiredFields() even if it took me a bit of time to get
> used to the way it works in the beginning.
>
> If it was my RFC, I would have gone with a
>
> virtual OGRErr OGRLayer::SelectFields( const char **papszFields );
>
> which would work more or less like a SQL SELECT... and yes, you would
> need to specify OGR_GEOMETRY and OGR_STYLE explicitly if you want them,
> but as long as that's well documented that should not be a big deal
> (users of PostGIS always have to explicitly select the_geom in their
> queries and that doesn't seem to be a problem for them).

Hi Daniel

I don't mind either solution - either SelectFields or SetIgnoredFields.

But it is valid point that having to specify OGR_GEOMETRY and
OGR_STYLE explicit shouldn't hurt anyone (given that the fact will be
documented properly) and it is more "natural" to list fields the
clients needs instead of listing ones to be ignored.

Another reason for going with SelectFields instead of SetIgnoredFields
might be that in case a new special field OGR_FOO will be introduced
in future version, it will be ignored implicitly when using
SelectFields, while with SetIgnoredFields the client will have to
explicitly put it into the list.

Regards
Martin


More information about the gdal-dev mailing list