-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
What is the bug?
We trust ogrmerge to just merge the KML that has been handed to it.
Alas, it wipes out the entire
<Style id="randomColorIcon">
<IconStyle>
<color>ff00ff00</color>
<colorMode>random</colorMode>
<scale>3</scale>
<Icon>
<href>http://maps.google.com/mapfiles/kml/pal3/icon21.png</href>
</Icon>
</IconStyle>
</Style>
section.
What's even more nefarious is that other styles aside from IconStyle survive. And of course it all depends on -f LIBKML. If one uses -f KML even more damage is done.
Steps to reproduce the issue
Here's your sample file,
https://developers.google.com/kml/documentation/kmlreference#example_7
Run ogrmerge on it.
Versions and provenance
ogrmerge --version
GDAL 3.9.3, released 2024/10/07
Additional context
Yes, this will have to wait until LIBKML supports Iconstyle I suppose.
But in the meantime promenet warnings that something has been wiped out should be emitted and documented.
I mean it currently makes plenty of
Warning 1: The output driver does not natively support DateTime type for field timestamp. Misconversion can happen. -mapFieldType can be used to control field type conversion.
but not a peep about it running off with that style declaration.
What's worse, during testing I thought I could trust it, as my LineStyles sailed through unscathed. Little did I know that it had a special diet...
Oh well, looks like I'll have to merge my KML by hand from now on.
I mean some people want to merge some KMLs that were made by other programs.
Perhaps it could just close its eyes and just merge it without censoring it.
https://gis.stackexchange.com/a/37221/77230 I suppose is not safe either.
OK, I made a workaround:
mr.gz