GetValue doesn't return null

Description

Hi,

I think that MW5.Api.Concrete Featureset GetValue returns "0" when field is null.

Olivier

Environment

None

Activity

Show:
Paul Meems
January 5, 2017, 9:27 PM

In Ogr2Shape.cpp line 266 is CopyValues()
I think this function is responsible for adding the values to the buffer (which is an in-memory shapefile).

The function is using functions from GDAL like Feature->GetFieldAsInteger, Feature->GetFieldAsDouble and Feature->GetFieldAsString.
I've looked at the GDAL API documentation but nothing says how NULL values are handled.
I will ask on their mailinglist.

Paul Meems
January 6, 2017, 7:45 AM

The GDAL mailinglist replied:

Try Feature->IsFieldSet(...)
http://www.gdal.org/classOGRFeature.html#a7ad01c76b7b13bcf9eab5092aacac5fb
That should return false for null values.

I'll try to add it to the CopyValues() function.

Paul Meems
January 8, 2017, 1:56 PM

I fixed this issue in

When we release a new test version you can check if it is solved in your code as well.

Olivier Leprêtre
January 8, 2017, 2:21 PM

Yes, I will ! Thanks for the work done.

Olivier Leprêtre
January 9, 2017, 5:56 PM
Edited

Thanks very much, problem solved !

Assignee

Paul Meems

Reporter

Olivier Leprêtre

Labels

None

Fix versions

Affects versions

Priority

High
Configure