0

Scenario description:

  1. GIS data volume is tens of millions and requires the creation of multi-dimensional layers, using WTMS's tile cache for rendering
  2. Using the CQL_FILTER condition to filter data and render layers with specific conditions
  3. There are a large number of layers, and the creation and configuration of layers are batch processed using Java API calls

Problems that occurred: The boundary values of the layer are calculated by default based on the data source, without narrowing down the range according to the set CQL_FILTER condition, resulting in a large number of useless blank images occupying a lot of storage space in the cache slice and thus increasing the cache time

Expected solution: After setting CQL_FILTER, the layer boundary values can be recalculated. This function can be achieved by manually operating the geoserer management interface, but no solution was found through the API interface enter image description here

1 Answer 1

0

I suspect you will need to implement a recalculate option for the layer endpoint similar to the one found in the coverages and mosaics.

2
  • public void configureCQLFilter(String workspaceName, String storename, String layerName, String cqlFilter) throws IOException { //Modify the cqlFilter filtering conditions of the layer, recalculate the layer boundaries, and reset the layer boundary values String geoserverURL = this.url + "/rest/workspaces/"+workspaceName+"/datastores/"+storename+"/featuretypes/" + layerName + ".xml?recalculate=nativebbox,latlonbbox"; String xmlPayload = "<featureType><cqlFilter>"+cqlFilter+"</cqlFilter></featureType>"; sendRequest(geoserverURL, "PUT", xmlPayload);} Commented Apr 12 at 7:29
  • Thank you for inspiring me. I searched for recalculate in the source code and found the key interface and parameter settings Commented Apr 12 at 7:33

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.