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

Tamas Szekeres szekerest at gmail.com
Thu Jul 29 15:10:12 EDT 2010


Frank,

If you refer to the OGR_GEOMETRY, OGR_GEOM_WKT, OGR_GEOM_AREA special
fields, both return a meaningful value (ie. an empty string) when the
geometry is null. In this regard it would be enough to disable only the
geometry column of that layer. However since the geometry column is not
necessarily be added to the field collection at OGRFeatureDefn, disabling
the geometry column might probably be set at OGRFeatureDefn while the others
at OGRFieldDefn in my suggested approach:


for( int iField = 0; iField < poDefn->GetFieldCount(); iField++ )
{
  if (poDefn->GetFieldDefn(iField)->IsIgnored())
    continue;

  // fetch field
}

if (!poDefn->IsGeometryIgnored())
{
  // fetch geometry field
}



Best regards,

Tamas



2010/7/29 Frank Warmerdam <warmerdam at pobox.com>

> Tamas Szekeres wrote:
>
>> Martin,
>>
>> I didn't follow all conclusions made earlier in this thread, but I don't
>> think it makes much sense to enable/disable the special fields since those
>> are derived from the attributes of the feature instead of fetching the
>> values physically from the data source. For example OGR_STYLE corresponds to
>> OGRFeature::GetStyleString() which can provide a meaningful value even if
>> the styles are not handled/supported by a particular driver.
>>
>
> Tamas,
>
> Geometry is generally derived from the physical data source, and knowing
> that it can be ommitted can save substantial io and processing.  I must
> confess this is less obvious with regard to styles.  I can *imagine*
> styles being expensive to collect and form in some cases but I can't
> think of any existing driver collecting the style string is particularly
> expensive.
>
>
> Best regards,
> --
>
> ---------------------------------------+--------------------------------------
> I set the clouds in motion - turn up   | Frank Warmerdam,
> warmerdam at pobox.com
> light and sound - activate the windows | http://pobox.com/~warmerdam<http://pobox.com/%7Ewarmerdam>
> and watch the world go round - Rush    | Geospatial Programmer for Rent
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20100729/e228c838/attachment.html


More information about the gdal-dev mailing list