<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16441" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=406413810-11052007><FONT face=Arial 
size=2>Hello,</FONT></SPAN></DIV>
<DIV><SPAN class=406413810-11052007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN 
class=406413810-11052007>O</SPAN>bjective<SPAN class=406413810-11052007> 
:</SPAN> put several SHP file<SPAN class=406413810-11052007>s</SPAN> as 
different layers&nbsp;<SPAN class=406413810-11052007>- attribute data being 
different - </SPAN>in<SPAN class=406413810-11052007>to</SPAN> a KML 
file.</FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial><SPAN 
class=406413810-11052007>Pb</SPAN>&nbsp;<SPAN class=406413810-11052007>:</SPAN> 
I cannot -append -update the KML file : "Unable to open existing 
output&nbsp;datasource '<SPAN 
class=406413810-11052007>out1</SPAN>.kml'".</FONT></FONT></DIV>
<DIV><SPAN class=406413810-11052007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>shp2kml.bat file is as follows :</FONT></DIV>
<DIV><FONT size=2><FONT face=Arial>ogr2ogr -s_srs EPSG:27572 -t_srs EPSG:4326 -f 
"KML"&nbsp;<SPAN class=406413810-11052007>out1</SPAN>.kml<SPAN 
class=406413810-11052007>&nbsp;in_1</SPAN>.shp -dsco NameField=<SPAN 
class=406413810-11052007>LABEL</SPAN> -nln&nbsp;<SPAN 
class=406413810-11052007>NewLayerName_1</SPAN></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT size=2>ogr2ogr -update -append -s_srs EPSG:27572 
-t_srs EPSG:4326 -f "KML"<SPAN 
class=406413810-11052007>&nbsp;out1</SPAN>.kml&nbsp;<SPAN 
class=406413810-11052007>in_</SPAN><SPAN class=406413810-11052007>2</SPAN>.shp 
-dsco NameField=<SPAN class=406413810-11052007>ID</SPAN> -nln&nbsp;<SPAN 
class=406413810-11052007>NewLayerName_2</SPAN></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT size=2>ogr2ogr -update -append -s_srs EPSG:27572 
-t_srs EPSG:4326 -f "KML"&nbsp;<SPAN 
class=406413810-11052007>out1</SPAN>.kml&nbsp;<SPAN 
class=406413810-11052007>in_</SPAN><SPAN class=406413810-11052007>3</SPAN>.shp 
-dsco NameField=<SPAN class=406413810-11052007>ID</SPAN> -nln&nbsp;<SPAN 
class=406413810-11052007>NewLayerName_3</SPAN></FONT></FONT></DIV>
<DIV><SPAN class=406413810-11052007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><FONT size=2><FONT face=Arial><SPAN class=406413810-11052007>What is</SPAN> 
wrong?</FONT></FONT></DIV>
<DIV><SPAN class=406413810-11052007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=406413810-11052007><FONT face=Arial size=2>The other option, 
merge several&nbsp;SHP files into 'out.shp' then convert it to&nbsp;'out2.kml', 
does not work either.</FONT></SPAN></DIV>
<DIV><SPAN class=406413810-11052007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=406413810-11052007><FONT face=Arial size=2>My shp2shp2kml.bat 
file is as follows :</FONT></SPAN></DIV>
<DIV><SPAN class=406413810-11052007><FONT face=Arial size=2>ogr2ogr -s_srs 
EPSG:27572 -t_srs EPSG:27572 -f "ESRI Shapefile" out.shp in_1.shp -nln 
NewLayerName_1<BR>ogr2ogr -update -append -s_srs EPSG:27572 -t_srs EPSG:27572 -f 
"ESRI Shapefile" out.shp in_2.shp -nln NewLayerName_2<BR>ogr2ogr -update -append 
-s_srs EPSG:27572 -t_srs EPSG:27572 -f "ESRI Shapefile" out.shp in_3.shp -nln 
NewLayerName_3<BR>ogr2ogr -s_srs EPSG:27572 -t_srs EPSG:4326 -f "KML" out2.kml 
out.shp</FONT></SPAN></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><SPAN class=406413810-11052007><FONT face=Arial size=2>ERROR 1: Failed to 
create file out.shp\NewLayerName_2.shp.</FONT></SPAN></DIV>
<DIV><SPAN class=406413810-11052007><FONT face=Arial size=2>ERROR 4: Failed to 
open Shapefile 'out.shp\NewLayerName_2.shp'.</FONT></SPAN></DIV>
<DIV><SPAN class=406413810-11052007><FONT face=Arial size=2>ERROR 1: Terminating 
translation prematurely after failed translation of layer 
in_2</FONT></SPAN></DIV>
<DIV><SPAN class=406413810-11052007><FONT face=Arial 
size=2>etc.</FONT></SPAN></DIV>
<DIV><SPAN class=406413810-11052007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=406413810-11052007><FONT face=Arial size=2>Also&nbsp;note 
that&nbsp;the -nln option does not replace the layer name from 'out' to 
'NewLayerName_%' whith the - f "ESRI Shapefile" option while it does with the -f 
"KML".</FONT></SPAN></DIV>
<DIV><SPAN class=406413810-11052007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Thank you for your help</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><SPAN style="FONT-STYLE: normal; mso-bidi-font-style: italic"><FONT 
face=Arial color=#202020 size=2>Philippe</FONT></SPAN></DIV></BODY></HTML>