Ticket #2660 (closed defect: invalid)

Opened 5 years ago

Last modified 5 years ago

KML Driver Description problems

Reported by: condit Owned by: condit
Priority: normal Milestone:
Component: OGR_SF Version: unspecified
Severity: normal Keywords:
Cc: bclay@…

Description

I am using OGR to create both a shapefile and a KML file. The data in the shapefile looks good and the values in the KML are the same as in the shapefile but they are shifted up by 2 places. There are 2 extra attributes in the KML file (Name and Description). My “Longitude” value appears in the “Description” field.

I tried to use CSLSetNameValue( ogrOptions, "DescriptionField?", "None"); to eliminate the Description field but it did not work.

Is there any way to eliminate the Name and Description fields since I don’t have any values to set for them?

Change History

Changed 5 years ago by condit

  • owner changed from condit@… to condit

Changed 5 years ago by condit

  • cc bclay@… added

Changed 5 years ago by condit

Per Bruce's email:

I was doing some more testing and found a place where I added the name field apparently to keep Google Earth from displaying the Latitude. It looks like if there is not Name field then Google displays the first attribute it sees in the KML feature.

When I do the KML output I basically copy attributes (I call outputLayer->CreateFeature?( srcFeature ) from a shapefile layer to the KML layer but there is an extra field in the kml file.

Ogr2ogr gives the correct output without the extra fields so I need to see how that suppresses the extra fields.

Any thoughts would be greatly appreciated but I don't think it is in the shapefile or its driver. It probably is not in the KML driver either just something in the way I am calling it.

Changed 5 years ago by rouault

My email:

Bruce,

I think what you see is due to an inappropriate use of OGR API rather than a 
bug in OGR itself. I'd encourage you to browse that ticket 
http://trac.osgeo.org/gdal/ticket/2653 which is about GPX, but I think you're 
hitting the same scenario with KML as output.

Changed 5 years ago by rouault

  • status changed from new to closed
  • resolution set to invalid

Closing as invalid. Reopen if not.

Note: See TracTickets for help on using tickets.