cinohub / libkml

Automatically exported from code.google.com/p/libkml
Other
0 stars 0 forks source link

update kml file #79

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
     I have a problem with libkml.Now I want to change something in a kml 
file with libkml. I saw the reference, kmlengine::ProcessUpdate maybe a 
good way. But all the functions about this need the object has a ID. So 
what can I do if the tag are all without ID?
    For example I want to add a coordinate in a <lineString>, and the 
<Placemark> or other parent tag which contain it are all without ID, is 
there any good way for me to handle it?
    I am a freshman with libkml, and this problem puzzled me for days, I 
hope you can help me .
    Thanks very very very much!

Original issue reported on code.google.com by jiangx...@gmail.com on 13 May 2009 at 2:33

GoogleCodeExporter commented 8 years ago
It is indeed correct that <Update> (and kmlengine::ProcessUpdate) require
the target object to have an id=.

But, even if you could use <Update> there is no functionality for appending
a coordinate to the <coordinates> in a <LineString>.

Assuming you can identify the given <Placemark>/<LineString> (search for it
using kmlengine::GetElementsById() or kmlengine::VisitFeatureHiearchy()) you
can certainly use kmldom::Coordinates::add_*() to append a new coordinate.

Hope that helps (changing this to an enhancement request).

Original comment by kml.b...@gmail.com on 14 May 2009 at 3:09