[postgis-users] shp2pgsql nulls

Andy Colson andy at squeakycode.net
Thu Sep 29 07:01:28 PDT 2011


On 9/29/2011 6:00 AM, Mark Cave-Ayland wrote:
> On 28/09/11 17:11, Andy Colson wrote:
>
>> Hi List,
>>
>> I have a shapefile and using ogr2ogr to reproject it, then shp2pgsql to
>> import it, but a date column has nulls in it and I'm getting invalid
>> date errors. If I dont use ogr2ogr the nulls import fine (the dest table
>> has nulls as well).
>>
>> It looks like ogr2ogr is using a newer version of shapelib and is
>> writing null fields a little bit differently? (I'm guessing here.) Would
>> it be possible to update shp2pgsql to a newer version of shapelib?
>>
>> -Andy
>
> Hi Andy,
>
> I think we'd need to have an example shapefile with a small sample of
> geometries to understand what's going on here. Also you didn't mention
> which version of shp2psql you are using, as there has been a lot of work
> done there in recent times.
>
>
> ATB,
>
> Mark.
>

Hey Mark, I may have guessed wrong.  I got a response from the gdal 
folk, who said "the null values for Date in this dbf file were 
indicated by a string filled with spaces".

Would still be neet if something could be done so shp2pgsql could import 
this.  The shapefile is 16 Meg, and uncompresses to 157 Meg, you can get 
it here:

http://squeakycode.net/parcelAnnoV2.zip

Version: is this what you are looking for?

RCSID: $Id: shp2pgsql-core.h 5983 2010-09-19 11:27:05Z mcayland $ 
RELEASE: 1.5 USE_GEOS=1 USE_PROJ=1 USE_STATS=1

-Andy




More information about the postgis-users mailing list