[Gdal-dev] ntf to postgres tables

Frank Warmerdam warmerdam at pobox.com
Fri Dec 13 12:00:24 EST 2002


nida Khan wrote:
> Hi,
> 
> first of all thank u very much for your reply...
> 
> I've got lated CVS and I tried to load postgres db with that command that
> you suggested.
> 
> I get this error
> ogr2ogr -update PG:dbname=test CHESHIRE_COUNTY.NTF
> 
> ERROR 1: AddGeometryColumn failed for layer BL2000_LINK, layer creation has
> failed.
> ERROR 1: Terminating translation prematurely after failed
> translation of layer BL2000_LINK
> 
> Is it cause its a line geo. or is it a bug?
> I can create a shp file for that layer and import in the db, but not like
> this.
> As the process dies after this error, I'm still unable to load dbf files :(.

Nida,

I believe this is a bug in the postgres AddGeometryColumn() implementation
that I have run into before with odd table names, such as those in upper case.
I patched my AddGemetryColumn SQL here, but for you the easiest solutions is
likely to use the OGR option to "launder" table and attribute fields names
into forms that don't require quoting in Postgres.

eg.

ogr2ogr -update PG:dbname=test -lco "LAUNDER=YES" CHRESHIRE_COUNTY.NTF

Let me know if this does not work.

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 Gdal-dev mailing list