Sunday, 26 July 2015

qgis - Configure which bands to display from a 4-band ArcGIS image service?


The USDA (via the National Map) provides 4-band NAIP ArcGIS "ImageServer" (services) for most states in the US. I am able to successfully connect to the WMS service in QGIS as described here, which loads the imagery into QGIS using the default RGB (1,2,3) bands.


However, I'd like to change the imagery to display the CIR (bands 4,1,2). On the "Style" tab, the Render Type only offers the "Singleband color data" option, not the "Multiband color" option described in step 3.5 for typical rasters here. This appears to be a limitation of the WMS Service.


You can do this from the same service in ArcGIS Desktop using the REST endpoint. An ArcGIS Online webmap example of changing the bands of a service is available using the REST endpoint. Just go to the "..." on the layer, choose "Image Display" and then "User Defined Renderer".



UPDATE:


I've been playing around with the Developer Tools in Chrome and the ArcGIS.com map sample from here, and think I've found a small nugget of info. After I changed the image display settings, I noticed some query parameters set as:


https://gis.apfo.usda.gov/arcgis/rest/services/NAIP/Montana_2015_1m/ImageServer/exportImage?f=image&bandIds=3,0,1&bbox=...

After I changed the band ID's again, I realized that the bandID's in this query parameter are zero-based, instead of 1-based. Therefore &bandIds=3,0,1 are really referring to bands 4,1,2 used to display imagery in CIR format. So I just need to figure out how to configure the query string for QGIS to accept this parameter. Any thoughts?




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...