Thanks Andrea for your response.  I tried your suggestion to add the CRS as an 
additional parameter to the BBOX function:   &CQL_FILTER=BBOX(the_geom, 48, 49, 
18, 19, 'EPSG:4326')

Unfortunately, it doesn’t seem to work either and I get the same complaint 
about not being able to cast to “ReferencedEnvelope”:

Caused by: org.geotools.data.DataSourceException: Unable to create this mosaic
        at 
org.geotools.gce.imagemosaic.RasterLayerResponse.prepareResponse(RasterLayerResponse.java:1387)
        at 
org.geotools.gce.imagemosaic.RasterLayerResponse.processRequest(RasterLayerResponse.java:1228)
        at 
org.geotools.gce.imagemosaic.RasterLayerResponse.createResponse(RasterLayerResponse.java:1194)
        at 
org.geotools.gce.imagemosaic.RasterManager.read(RasterManager.java:1125)
        at 
org.geotools.gce.imagemosaic.ImageMosaicReader.read(ImageMosaicReader.java:849)
        at 
org.geotools.gce.imagemosaic.ImageMosaicReader.read(ImageMosaicReader.java:828)
        at 
org.geoserver.catalog.SingleGridCoverage2DReader.read(SingleGridCoverage2DReader.java:146)
        at 
org.geoserver.catalog.CoverageDimensionCustomizerReader.read(CoverageDimensionCustomizerReader.java:200)
        at 
org.geoserver.catalog.CoverageDimensionCustomizerReader.read(CoverageDimensionCustomizerReader.java:190)
        at 
org.geoserver.wms.map.RenderedImageMapOutputFormat.readBestCoverage(RenderedImageMapOutputFormat.java:1296)
        at 
org.geoserver.wms.map.RenderedImageMapOutputFormat.directRasterRender(RenderedImageMapOutputFormat.java:861)
        ... 107 more
Caused by: java.lang.ClassCastException: com.vividsolutions.jts.geom.Envelope 
cannot be cast to org.geotools.geometry.jts.ReferencedEnvelope
        at 
org.geotools.gce.imagemosaic.Utils$BBOXFilterExtractor.visit(Utils.java:250)
        at org.geotools.filter.spatial.BBOXImpl.accept(BBOXImpl.java:216)
        at 
org.geotools.filter.visitor.DefaultFilterVisitor.visit(DefaultFilterVisitor.java:119)
        at org.geotools.filter.AndImpl.accept(AndImpl.java:65)
        at 
org.geotools.gce.imagemosaic.catalog.CachingDataStoreGranuleCatalog.getGranuleDescriptors(CachingDataStoreGranuleCatalog.java:152)
        at 
org.geotools.gce.imagemosaic.RasterManager.getGranuleDescriptors(RasterManager.java:1135)
        at 
org.geotools.gce.imagemosaic.RasterLayerResponse.prepareResponse(RasterLayerResponse.java:1336)
        ... 117 more

Any other suggestions?

--Steve

From: [email protected] [mailto:[email protected]] On Behalf Of Andrea 
Aime
Sent: Tuesday, September 02, 2014 11:03 PM
To: Stephen Brooke
Cc: Rahkonen Jukka (Tike); [email protected]
Subject: Re: [Geoserver-users] CQL Filter not working with BBOX function and 
ImageMosaic layer

On Tue, Sep 2, 2014 at 11:13 PM, Stephen Brooke 
<[email protected]<mailto:[email protected]>> wrote:
Jukka,  thanks for your response.  Yes, my aim is as you say, “to show a little 
bit less image data clipped with the BBOX in CQL_FILTER inside a bigger bbox 
that is defined by the basis WMS box” and be able to combine this with a 
temporal filter.

For an ImageMosaic that can be filtered by TIME and any other custom attributes 
I define using the CQL_FILTER parameter, it seems silly to me that the 
ImageMosaic plugin cannot also use the spatial information that it has created 
to take advantage of CQL_FILTER geometry functions to filter results based on a 
user-defined BBOX for example.

By the stack trace, it's evident that this use case was simply never 
considered, the code could
be expanded to care for it as well (a bounding box without the coordinate 
reference system
specification).

Looking at the (E)CQL parser code it seems to be possible to specify a CRS for 
the bounding
box, I guess in that case a ReferencedEnvelope will be created, worth a try: 
add a fifth parameter
in your BBOX filter, something like 'EPSG:4326', and see if that works.

My guess is that the store will work correctly only if the bbox is specified in 
the data native
coordinate system.

Cheers
Andrea


--
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.
==

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39  339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------
------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to