<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Hi,
<div class="">
<div class="">During a kml export, from a shp, I have many tags that do not interest me and that I would like to delete.</div>
<div class="">I cannot find the information if it is possible via a parameter in the ogr2org program.</div>
</div>
<div class=""><br class="">
</div>
<div class=""><span style="caret-color: rgb(16, 16, 16); color: rgb(16, 16, 16); font-family: Monaco; font-size: 10px; background-color: rgba(255, 255, 255, 0.85098);" class="">ogr2ogr -f KML output.kml input.shp</span></div>
<div class=""><br class="">
</div>
<div class="">Ex:</div>
<div class="">
<div class=""><i class=""><?xml version="1.0" encoding="utf-8" ?></i></div>
<div class=""><i class=""><kml xmlns="<a href="http://www.opengis.net/kml/2.2" class="">http://www.opengis.net/kml/2.2</a>"></i></div>
<div class=""><i class=""><Document id="root_doc"></i></div>
<div class=""><i class=""><Schema name="gbl_0_0" id="gbl_0_0"></i></div>
<div class=""><i class=""><span class="Apple-tab-span" style="white-space:pre"></span><SimpleField name="DN" type="int"></SimpleField></i></div>
<div class=""><i class=""></Schema></i></div>
<div class=""><i class=""><Folder><name>gbl_0_0</name></i></div>
<div class=""><i class="">  <Placemark></i></div>
<div class=""><i class=""><span class="Apple-tab-span" style="white-space:pre"></span><Style><LineStyle><color>ff0000ff</color></LineStyle><PolyStyle><fill>0</fill></PolyStyle></Style></i></div>
<div class=""><i class=""><span class="Apple-tab-span" style="white-space:pre"></span><ExtendedData><SchemaData schemaUrl="#gbl_0_0"></i></div>
<div class=""><i class=""><span class="Apple-tab-span" style="white-space:pre"></span><SimpleData name="DN">0</SimpleData></i></div>
<div class=""><i class=""><span class="Apple-tab-span" style="white-space:pre"></span></SchemaData></ExtendedData></i></div>
<div class=""><i class="">      <LineString><coordinates>-180,90 -168.75,90.0 -168.75,78.75 -180.0,78.75 -180,90</coordinates></LineString></i></div>
<div class=""><i class="">  </Placemark></i></div>
<div class=""><i class="">  <Placemark></i></div>
<div class=""><i class=""><span class="Apple-tab-span" style="white-space:pre"></span><Style><LineStyle><color>ff0000ff</color></LineStyle><PolyStyle><fill>0</fill></PolyStyle></Style></i></div>
<div class=""><i class=""><span class="Apple-tab-span" style="white-space:pre"></span><ExtendedData><SchemaData schemaUrl="#gbl_0_0"></i></div>
<div class=""><i class=""><span class="Apple-tab-span" style="white-space:pre"></span><SimpleData name="DN">0</SimpleData></i></div>
<div class=""><i class=""><span class="Apple-tab-span" style="white-space:pre"></span></SchemaData></ExtendedData></i></div>
<div class=""><i class="">      <LineString><coordinates>-180,90 -168.75,90.0 -168.75,78.75 -180.0,78.75 -180,90</coordinates></LineString></i></div>
<div class=""><i class="">  </Placemark></i></div>
<div class=""><i class="">  <Placemark></i></div>
<div class=""><i class=""><span class="Apple-tab-span" style="white-space:pre"></span><Style><LineStyle><color>ff0000ff</color></LineStyle><PolyStyle><fill>0</fill></PolyStyle></Style></i></div>
<div class=""><i class=""><span class="Apple-tab-span" style="white-space:pre"></span><ExtendedData><SchemaData schemaUrl="#gbl_0_0"></i></div>
<div class=""><i class=""><span class="Apple-tab-span" style="white-space:pre"></span><SimpleData name="DN">0</SimpleData></i></div>
<div class=""><i class=""><span class="Apple-tab-span" style="white-space:pre"></span></SchemaData></ExtendedData></i></div>
<div class=""><i class="">      <LineString><coordinates>-180,90 -168.75,90.0 -168.75,78.75 -180.0,78.75 -180,90</coordinates></LineString></i></div>
<div class=""><i class="">  </Placemark></i></div>
<div class=""><i class=""></Folder></i></div>
<div class=""><i class=""></Document></kml></i></div>
</div>
<div class=""><br class="">
</div>
<div class="">1 - I don't know why I have the triplicate entries ... Surely my input.shp from QGIS, I must be doing something wrong, but I can correct this via this (which was given to me):</div>
<div class=""><br class="">
</div>
<div class="">
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85098);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">gawk 'BEGIN{PROCINFO["sorted_in"]="@val_num_asc"}/LineString/{A[$0]=NR;next}{A[NR ":" $0]=NR}END{for (i in A) { sub(/^[0-9]+:/,"",i); print i }}' input.kml | gsed '/<Placemark>/{:bc;N;s/\/Placemark>/&/;tcc;bbc;:cc;/LineString/!d;}’
 >input_simp.kml</span></div>
