[Geoserver-devel] KML icon service and icon sizes

Hi,
I was trying to reproduce the old KML icons used by marks in the previous KML generator with a CSS
style, and believe I more or less succeeded with this style:

(attachments)

image.png
icon.png
image.png

···
  • {
    mark: symbol(‘circle’), symbol(‘circle’);
    mark-size: 12, 4;
    }

:nth-mark(1) {
fill: red;
stroke: black;
stroke-width: 2;
}

:nth-mark(2) {
fill: black;
}

However, there is a gotcha. Here is how the map looks as plain WMS:

Inline image 2

and here is how it looks in KML instead:

Inline image 1

See how much bigger the icons are?
As far as I can see, the icon service itself generates them bigger, e…g, following the links
in the KML I get:

http://localhost:8080/geoserver/kml/icon/bugsites_kmlicon2?0.0.0=&0.0.1=

and then there is a 0.875 scale factor in the KML that fails to compensate for the extra large image
we’re getting…

Is there a reason for this, or can I just treat it like a bug?

Cheers
Andrea

PS: I’m completely weirded out as to how the icon is working in Google Earth… you see the
that the icon I get back misses the central black circle, and yet, if I pull the kml from curl,
http://localhost:8080/geoserver/sf/wms?service=wms&request=GetMap&version=1.1.1&format=application/vnd.google-earth.kml+xml&layers=sf:bugsites&styles=bugsites_kmlicon2&height=2048&width=2048&transparent=false&srs=EPSG:4326&format_options=SUPEROVERLAY:false;AUTOFIT:true;KMPLACEMARK:false;KMSCORE:40;KMATTR:true;MODE:refresh&bbox=-180,-90,180,90&featureid=bugsites.1

All I get is:

And that url for the icon just returns the icon I pasted above… how the heck is Google Earth displaying
the black small circle inside it too? I would have expected multiple icon styles, or a link that shows
both symbolizers stacked one on top of the other…
I see that to get the small black circle I have to use the
http://localhost:8080/geoserver/kml/icon/bugsites_kmlicon2?0.0.1=&0.0.1=

link instead, which provides as a result:

Inline image 1

But this url is nowhere to be found… what am I missing? :slight_smile:

Cheers
Andrea

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 180.0 0.0 1.5768778343115222E7 0.0 0.0 1.2742E7 clampToGround sf:bugsites -109.82683269631877 43.70755657411453 1.0231660993047602E7 0.0 0.0 8267718.75009163 clampToGround bugsites.1 <h4>bugsites</h4>

<ul class="textattributes">

<li><strong><span class="atr-name">cat</span>:</strong> <span class="atr-value">1</span></li>
<li><strong><span class="atr-name">str1</span>:</strong> <span class="atr-value">Beetle site</span></li>
</ul>


-103.86761147825553
44.38484141184452
0.0
0.0
0.0
0.0
clampToGround

0.875 0.0 [http://localhost:8080/geoserver/kml/icon/bugsites_kmlicon2?0.0.0=&0.0.1=](http://localhost:8080/geoserver/kml/icon/bugsites_kmlicon2?0.0.0=&0.0.1=) 0.0 0.0 0.0 00ffffff 0.0 -103.86761147825551,44.384841411844526