Page 1 of 1

[closed] kml waypoint color

Posted: Mon Aug 18, 2014 11:06 am
by JohnL
I have a kml file from google maps with many waypoints of different colors. I would like to import or display it in AQ and preserve the color, or icon type. Is this possible ? I can write a script to convert if I know what to output. The kml file encodes the color here (I think) <styleUrl>#icon-503-DB4436</styleUrl>, but also sometimes as <color>ff000000</color>. With both occuring even within the same file exported from google maps.

When I display the kml file in AQ, the color information is currently lost. I was looking for some way to export AQ wpt files to kml so that I could see how the color is encoded, but could not find this.

Thanks, John

Re: kml waypoint color

Posted: Mon Aug 18, 2014 4:49 pm
by Psyberia-Support
AlpineQuest can read KML colours, both within styles (with <styleUrl>) or inline (with <color>). At least, all the KML files I have read until now worked fine, but it may exist particular cases not tested (see example below of the KML export of http://www.cablemap.info/).

To open a KML file, just click on it to load it. You can use the 'Display contents' button to display all items in the file at once (it may take some time).

If you don't succeed is displaying colours, it would be great if you can send me an example file (not containing any sensitive data), so I can have a look at it and check what's wrong. You can also check the apps log (main menu -> More... -> Report errors and then click on the file icon) to see is something is displayed (like colours failing to be decoded).

Best regards
device-2014-08-18-174154.jpg
(117.13 KiB) Downloaded 5268 times

Re: kml waypoint color

Posted: Mon Aug 18, 2014 6:52 pm
by JohnL
I accidentally sent the log. Anyway, I looked at it and there are no errors when displaying the kml file.
Just now, I made a google maps layer with two pins, one blue, one yellow. I exported it to kml. I opened
it with 'explore landmarks'. Both show in the correct position, with correct names, but both are purple,
like all the others. I am attaching the kml file. Thanks for the prompt repsonse!
John

Re: kml waypoint color

Posted: Mon Aug 18, 2014 8:12 pm
by Psyberia-Support
It seems the file hasn't been attached, could you send it by email? (http://www.alpinequest.net/#contact_and_support)

Re: kml waypoint color

Posted: Mon Aug 18, 2014 8:24 pm
by JohnL
Emailed it. Now I see it says "The extension kml is not allowed."

Re: kml waypoint color

Posted: Tue Aug 19, 2014 10:21 am
by Psyberia-Support
Thanks for the file.
So you're right the colours are not displayed.
I had a look, and this is because the colour styles are used before being defined (they're all defined at the end of the file).

Google Earth exports all styles at the beginning of the file, so it works fine, but Google Maps exports the styles at the end, although the KML specification suggests that the styles must be defined at the beginning:
If you define a Style at the beginning of a KML Document and also define an ID for it, you can use this style in Geometry, Placemarks, and Overlays that are defined elsewhere in the Document.
I'll try to improve the KML support to handle this case. Until it's done, the only way to display your colours is to somehow create a KML file with styles defined before being referenced (you may open your file with Google Earth and then export it again in KML).
Sorry about that.

Re: kml waypoint color

Posted: Tue Aug 19, 2014 3:45 pm
by JohnL
I had a presentiment that google was violating their own standard (well, not quite a standard) I will try with google earth, or something. Thanks for the investigation. John

Re: kml waypoint color

Posted: Tue Aug 19, 2014 3:56 pm
by JohnL
My google earth is broken (I use linux, so it is usually broken). I copied the style definitions to the front of the kml file by hand, and now the colors are displayed correctly by AQ. Thanks for the help.

Re: kml waypoint color

Posted: Tue Aug 19, 2014 4:17 pm
by Psyberia-Support
Ok thanks for the feedback.
I've made the changes, the next version will be able to use styles at the end of the files.
Best regards

Re: kml waypoint color

Posted: Sun Aug 23, 2015 1:56 pm
by Edd
I'm experiencing the same behaviour even when saving from google earth, not just google maps, is there a workaround please?

Re: kml waypoint color

Posted: Mon Aug 24, 2015 4:55 pm
by Psyberia-Support
Hi again,
The only workaround right now is to edit the file and put the styles at the beginning, but this is a bit technical.
As said above, the next version will handle these colors, unfortunately I cannot give you a release data right now.
Best regards