</div>
<div class=""><br class="">
</div>
<div class="">which gives me :</div>
<div class="">
<div class=""><i class=""><?xml version="1.0" encoding="utf-8" ?></i></div>
<div class=""><i class=""><kml xmlns="<a href="http://www.opengis.net/kml/2.2" class="">http://www.opengis.net/kml/2.2</a>"></i></div>
<div class=""><i class=""><Document id="root_doc"></i></div>
<div class=""><i class=""><Schema name="gbl_0_0" id="gbl_0_0"></i></div>
<div class=""><i class=""><span class="Apple-tab-span" style="white-space:pre"></span><SimpleField name="DN" type="int"></SimpleField></i></div>
<div class=""><i class=""></Schema></i></div>
<div class=""><i class=""><Folder><name>gbl_0_0</name></i></div>
<div class=""><i class="">  <Placemark></i></div>
<div class=""><i class=""><span class="Apple-tab-span" style="white-space:pre"></span><Style><LineStyle><color>ff0000ff</color></LineStyle><PolyStyle><fill>0</fill></PolyStyle></Style></i></div>
<div class=""><i class=""><span class="Apple-tab-span" style="white-space:pre"></span><ExtendedData><SchemaData schemaUrl="#gbl_0_0"></i></div>
<div class=""><i class=""><span class="Apple-tab-span" style="white-space:pre"></span><SimpleData name="DN">0</SimpleData></i></div>
<div class=""><i class=""><span class="Apple-tab-span" style="white-space:pre"></span></SchemaData></ExtendedData></i></div>
<div class=""><i class="">      <LineString><coordinates>-180,90 -168.75,90.0 -168.75,78.75 -180.0,78.75 -180,90</coordinates></LineString></i></div>
<div class=""><i class="">  </Placemark></i></div>
<div class=""><i class=""></Folder></i></div>
<div class=""><i class=""></Document></kml></i></div>
</div>
<div class=""><i class=""><br class="">
</i></div>
<div class=""><span style="font-style: normal;" class="">2 - </span>And we arrive at what is the object of my question, which is to know if via a parameter of ogr2ogr it is possible that it does not write these lines</div>
<div class="">
<div class=""><i class=""><Schema name="gbl_0_0" id="gbl_0_0"></i></div>
<div class=""><i class=""><span class="Apple-tab-span" style="white-space:pre"></span><SimpleField name="DN" type="int"></SimpleField></i></div>
<div class=""><i class=""></Schema></i></div>
</div>
<div class=""><i class=""><br class="">
</i></div>
<div class=""><span style="font-style: normal;" class="">and</span></div>
<div class=""><i class=""><br class="">
</i></div>
<div class=""><i class="">
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span><ExtendedData><SchemaData schemaUrl="#gbl_0_0"></div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span><SimpleData name="DN">0</SimpleData></div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span></SchemaData></ExtendedData></div>
</i></div>
<div class=""><span style="font-style: normal;" class=""><br class="">
</span></div>
<div class=""><span style="font-style: normal;" class="">which would give me a kml like this</span></div>
<div class="">
<div style="font-style: italic;" class=""><?xml version="1.0" encoding="utf-8" ?></div>
<div style="font-style: italic;" class=""><kml xmlns="<a href="http://www.opengis.net/kml/2.2" class="">http://www.opengis.net/kml/2.2</a>"></div>
<div style="font-style: italic;" class=""><Document id="root_doc"></div>
<div style="font-style: italic;" class=""><Folder><name>gbl_0_0</name></div>
<div style="font-style: italic;" class="">  <Placemark></div>
<div style="font-style: italic;" class=""><span class="Apple-tab-span" style="white-space:pre"></span><Style><LineStyle><color>ff0000ff</color></LineStyle><PolyStyle><fill>0</fill></PolyStyle></Style></div>
<div style="font-style: italic;" class="">      <LineString><coordinates>-180,90 -168.75,90.0 -168.75,78.75 -180.0,78.75 -180,90</coordinates></LineString></div>
<div style="font-style: italic;" class="">  </Placemark></div>
<div style="font-style: italic;" class=""></Folder></div>
<div style="font-style: italic;" class=""></Document></kml></div>
<div style="font-style: italic;" class=""><br class="">
</div>
<div class="">I know it is possible to do it via sed but if I can do without this step it would be a plus</div>
</div>
<div class=""><br class="">
</div>
<div class="">Thanks</div>
</body>
</html>