-
Notifications
You must be signed in to change notification settings - Fork 363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add image service layers to address #932 #933
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat! Thanks!
f5d8a1b
to
508837a
Compare
bbc108c
to
7e2b068
Compare
7f1b56d
to
2291070
Compare
This comment was marked as resolved.
This comment was marked as resolved.
Thanks I'll try to find time to test this out and review :) |
Ok! I think this is at a good place for review. I needed to extend from a |
a3da296
to
e138882
Compare
The additional Polar projected WMS examples in CustomProjections.ipynb helped resolve an issue I had recently. |
Hi all. Wondering about status of this PR. @martinRenou, any other changes required? |
js/src/layers/ImageService.js
Outdated
// image server url | ||
url: '', | ||
// response format | ||
f: 'image', | ||
// output image format | ||
format: 'jpgpng', | ||
// data type of the raster image | ||
pixelType: 'UNKNOWN', | ||
// pixel value or list of pixel values representing no data | ||
noData: [], | ||
// how to interpret no data values | ||
noDataInterpretation: '', | ||
// resampling process for interpolating the pixel values | ||
interpolation: '', | ||
// lossy quality for image compression | ||
compressionQuality: '', | ||
// order of bands to export for multiple band images | ||
bandIds: [], | ||
// time instance or extent for image | ||
time: [], | ||
// rules for rendering | ||
renderingRule: {}, | ||
// rules for mosaicking | ||
mosaicRule: {}, | ||
// image transparency | ||
transparent: false, | ||
// endpoint format for building the export image url | ||
endpoint: '', | ||
// image service attribution | ||
attribution: '', | ||
// coordinate reference system | ||
crs: null, | ||
// emit when clicked or hovered | ||
interactive: false, | ||
// update interval for panning | ||
updateInterval: 200 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This a detail point but from an homogeneity point of view, description of the attributes are only set on the python side, in the docstrings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am wondering, if the layers from ImageService are also available in wmts (I think so if I am refering to their webpage https://enterprise.arcgis.com/en/image/latest/get-started/windows/what-is-an-image-service.htm) in such a way we could add them to the xyz-services
tilelayers provider used in ipyleaflet? This may be an alternative way of using the layers from ImageService
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @HaudinFlorence, great question. I wanted to put this PR together to address ImageService layers that do not have layers available from other services. This was the case for digital elevation model products from the Polar Geospatial Center (PGC), such as REMA and ArcticDEM. While ArcticDEM does have a WMS url for the gray hillshade layer, it doesn't for any other layer. REMA, unfortunately, is only available through ImageService queries. One of my colleagues suggested I just try to prompt PGC to add more services, but I thought as a first step it might be easier to add the same capabilities available through the DEM web applications to ipyleaflet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This a detail point but from an homogeneity point of view, description of the attributes are only set on the python side, in the docstrings.
Great point. I removed these comments in 93394bf
This looks neat!! @davidbrochart can you guys take a look and consider a merge? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot @tsutterley!
I commented mainly to have more explanation and understand better.
It's still not clear to me if the ImageService
is something only provided by ESRI, or if there are other providers.
Maybe @betolink can answer some questions too, as he knows quite a lot in this area!
examples/CustomProjections.ipynb
Outdated
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# note that we need to use the same projection for the our layer and the map.\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"# note that we need to use the same projection for the our layer and the map.\n", | |
"# note that we need to use the same projection for the layer and the map.\n", |
examples/ImageService.ipynb
Outdated
" return u'{0:d}\\u2013{1:d}'.format(st.tm_year,et.tm_year)\n", | ||
"\n", | ||
"range_dropdown1 = Dropdown(\n", | ||
" value=u'{0:d}\\u2013{1:d}'.format(1980,1989),\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
" value=u'{0:d}\\u2013{1:d}'.format(1980,1989),\n", | |
" value=range_formatter(years[0]),\n", |
examples/ImageService.ipynb
Outdated
"\n", | ||
"# watch year range function widget for changes\n", | ||
"range_dropdown1.observe(set_year_range)\n", | ||
"m1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No image is displayed for zoom 9 and years 1980-1989.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great point. I wasn't the happiest with this example so I removed it.
examples/ImageService.ipynb
Outdated
"outputs": [], | ||
"source": [ | ||
"# ArcticDEM\n", | ||
"# note that we need to use the same projection for the our image service layer and the map.\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"# note that we need to use the same projection for the our image service layer and the map.\n", | |
"# note that we need to use the same projection for the image service layer and the map.\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed 👍
examples/ImageService.ipynb
Outdated
" \"Height Orthometric\",\n", | ||
" \"Slope Map\"]\n", | ||
"raster_dropdown2 = Dropdown(\n", | ||
" value=\"Hillshade Gray\",\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
" value=\"Hillshade Gray\",\n", | |
" value=raster_functions[3],\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great change 👍
time: List, default [] | ||
time instance or extent for image | ||
rendering_rule: dict, default {} | ||
rules for rendering |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are possible values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great point. I added an enumerated list of possible values
ipyleaflet/leaflet.py
Outdated
mosaic_rule: dict, default {} | ||
rules for mosaicking | ||
transparent: boolean, default False | ||
If true, the image service will return images with transparency |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried setting transparent=True
but it doesn't seem to have any effect?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right... this appears to be defunct. I removed the option.
ipyleaflet/leaflet.py
Outdated
crs: dict, default ipyleaflet.projections.EPSG3857 | ||
Projection used for this image service. | ||
interactive: bool, default False | ||
Emit when clicked or hovered |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is emitted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a handler for click events when interactive
is True
👍
ipyleaflet/leaflet.py
Outdated
interactive: bool, default False | ||
Emit when clicked or hovered | ||
update_interval: int, default 200 | ||
Update interval for panning |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is updated? What is the unit of this value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great point. I expanded the description here. This is using L.Toggle
with units in ms
docs: add options to `format`, `pixel_type`, `no_data_interpretation` and `endpoint` feat: add function for handling mouse clicks refactor: remove columbia glacier example remove transparency option (defunct)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the branch is ready to be merged with a minor observation on the layer naming convention. This work will allow us to use more base layers in polar projections which has been needed for a long time! @davidbrochart @dshean
proj changes in notebook
425a1e2
to
0dbaaf3
Compare
Is there any particular thing @tsutterley needs for this PR @davidbrochart? I see just one change request but perhaps was already addressed? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot @tsutterley, this looks great!
Just some minor comments, but for me this is ready to merge.
Maybe @martinRenou wants to take a look?
ipyleaflet/leaflet.py
Outdated
format: string, default "jpgpng" | ||
format of exported image | ||
|
||
- ``jpgpng`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean:
- ``jpgpng`` | |
- `'jpgpng'` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
put the docstring edits in! thanks @davidbrochart
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But shouldn't it be:
`'jpgpng'`
instead of:
``"jpgpng"``
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are the docstrings in ipyleaflet rendered from markdown and not restructuredtext?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes you're right, I think it's reStructuredText 👍
ipyleaflet/leaflet.py
Outdated
- ``U4`` | ||
- ``U8`` | ||
- ``UNKNOWN`` | ||
no_data: list, default [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe:
no_data: list, default [] | |
no_data: List[int], default [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
This looks super nice thank you! |
Queries ESRI Image Service APIs and adds image layers similar to an
ImageOverlay
. Image Service APIs allow the creation of mosaics with options for pre-defined raster functions, interpolation strategies, band combinations, time ranges, etc.Additional updates to projections to add EPSG:5936 (Alaska Polar Stereographic) and more EPSG:3031 (Antarctic Polar Stereographic) options