[FWTools] ogr2ogr error

Frank Warmerdam warmerdam at pobox.com
Mon Sep 26 21:42:11 EDT 2005


On 9/26/05, Frances Collier <fcollier at preparedresponse.com> wrote:
>
>
>
> I need help with an ogr2ogr error. Through the FWTools Shell I am trying to
> execute the following:
>
>
>
> >ogr2ogr –update –append –f "PostgreSQL" "PG:dbname=dcmms host=localhost
> user=postgres password=password" Counties.shp

Frances,

I am assuming you are appending to an existing counties table in
postgres, is that correct?  I would suggest you pare the above down
a bit to:

  ogr2ogr -update -append "PG:dbname=dcmms ..." Counties.shp

You don't need the -f flag to specify the target format since you
are updating an existing database instance.

> I then get the following errors:
>
>
>
> ERROR 1: INSERT command for new feature failed.
>
> ERROR: numeric field overflow

Often it seems that shapefiles have .dbf files with fields that
do not honour the width and precision in the header.  That is
likely what is happening in your case.

If you are in a position to re-recreate your county table
I would suggest you add the "-lco PRECISION=NO".  This
will cause the floating point fields to be created with a
general floating point type instead of a fixed point type that
limits the range of values assignable.

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    | Geospatial Programmer for Rent



More information about the FWTools mailing list