[gdal-dev] Checking for a NULL value in a field using OGR

Xavi Almolda xavi.almolda+OGR at gmail.com
Thu Jun 12 12:16:01 EDT 2008


Thank you Tamas. This is exactly what I was looking for.

I wonder why this method does not appear in the documentation.

Regards,

Xavi

On Thu, Jun 12, 2008 at 5:34 PM, Tamas Szekeres <szekerest at gmail.com> wrote:
> You could probably use OGRFeature::IsFieldSet but I doubt if it is
> properly handled by the driver for the numeric fields.
>
> Best regards,
>
> Tamas
>
>
> 2008/6/12 Xavi Almolda <xavi.almolda+OGR at gmail.com>:
>> Hello,
>>
>> I am using OGR to read information from ESRI Shapefile files. I have a
>> problem with empty or null fields. I need to know when a value for a field
>> has not been set. Something like an isNull() or isSet() function.
>> For example, if I read a value as integer from a field that is empty, the
>> value returned is a 0. The same value is returned if the field has a value
>> of 0.
>>
>> Is there any way to check for these empty or not set field values using OGR
>> ?
>>
>> Thank you,
>>
>> Xavi
>>
>>
>> _______________________________________________
>> 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