[Gdal-dev] ntf to postgres tables

Frank Warmerdam warmerdam at pobox.com
Mon Dec 16 09:38:09 EST 2002


nida Khan wrote:
> I tried as you suggested, but again I'm getting same error...
> For Chreshire ntf file it said it can not open with any drivers
> 
> bash-2.05a$ ogr2ogr  PG:dbname=test -lco "LAUNDER=YES" CHRESHIRE_COUNTY.NTF
> FAILURE:

This is because the filename was spelled improperly.

> so I tried it with another ntf file.
> 
> bash-2.05a$ ogr2ogr -update PG:dbname=test -lco "LAUNDER=YES" TQ3281SE.NTF
> ERROR 1: AddGeometryColumn failed for layer LANDLINE99_POINT, layer creation
> has failed.
> ERROR 1: Terminating translation prematurely after failed
> translation of layer LANDLINE99_POINT
> 
> bash-2.05a$ ogrinfo TQ3281SE.NTF
> ERROR 4: NTF Driver doesn't support update.
> Had to open data source read-only.
> INFO: Open of `TQ3281SE.NTF'
> using driver `UK .NTF' successful.
> 1: LANDLINE99_POINT (Point)
> 2: LANDLINE99_LINE (Line String)
> 3: LANDLINE99_NAME (Point)
> 4: FEATURE_CLASSES (None)

OK, it turns out my previous assumptions were wrong.  The LAUNDER flag only
"launders" the field names, not the layer names.  You have to rename the
layers yourself:

ogr2ogr -update PG:dbname=test CHESHIRE_COUNTY.NTF \
          -lco "LAUNDER=YES" -nln bl2000_link BL2000_LINK

you will have to do a separate ogr2ogr command for each layer you want to
translate.  The "-nln" flag gives a name for the layer in the target
dataset.

Good luck,

-- 
---------------------------------------+--------------------------------------
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