[gdal-dev] problem with ogr2ogr

Even Rouault even.rouault at mines-paris.org
Mon Apr 27 14:09:45 EDT 2009


Yes, this is a "feature" of ogr2ogr. See 
http://trac.osgeo.org/gdal/ticket/2771 which is exactly the same behaviour 
your see.

The solution is to add "-nln out" at the end of your ogr2ogr commandline, as 
the name of your source dataset is "sssi" (because of sshi.shp) and the name 
of your destination layer is "out" (because of out.shp). ogr2ogr cannot find 
a layer in the destination dataset matching "sssi", then it tries to create a 
new layer called "sssi", but as "out.shp" already exists and is not a 
directory, it doesn't work... Logical, isn't it ?

Even

Le Monday 27 April 2009 17:36:51 Matthew Snape, vous avez écrit :
> Dear List,
>
>
>
> I am attempting to use ogr2ogr to append a shapefile to another
> shapefile.  However, when the -update parameter is included the
> incorrect source filename appears to be used.
>
>
>
> ogr2ogr -append  -update -select meta_type,meta_id,meta_name
> "C:/downloadworking/out.shp" "SSSI/sssi.shp"
>
>
>
> ERROR 1: Failed to create file .shp file.
>
> ERROR 4: Failed to open Shapefile `C:/downloadworking/out.shp\sssi.shp'.
>
>
>
> ERROR 1: Terminating translation prematurely after failed translation of
> layer sssi (use -skipfailures to skip errors)
>
>
>
> I am using latest FW Tools on XP.
>
>
>
> Any ideas?
>
>
>
> Thanks.
>
>
> This e-mail message and any attached file is the property of the sender and
> is sent in confidence to the addressee only. The contents are not to be
> disclosed to anyone other than the addressee. Unauthorised recipients are
> requested to preserve this confidentiality and to advise the sender
> immediately of any error in transmission. If you experience difficulty with
> opening any attachments to this message, or with sending a reply by email,
> please telephone on + 44-(0)1235 438151 or fax on + 44-(0)1235 438188. Any
> advice contained in this e-mail or any accompanying file attached hereto is
> for information purposes only. RPS do not take any responsibility for
> differences between the original and the transmission copy or any
> amendments made thereafter. If the addressee requires RPS to be responsible
> for the contents of this e-mail, RPS will be pleased to issue a signed hard
> copy of the document upon request.
> RPS Planning and Development Limited, company number: 02947164 (England).
> Registered office: Centurion Court, 85 Milton Park Abingdon Oxfordshire
> OX14 4RY. RPS Group Plc web link: <http://www.rpsgroup.com>




More information about the gdal-dev mailing list