Merged
Conversation
Member
|
LGTM. Thanks @fmaussion. I had noticed this was broken but hadn't figured out why yet. |
shoyer
approved these changes
Feb 2, 2018
| da = xr.open_rasterio('RGB.byte.tif') | ||
|
|
||
| # Normalize the image | ||
| da = da / 255 |
Member
There was a problem hiding this comment.
I don't think this is strictly necessary with RGB support in imshow, though I suppose it doesn't hurt.
doc/gallery/plot_rasterio_rgb.py
Outdated
|
|
||
| # Plot on a map | ||
| ax = plt.subplot(projection=crs) | ||
| da.plot.imshow(ax=ax, transform=crs) |
Member
There was a problem hiding this comment.
For pedagogical purposes, it might be nice to explicitly write rga='band'.
Member
|
OK, LGTM
…On Fri, Feb 2, 2018 at 10:57 AM Fabien Maussion ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In doc/gallery/plot_rasterio_rgb.py
<#1881 (comment)>:
> +
+import os
+import urllib.request
+import xarray as xr
+import cartopy.crs as ccrs
+import matplotlib.pyplot as plt
+
+# Download the file from rasterio's repository
+url = 'https://github.com/mapbox/rasterio/raw/master/tests/data/RGB.byte.tif'
+urllib.request.urlretrieve(url, 'RGB.byte.tif')
+
+# Read the data
+da = xr.open_rasterio('RGB.byte.tif')
+
+# Normalize the image
+da = da / 255
That's unfortunately necessary, see #1880
<#1880>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1881 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABKS1nkIbFX5Fez6jbcpsykDaC6_s1ZJks5tQ1pDgaJpZM4R3GRI>
.
|
Member
Author
|
Thanks! |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#1796 introduced a bug in the doc gallery. This PR reverts the code to the previous greyscale example and adds a new case using imshow (the use case is different, as I tried to explain in the descriptions).
I also took care of #1789 (comment) : the docs should now build even when rasterio is not installed.
cc @Zac-HD , @shoyer