[Gdal-dev] ogr2ogr PostgreSQL and INTERLIS issues

Andreas Neumann a.neumann at carto.net
Tue Oct 23 05:39:42 EDT 2007


Hello,

I am currently testing the import from Interlis survey data into
PostgreSQL and ran into some issues. I would appreciate any help I can get
on my problems.

* update problems:
this is probably a PostgreSQL/Postgis problem and not related to Interlis.
I have an existing table structure in Postgis (empty tables) and don't
want to recreate this table structure if I import data from Interlis. I
use the following command to import the data:

ogr2ogr -a_srs "EPSG:21781" -append -update -lco SCHEMA=av -lco DIM=2 -lco
LAUNDER=yes -lco GEOMETRY_NAME=the_geom -f "PostgreSQL" PG:"dbname=mydb
user=myuser password=mypw host=myhost"
uster_dm01ZH24_BB.itf,dm01avzh24.ili Bodenbedeckung__BoFlaeche

Despite my flags "append" and "update" ogr2ogr is trying to create a new
table. I get the following error message:

----------------------
ERROR 1: CREATE TABLE av."Bodenbedeckung__BoFlaeche" ( OGC_FID SERIAL,
CONSTRAINT "Bodenbedeckung__BoFlaeche_pk" PRIMARY KEY (OGC_FID) )
ERROR:  relation "Bodenbedeckung__BoFlaeche" already exists

ERROR 1: Terminating translation prematurely after failed
translation of layer Bodenbedeckung__BoFlaeche
-----------------------

I know that this table already exists, but why is it trying to recreate it
if I specify update and append?

* ili file required?
In Interlis, the model is specified in the ili file and the data in the
itf file. My assumption is that the ili file is only necessary in the case
when I need to create a new data model/table structure and not for
importing data into existing tables. Is this assumption wrong? When I try
to omit the ili file, ogr2ogr crashes with the following error message:

Segmentation fault (core dumped)

* temporary SQL files:
My assumption is that ogr2ogr somewhere creates temporary SQL files that
it is later feeding into PostgreSQL. Is that correct? Or is there a direct
connection to the database and not temporary SQL file? If I can find these
temporary SQL files I might be able to fix errors myself before loading
the SQL files into Postgis.

Thanks for any help on my issues,
Andreas

-- 
Andreas Neumann
Böschacherstrasse 6, CH-8624 Grüt/Gossau, Switzerland
Email: a.neumann at carto.net, Web:
* http://www.carto.net/ (Carto and SVG resources)
* http://www.carto.net/neumann/ (personal page)
* http://www.svgopen.org/ (SVG Open Conference)
* http://www.geofoto.ch/ (Georeferenced Photos of Switzerland)




More information about the Gdal-dev mailing list