[mapserver-users] Scale dependent WCS

Marcin Grudzień mgrudzien7 at gmail.com
Fri Nov 20 09:39:01 PST 2020


Hi,

I published WCS service providing over 60 000 orthoimagery GeoTIFFs with a pixel size of 0.25 m or smaller. I am using MapServer 7.2.2 on Debian 10 stable with Postgis 12. The good thing is that the service works. 

However, in the typical use case scenario I want to connect and use the service in QGIS and this is where the problem starts. QGIS 3.10.11 after connecting to the service sends GetCoverage request with BBOX covering the full spatial extent of all connected orthoimagery sheets. MapServer tries to create an overview image out of over 60 000 individual images and eventually fails for obvious reasons. QGIS also freezes for around 60 seconds till the service timeout is reached. 

I tried to apply MAXSCALEDENOM, MAXGEOWIDTH and SCALETOKEN parameters to a map file to allow the user to download the data only starting from particular a rather large scale, but the parameters are not recognized by WCS (yet they work for WMS). Currently, as a workaround, I use MAXFEATURES parameter set to 10, yet it is not a nice solution because, in case of request covering large areas, it leads to image output with a bunch of empty spaces.

Is there any other way to limit the area for which WCS service sends a proper response (similarly to MAXSCALEDENOM in case of WMS service)?

This is part of my current, working map file.
LAYER
	NAME "Index_orthoimagery"
	STATUS OFF
	#MAXGEOWIDTH 0.001
	MAXFEATURES 10
	CONNECTIONTYPE POSTGIS
	CONNECTION "host=localhost dbname=postgis user=login password=pass port=5432"
        DATA "geom FROM (SELECT * FROM orto WHERE colour <> 'CIR' ORDER BY date ASC) AS subquery USING UNIQUE id USING SRID=2180"
	PROJECTION
		"init=epsg:2180"
	END
	TYPE POLYGON
	PROCESSING "CLOSE_CONNECTION=DEFER"
	#MAXSCALEDENOM 12099
END
LAYER
	NAME "Orthoimagery"
	STATUS OFF
	UNITS Meters
   	TILEINDEX "Index_orthoimagery"
        TILEITEM "url_zfs"
	METADATA
      		"wcs_label"           "Orthoimagery"  
      		"wcs_rangeset_name"   "RGB"  
      		"wcs_rangeset_label"  "Red Grean Blue" 
	  	"ows_srs" "EPSG:2180"
      		"wcs_extent" "160828.34326572 98928.8977745594 876029.97009323 796521.669409553"
	        "wcs_resolution" "0.1 0.1"
      		"wcs_bandcount" "3"
	  	"wcs_band_names" "R G B"
      		"wcs_formats" "GEOTIFF"
	  	"wcs_nativeformat" "24-bit GeoTIF"
      		"wcs_enable_request" "*"	  
	END
	TYPE RASTER
	PROJECTION
		"init=epsg:2180"
	END
END

Best regards,
Marcin


More information about the mapserver-users mailing list