jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • GeoServer
  • GEOS-1999

SLD's <Size> tag does not affect Placemark elements

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 1.7.0-beta1
  • Fix Version/s: None
  • Component/s: Google Earth KML Output
  • Labels:
    None

Description

The KML returned by GeoServer can be in two forms: Placemark or Overlay elements. The Overlay element displays scaled point graphics as described by the SLD, but the Placemark elements are not scaled and all placemark elements are the same size.

(i.e. the KML is missing the <IconStyle><scale> tag that would scale the placemark)

Here is an example SLD that returns a variable size point symbol...

<?xml version="1.0" encoding="iso-8859-1"?>
<StyledLayerDescriptor version="1.0.0" xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!-- a named layer is the basic building block of an sld document -->
<NamedLayer>
<Name>Object Tracking Style</Name>
<UserStyle>
<!-- they have names, titles and abstracts -->
<Title>Object Tracking Style</Title>
<Abstract>A style that symbolizes point objects that are being tracked</Abstract>
<!-- FeatureTypeStyles describe how to render different features -->
<!-- a feature type for points -->
<FeatureTypeStyle>
<!-FeatureTypeName>Feature</FeatureTypeName->
<Rule>
<Name>Rule Default</Name>
<Title>Default Rule</Title>
<Abstract>Default Rule</Abstract>
<!-- like a linesymbolizer but with a fill too -->
<PointSymbolizer>
<Graphic>
<ExternalGraphic>
<OnlineResource xlink:type="simple" xlink:href="http://maps.google.com/mapfiles/kml/shapes/donut.png" />
<Format>image/png</Format>
</ExternalGraphic>
<Mark>
<Fill>
<CssParameter name="fill">#FF0000</CssParameter>
<CssParameter name="fill-opacity">1.0</CssParameter>
</Fill>
</Mark>
<Size>
<ogc:Mul>
<ogc:PropertyName>location_horiz_error</ogc:PropertyName>
<ogc:Literal>0.1</ogc:Literal>
</ogc:Mul>
</Size>
</Graphic>
</PointSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>

Here is an example KML that is returned by geoserver (that is missing a <scale> element...

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.2">
<Document>
<name>KmlFile</name>
<Style id="GeoServerStylev_observation.nfm-e769109_11aa6554706_-5628">
<IconStyle>
<Icon>
<href>http://maps.google.com/mapfiles/kml/shapes/donut.png</href>
</Icon>
</IconStyle>
</Style>
<Placemark id="v_observation.nfm-e769109_11aa6554706_-5628">
<description><![CDATA[<h4>v_observation</h4>

<ul class="textattributes">
<li><strong><span class="atr-name">observation_id</span>:</strong> <span class="atr-value">1904</span></li>
<li><strong><span class="atr-name">datestamp</span>:</strong> <span class="atr-value">6/19/08 12:01 AM</span></li>

<li><strong><span class="atr-name">location_horiz_error</span>:</strong> <span class="atr-value">500.0</span></li>
<li><strong><span class="atr-name">location_vert</span>:</strong> <span class="atr-value"></span></li>
<li><strong><span class="atr-name">location_vert_error</span>:</strong> <span class="atr-value"></span></li>
<li><strong><span class="atr-name">direction</span>:</strong> <span class="atr-value"></span></li>
<li><strong><span class="atr-name">speed</span>:</strong> <span class="atr-value"></span></li>
<li><strong><span class="atr-name">observation_type_no</span>:</strong> <span class="atr-value">0</span></li>
<li><strong><span class="atr-name">temp_object_id</span>:</strong> <span class="atr-value">1</span></li>
</ul>]]></description>
<LookAt>
<longitude>6.83558117478245</longitude>
<latitude>4.60914294994307</latitude>
<altitude>0</altitude>
<range>700</range>
<tilt>10</tilt>
<heading>10</heading>
</LookAt>
<TimeStamp><when>2008-06-19T00:01:00-04:00</when>
</TimeStamp>
<styleUrl>#GeoServerStylev_observation.nfm-e769109_11aa6554706_-5628</styleUrl>
<Point>
<coordinates>6.83558117,4.60914295,0</coordinates>
</Point>
</Placemark>
</Document>
</kml>

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Arne Kepp added a comment - 22/Jun/08 11:46 AM

I think what you are saying is that icons are always 32 pixels wide (scale slightly as you zoom in) ?

Google actually deprecated the support for specifying the icon size, so the only way I know is to make 32x32 transparent PNGs (I recommend 8 bit, it doesn't do the alpha channel properly) and just use the center of the image if you want something smaller.

Show
Arne Kepp added a comment - 22/Jun/08 11:46 AM I think what you are saying is that icons are always 32 pixels wide (scale slightly as you zoom in) ? Google actually deprecated the support for specifying the icon size, so the only way I know is to make 32x32 transparent PNGs (I recommend 8 bit, it doesn't do the alpha channel properly) and just use the center of the image if you want something smaller.
Hide
Permalink
Tyler Erickson added a comment - 22/Jun/08 5:52 PM

It looks like the <geomScale> tag was deprecated, but the <scale> tag is valid. The tag is listed in the KML 2.2 reference.
(http://code.google.com/apis/kml/documentation/kmlreference.html#scale)
as well as the OGC KML spec (12.8.3.1 kml:scale)

Show
Tyler Erickson added a comment - 22/Jun/08 5:52 PM It looks like the <geomScale> tag was deprecated, but the <scale> tag is valid. The tag is listed in the KML 2.2 reference. (http://code.google.com/apis/kml/documentation/kmlreference.html#scale) as well as the OGC KML spec (12.8.3.1 kml:scale)

People

  • Assignee:
    Andrea Aime
    Reporter:
    Tyler Erickson
Vote (1)
Watch (1)

Dates

  • Created:
    20/Jun/08 11:17 AM
    Updated:
    22/Jun/08 5:52 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.