2

Quick question on GeoServer image mosaics (using ImageMosaic plugin) with overlapping rasters: I’m filtering the WMS query by featureid and ideally the order in which the rasters are ‘stacked’ would be controlled by their appearance in the array of feature IDs I provide in the request (similar to the "LockRaster" mosaic rule in Esri mosaic datasets) So if I had a wms request with featureid=id1,id2, I’d get id1 raster over the id2 raster. and if I flipped the order to id2,id1, I’d get the opposite. Is there any way to do this?

I guess more precise terminology would be: how do I get granule sorting to follow featureid listing, as opposed to specifying a field name using the sortby option. Is there a way to allow the client to specify this ordering arbitrarily?

Here's what a request might look like: https://geoserverLocation.co/geoserver/store/ows?width=...&height=...&bbox=...&crs=...&format=image/png&request=GetMap&service=WMS&styles=&transparent=true&version=1.3.0&layers=...&featureid=layer.id1,layer.id2

including sortby=featureid results in the features being sorted by featureid, but as reflected in the table, not my arbitrary ordering in the request. I think this is expected behavior, but I'm wondering if there's a way to order granules arbitrarily using client-side input.

use case:

My app allows users to reorder the list of granules in the UI of a web app, I need to match the sorting order of granules with the (arbitrary) order set by the user. I'm able to do this using Esri backends (see LockRaster link above), but haven't quite found a way to do it in the open source side of things.

Perhaps there's a CQL way of doing this?

8
  • Welcome to Geographic Information Systems! Welcome to GIS SE! We're a little different from other sites; this isn't a discussion forum but a Q&A site. Your questions should as much as possible describe not just what you want to do, but precisely what you have tried and where you are stuck trying that. Please check out our short tour for more about how the site works
    – Ian Turton
    Commented Apr 26, 2022 at 7:47
  • did you try putting the featureid into the sort field?
    – Ian Turton
    Commented Apr 26, 2022 at 9:19
  • Thanks Ian, I've updated the question with some more details. The short answer is that providing a sort field appears to sort it based on the order of that field in the underlying table instead of the list of ids provided (I think this is expected behavior). So specifying featureid as the sort field doesn't work in this case.
    – Shane L
    Commented Apr 26, 2022 at 20:07
  • so can you order the granules in the order you need in the table?
    – Ian Turton
    Commented Apr 27, 2022 at 7:22
  • The desired order is arbitrary and decided at runtime by the user on the client side, so it's not something I can know in advance unfortunately.
    – Shane L
    Commented Apr 27, 2022 at 14:25

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.