[Geoserver-devel] [jira] Created: (GEOS-1480) KML raster reprojection issues

KML raster reprojection issues
------------------------------

                 Key: GEOS-1480
                 URL: http://jira.codehaus.org/browse/GEOS-1480
             Project: GeoServer
          Issue Type: Bug
          Components: WMS
    Affects Versions: 1.6.0-beta4
            Reporter: Andrea Aime
            Assignee: Andrea Aime
             Fix For: 1.6.x

Given the following request:

{code}
http://localhost:8080/geoserver/wms?bbox=590010.0,4914020.0,609000.0,4928000.0&styles=&Format=kml&request=GetMap&layers=sf:dem&width=800&height=552&srs=EPSG:26713
{code}

Current code emits:

{code}
<?xml version="1.0" encoding="UTF-8"?>
<kml>
   <Folder>
      <name>layer_0</name>
      <description>sf:dem</description>
      <GroundOverlay>
         <name>sf:dem</name>
         <drawOrder>0</drawOrder>
         <Icon>
            <href>http://localhost:8080/geoserver/wms?service=wms&amp;srs=EPSG:26713&amp;width=800&amp;styles=A boring default style&amp;height=552&amp;transparent=false&amp;bbox=590010.0,4914020.0,609000.0,4928000.0&amp;request=GetMap&amp;layers=sf:dem&amp;format=kml&amp;version=1.1.1</href>
            <viewRefreshMode>never</viewRefreshMode>
            <viewBoundScale>0.75</viewBoundScale>
         </Icon>
         <LatLonBox>
            <north>44.50150740520348</north>
            <south>44.37306719251394</south>
            <east>-103.62940950313539</east>
            <west>-103.8706551765675</west>
         </LatLonBox>
      </GroundOverlay>
   </Folder>
</kml>
{code}

The way the wms request is rebuilt in WMSRequests (heavily used in all kml code) assumes the style title is equal to the style id, but it's not in general (look above, "a borign default style" instead of "raster", the default style for sf:dem).

What's worse, it's not easy to fix. Even using the raw request like I did in the OpenLayers output format won't fully work, because this time we have to extract a request for a single layer.
What if the original request used SLD_BODY or sld=xxx in "map definition" mode? We would have to parse those and rebuild them, exposing the altered sld somewhere (since we need to build and sld with a single layer).

Since SLD objects are loaded into memory in the current catalog, a quick solution would be to scan the styles for object identity, this would tell
if the looked upon style is in the catalog, and we could simply refuse to handle &sld and &sldbody. Of course this won't scale when the user has thousands of styles (like, for example, massgis does).

Alternatively, for &sldbody we can go for a full rewrite or it with just the relevant parts and it should fit a GET request (since we are going to shrink the style anyways, at least theoretically, we have to fix the sld encoder to not emit default values for all element).
For &sld we would need some kind of extra service call or extra parameter that would take the original sld and consider only the sub-part of it
that's relevant to a specified layer (&sld_layer_filter=sf:dem).

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira