[Gdal-dev] ogr2ogr PostgreSQL and INTERLIS issues

Andreas Neumann a.neumann at carto.net
Thu Oct 25 09:17:08 EDT 2007


ok - this worked fine. If I use the -nln flag with the schema prefix the
update in another schema works. Great!

Maybe one could add a remark at http://www.gdal.org/ogr/drv_pg.html that
in case of updating existing PostgreSQL tables in a schema other than
public, the "-nln schemaprefix.tablename" should be used. It would
probably help other people who have the same problem like me.

Question: can I use more than one layer in this case? Can I pass a
comma,separated list of layernames, or multiple -nln parameters? My first
tests seem to indicate, not, which is a bit unfortunate. But maybe I
overlooked something ...

Thanks for the hint,
Andreas

> Andreas Neumann wrote:
>>> It might well be a schema related issue.  Does the table show up as a
>>> layer for ogrinfo?  Perhaps it has a schema prefix, and the logic for
>>> seeing if a layer already exists does not recognise it because of the
>>> schema name?
>>
>> yes, the layer does show up with ogrinfo. It lists as follows:
>>
>> 262: av.Bodenbedeckung__BoFlaeche (Polygon)
>>
>> Maybe it is a problem with the prefix? When I specify the layer in the
>> ogr2ogr command, I don't specify the "av" prefix. Maybe it doesn't
>> recognize that the layernames "av.Bodenbedeckung__BoFlaeche" and
>> "Bodenbedeckung__BoFlaeche" are the same?
>>
>> Here is again my ogr2ogr command:
>>
>> 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=uster
>> user=myuser password=mypw host=localhost"
>> uster_dm01ZH24_BB.itf,dm01avzh24.ili Bodenbedeckung__BoFlaeche
>>
>> I tried the same command with "av.Bodenbedeckung__BoFlaeche" as
>> layername,
>> but then it just does nothing, maybe because the layername doesn't exist
>> with this name in the interlis model.
>
> Andreas,
>
> Perhaps you could try using "-nln av.Bodenbedeckung__BoFlaeche" on the
> commandline?
>
> 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    | President OSGeo, http://osgeo.org
>
>


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