[Gdal-dev] ntf to postgres tables

nida Khan nida at webstar.co.uk
Fri Dec 13 11:46:54 EST 2002


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 :(.

Any sugg.
Kind Regards
Nida.



> >
> > I have recently started using ogr2ogr. It works fine, but I have some
> > confusion and hoping that anyone can shade the light.
> > here r the steps I follow.
> >
> > first I use ogrInfo on ntf file,
> > ogrInfo blah.ntf
> > 1: BL2000_LINK (Line String)
> > 2: BL2000_POLY (None)
> > 3: BL2000_COLLECTIONS (None)
> > 4: FEATURE_CLASSES (None)
> >
> > ogr2ogr <directory name> blah.ntf  BL2000_LINK
> >
> > this generate .shp,.dbf,shx and .prj  files in the directory
> > now I use shp2pgsql to create dump file.
> >
> > confusion comes when I run the ogr2ogr command against a layer with  no
> > geo. type
> > it only creates a .dbf and .prj file.
> > how do I import these files in postgres?
> > I think these layers contain other features realted to first geo. layer.
> >
>
> Nida,
>
> Layers without geometries are represented as just a .dbf file by the
shapefile
> writer.  These are just not supported by shp2pgsql, though there might
well
> be other .dbf loaders for PostgreSQL available from somewhere.
>
> I should warn you that the UK NTF driver does not assemble the line
geometries
> to create polygons or collections.  It just attaches the ids of the
geometries
> in question as an attribute on the poly and collection features.  In other
> environments (FME) further processing steps take care of assembling the
> polygons.
>
> However, you can still load the geometry-less layers if you use a build of
> OGR with direct PostGIS support.  For example, the following command will
> load all the layers of HALTON.NTF directly into a PostGIS enabled database
> named 'test'.
>
> eg.
>
> ogr2ogr -update PG:dbname=test HALTON.NTF
>
> To check if you have a PostGIS ogr build you can just type "ogr2ogr"
> to list the support formats.  If you see '-f "PostgreSQL"' the it is
> built-in.
>
> One more caveat.  In testing this case I discovered a couple of bugs in
> OGR's PG driver which I have fixed.  One of those bugs precludes loading
> tables without geometries into PostGIS!  I would suggest you wait for
> a new daily CVS snapshot and work from that.
>
> 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
>
>
> _______________________________________________
> Gdal-dev mailing list
> Gdal-dev at remotesensing.org
> http://remotesensing.org/mailman/listinfo/gdal-dev




More information about the Gdal-dev mailing list