[Gdal-dev] OGR can't handle Null values in a Date field

Frank Warmerdam warmerdam at pobox.com
Fri Jun 16 18:35:44 EDT 2006


Aaron Koning wrote:
> I have just started using a newer version of OGR that includes Date 
> support. (Context: I am importing shapefiles into PostgreSQL using 
> OGR/PHP). Unfortunately, when I there is a Null value in a Date field of 
> the input shapefile OGR bails (after successfully inserting non-null 
> values). From what I can see, it attempts to do an insert with a 
> '00/00/00 00:00:00' value and PostgreSQL states I may need another Date 
> type for this value.
> 
> Is there anyway of getting OGR to output Null values into a Date field 
> when there is a Null value present in the input Date field? 
> Alternatively, the previous versions of OGR simply converted Date fields 
> to strings. Is there a way to revive this action (when I set the output 
> field type to string instead of bool, it doesn't work).

Aaron,

Date fields are intended to support nulls.  Could you provide me
with a shapefile with some null dates I could test with?  I think there
is just a bug at some point in the code with null propogation in date fields.

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
and watch the world go round - Rush    | President OSGF, http://osgeo.org




More information about the Gdal-dev mailing list