[Marble-devel] Differences in parsing style urls between marble and google earth

Amit Chaudhuri amit.k.chaudhuri at gmail.com
Fri Oct 12 16:27:50 UTC 2012


Hi all,

I am seeing some odd behaviour when loading kml files into an application
using the marble widget as compared to google earth.  The data source is at
www.cablemap.info with the kml file being downloadable from menu option top
right (GPLv3).  File is ~ 1M and contains placemarks and linestrings etc.

The file loads into Google Earth and shows > 200 cable systems as coloured
lines or varying widths using LineStrings and StyleUrls.

When I load the same kml file into my application using code below I see
the same systems but colours and line widths specified in the styleUrls are
not used.  I get what look like defaults (v. thin white lines).  Behaviour
is consistent on windows and linux (using Qt 4.7.4 and marble 1.2.2).

I'm pretty sure there is a difference in the way styleUrls and folders are
parsed between Google Earth & Marble.  If I replicate the styleUrls at the
very top of the document in the kml, rather than within some of the
enclosed folders, marble starts to use them.  Google is apparently less
fussy.

Interested in views on whether this is by design / known issue / something
that might get fixed etc.  Partly because there are > 200 such urls in the
particular kml file!  Probably more important is if this is not by design.
It might limit utility of kml files authored elsewhere to users of marble.

Loading code follows:

    QString filter = QString("*.kml");
    QString fileName =
QFileDialog::getOpenFileName(this,"caption",QString(),filter);
    if(fileName.isEmpty())
        return;


    MarbleModel *model = new MarbleModel(this);
    MarbleRunnerManager* manager = new MarbleRunnerManager(
model->pluginManager() ); // noticed that manager is not used

    QFileInfo fi(fileName);

    (*ui).MarbleWidget->model()->addGeoDataFile( fi.absoluteFilePath() );


Regards,

Amit
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/marble-devel/attachments/20121012/7f518f78/attachment.html>


More information about the Marble-devel mailing list