ipyleaflet
ipyleaflet copied to clipboard
Querying ImageServer APIs that don't have WMS or tile servers
Would it be possible to build a class to query ESRI ImageServer APIs (similar to an ImageMapLayer within ESRI leaflet)? I am wishing to query the Reference Elevation Map of Antarctica (REMA) and ArcticDEM that are both available through ESRI. While ArcticDEM does have a hillshade map available through WMS, there are many more layers available through the ImageServer. As far as I can tell, the capability to query these servers is currently missing in ipyleaflet.
The procedure would be to build a querying string with the bbox
of the current map and a few parameters for the ImageServer API. I think it would be similar to the ImageOverlay class.
The complete list of parameters are:
-
'bbox'
: bounding box for reducing image -
'size'
: width and height of the output image -
'f'
: response format ('image'
streams the bytes directly) -
'format'
: image format (e.g.'png'
) -
'transparent'
: transparency -
'bboxSR'
: EPSG code of the bounding box -
'imageSR'
: EPSG code of the output image (here the leaflet map projection) -
'pixelType'
: data type of the raster image (e.g.'F32'
) -
'interpolation'
: method for interpolating to output -
'compressionQuality'
: lossy quality if using jpeg -
'bandIds'
: bands (and order of bands) to export -
'noData'
: pixel value representing no data -
'noDataInterpretation'
: how to interpret no data (all bands or single band) -
'renderingRule'
: rules (json) for rendering -
'mosaicRule'
: rules (json) for mosaicking -
'time'
: time instance or extent for image (unix time)
An example querying string is below.
https://elevation2.arcgis.com/arcgis/rest/services/Polar/AntarcticDEM/ImageServer/exportImage?bbox=-104.86324392412149%2C+-82.5699189540039%2C+-96.80920292433169%2C+-71.52713368167746&bboxSR=4326&imageSR=3031&format=png&pixelType=F32&f=image
which renders:
Hi @tsutterley, I see you added Esri Arctic and Antarctic Basemaps to xyzservices, nice! Did you manage to show them with ipyleaflet? You can have a look at #612 for more information about custom projections. But yes I think it could be interesting to query ESRI ImageServer APIs, that would allow to visualize a lot of new data. Would you like to open a PR? We can help you with the ipyleaflet code base.
Hi @davidbrochart, thanks!
Yes! I did get them working in ipyleaflet. I was working off #612 (which helped a lot), and ended up making EPSG3031 a Bunch
object containing the resolutions of the different tile layers. I also needed to change the projection names (where they were an EPSG code) to include the colon (e.g. 'EPSG:3031'
). I was planning on putting in a PR here with those changes once there was a new release of xyzservices.
For now, I'll open a PR to start with the ImageServer API work :+1:
Just looking at this, great work @tsutterley! I really like those ESRI basemaps.