<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.emailstyle17
        {mso-style-name:emailstyle17;
        font-family:"Arial","sans-serif";
        color:windowtext;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
 /* List Definitions */
 @list l0
        {mso-list-id:89664392;
        mso-list-type:hybrid;
        mso-list-template-ids:-1096545550 67698705 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
        {mso-level-text:"%1\)";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Hi Bruce-<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>The KML driver should behave as follows:<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>If you define a field using a creation option for NameField (the
default is &#8220;Name&#8221;) then it will be written out as the &#8220;Name&#8221; element. Likewise
with &#8220;Description&#8221;. You&#8217;re saying that everything works fine using ogr2ogr but
when you try to create an OGR dataset programmatically you get extra, empty &#8220;name&#8221;
and &#8220;description&#8221; elements in the output? Can you file a trouble ticket and
include your input layer and code snippet if possible?<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>-Chris<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
gdal-dev-bounces@lists.osgeo.org [mailto:gdal-dev-bounces@lists.osgeo.org] <b>On
Behalf Of </b>Clay, Bruce<br>
<b>Sent:</b> Friday, September 26, 2008 10:53 AM<br>
<b>To:</b> gdal-dev@lists.osgeo.org<br>
<b>Subject:</b> [gdal-dev] KML output fields<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>When
I use ogr2ogr to convert a shapefile to KML there are no &#8220;Name&#8221; or
&#8220;Description&#8221; fields in the output and all attributes are lined up.</span><o:p></o:p></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>&nbsp;</span><o:p></o:p></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>When
I try to create a KML file from my code and populate the data both &#8220;Name&#8221; and
&#8220;Description&#8221; fields are included in the output.</span><o:p></o:p></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>&nbsp;</span><o:p></o:p></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>I
have tried not a variety of things in the call to KML&#8217;s CreateDataSource</span><o:p></o:p></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Not setting any options (i.e. passing a NULL)</span><o:p></o:p></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Setting both to empty strings</span><o:p></o:p></p>

<p class=MsoNormal style='margin-left:.5in;text-indent:.5in'><span
style='font-size:10.0pt;font-family:"Courier New"'>CSLSetNameValue( ogrOptions,
<span style='color:maroon'>&quot;NameField&quot;</span>, <span
style='color:maroon'>&quot;&quot;</span>);</span><o:p></o:p></p>

<p class=MsoNormal style='margin-left:.5in;text-indent:.5in'><span
style='font-size:10.0pt;font-family:"Courier New"'>CSLSetNameValue( ogrOptions,
<span style='color:maroon'>&quot;DescriptionField&quot;</span>, <span
style='color:maroon'>&quot;&quot;</span>);</span><o:p></o:p></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span><o:p></o:p></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Setting both to &#8220;None&#8221;</span><o:p></o:p></p>

<p class=MsoNormal style='margin-left:.5in;text-indent:.5in'><span
style='font-size:10.0pt;font-family:"Courier New"'>CSLSetNameValue( ogrOptions,
<span style='color:maroon'>&quot;NameField&quot;</span>, <span
style='color:maroon'>&quot;None&quot;</span>);</span><o:p></o:p></p>

<p class=MsoNormal style='margin-left:.5in;text-indent:.5in'><span
style='font-size:10.0pt;font-family:"Courier New"'>CSLSetNameValue( ogrOptions,
<span style='color:maroon'>&quot;DescriptionField&quot;</span>, <span
style='color:maroon'>&quot;None&quot;</span>);</span><o:p></o:p></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span><o:p></o:p></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span><o:p></o:p></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>None
of the above will remove the 2 fields from the output KML as a result all real
attribute values are sifted up 2 places. &nbsp;</span><o:p></o:p></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span><o:p></o:p></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>I
looked in the ogr2ogr.cpp and I do not see any parameters getting passed into
the call.</span><o:p></o:p></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span><o:p></o:p></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>Does
anyone have any idea what might be causing this?</span><o:p></o:p></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span><o:p></o:p></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>Bruce</span><o:p></o:p></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span><o:p></o:p></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>&nbsp;</span><o:p></o:p></p>

<p class=MsoNormal style='margin-left:.5in;text-indent:.5in'>&nbsp;<o:p></o:p></p>

<pre><o:p>&nbsp;</o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>This message and any enclosures are intended only for the addressee.&nbsp; Please&nbsp; <o:p></o:p></pre><pre>notify the sender by email if you are not the intended recipient.&nbsp; If you are&nbsp; <o:p></o:p></pre><pre>not the intended recipient, you may not use, copy, disclose, or distribute this&nbsp; <o:p></o:p></pre><pre>message or its contents or enclosures to any other person and any such actions&nbsp; <o:p></o:p></pre><pre>may be unlawful.&nbsp; Ball reserves the right to monitor and review all messages&nbsp; <o:p></o:p></pre><pre>and enclosures sent to or from this email address.<o:p></o:p></pre></div>

</body>

</html>