[gdal-dev] KML output fields

Christopher Condit condit at sdsc.edu
Fri Sep 26 19:21:09 EDT 2008


Hi Bruce-

The KML driver should behave as follows:

If you define a field using a creation option for NameField (the default
is "Name") then it will be written out as the "Name" element. Likewise
with "Description". You're saying that everything works fine using
ogr2ogr but when you try to create an OGR dataset programmatically you
get extra, empty "name" and "description" elements in the output? Can
you file a trouble ticket and include your input layer and code snippet
if possible?

-Chris

 

From: gdal-dev-bounces at lists.osgeo.org
[mailto:gdal-dev-bounces at lists.osgeo.org] On Behalf Of Clay, Bruce
Sent: Friday, September 26, 2008 10:53 AM
To: gdal-dev at lists.osgeo.org
Subject: [gdal-dev] KML output fields

 

When I use ogr2ogr to convert a shapefile to KML there are no "Name" or
"Description" fields in the output and all attributes are lined up.

 

When I try to create a KML file from my code and populate the data both
"Name" and "Description" fields are included in the output.

 

I have tried not a variety of things in the call to KML's
CreateDataSource

            Not setting any options (i.e. passing a NULL)

            Setting both to empty strings

CSLSetNameValue( ogrOptions, "NameField", "");

CSLSetNameValue( ogrOptions, "DescriptionField", "");

 

      Setting both to "None"

CSLSetNameValue( ogrOptions, "NameField", "None");

CSLSetNameValue( ogrOptions, "DescriptionField", "None");

 

 

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.  

 

I looked in the ogr2ogr.cpp and I do not see any parameters getting
passed into the call.

 

Does anyone have any idea what might be causing this?

 

Bruce

 

 

 

 
 
This message and any enclosures are intended only for the addressee.
Please  
notify the sender by email if you are not the intended recipient.  If
you are  
not the intended recipient, you may not use, copy, disclose, or
distribute this  
message or its contents or enclosures to any other person and any such
actions  
may be unlawful.  Ball reserves the right to monitor and review all
messages  
and enclosures sent to or from this email address.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20080926/a4a261de/attachment-0001.html


More information about the gdal-dev mailing list