Frank,<br><br>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:<br>
<br><br><pre>for( int iField = 0; iField &lt; poDefn-&gt;GetFieldCount(); iField++ )<br>{<br>  if (poDefn-&gt;GetFieldDefn(iField)-&gt;IsIgnored())<br>    continue;<br><br>  // fetch field<br>}<br><br>if (!poDefn-&gt;IsGeometryIgnored())<br>
{<br>  // fetch geometry field<br>}<br></pre><br><br>Best regards,<br><br>Tamas<br><br><br><div style="visibility: hidden; display: inline;" id="avg_ls_inline_popup"></div><style type="text/css">#avg_ls_inline_popup {  position:absolute;  z-index:9999;  padding: 0px 0px;  margin-left: 0px;  margin-top: 0px;  width: 240px;  overflow: hidden;  word-wrap: break-word;  color: black;  font-size: 10px;  text-align: left;  line-height: 13px;}</style><br>
<div class="gmail_quote">2010/7/29 Frank Warmerdam <span dir="ltr">&lt;<a href="mailto:warmerdam@pobox.com">warmerdam@pobox.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">Tamas Szekeres wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Martin,<br>
<br>
I didn&#39;t follow all conclusions made earlier in this thread, but I don&#39;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.<br>

</blockquote>
<br></div>
Tamas,<br>
<br>
Geometry is generally derived from the physical data source, and knowing<br>
that it can be ommitted can save substantial io and processing.  I must<br>
confess this is less obvious with regard to styles.  I can *imagine*<br>
styles being expensive to collect and form in some cases but I can&#39;t<br>
think of any existing driver collecting the style string is particularly<br>
expensive.<div><div></div><div class="h5"><br>
<br>
Best regards,<br>
-- <br>
---------------------------------------+--------------------------------------<br>
I set the clouds in motion - turn up   | Frank Warmerdam, <a href="mailto:warmerdam@pobox.com" target="_blank">warmerdam@pobox.com</a><br>
light and sound - activate the windows | <a href="http://pobox.com/%7Ewarmerdam" target="_blank">http://pobox.com/~warmerdam</a><br>
and watch the world go round - Rush    | Geospatial Programmer for Rent<br>
<br>
</div></div></blockquote></div><br>