question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to access data array inside gv.WMTS tiles

See original GitHub issue

@jsignell @ocefpaf

Working from a notebook…

import geoviews as gv
import holoviews as hv
hv.extension('bokeh')

lon = -121.8144
lat = 48.7767
dx  = dy = 0.01
url   = 'https://mt1.google.com/vt/lyrs=s&x={X}&y={Y}&z={Z}'

extents = (lon-dx, lat-dy, lon+dx, lat+dy)
tiles = gv.WMTS(url, extents=extents)
tiles

I’m trying to get access to the data array and coordinates inside the tiles object so that I can save it to geotif. Not sure if support for this is just built in so my plan was to pull out the data array and save it using rasterio, as suggested here https://github.com/pyviz/geoviews/issues/68.

Not seeing a method that lets me access the array. Maybe there is a hidden one that can be exposed?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jbednarcommented, Aug 30, 2019

Looks like contextily can be used precisely the way we are using Quest. Since it’s relatively simple to do it this way (grab bounding box, request data separately), there probably won’t be much enthusiasm for doing the work to do it directly in Bokeh, so I’ll close this for now.

0reactions
ocefpafcommented, Aug 30, 2019

I’m pretty sure that a Bokeh WMTS object never brings the underlying image data into Python at all; the JavaScript object just requests tiles from the webserver as needed and displays them in the browser.

Yep.

We do have an example of doing this (http://earthsim.pyviz.org/topics/GrabCut.html), but it uses an external system called Quest to fetch the tiles, paste them together, and select the appropriate region, once we select a region on the visible tiles.

This will probably make our life easier, thanks. For now contextily seems to do the job.

Read more comments on GitHub >

github_iconTop Results From Across the Web

pyviz/pyviz - Gitter
Hello every1 , i want to resctrict the area in my openstreetmap. so what change i have to make in below line to...
Read more >
datashader xarray.Image to holoviews Points - Stack Overflow
I tried to use the functionality already available in datashader, but I'm unable to figure out how I can convert the xarray.Image object...
Read more >
Is there an example to host datashader rasters as a tile server
Yes; see https://github.com/holoviz/datashader/blob/master/examples/tiling.ipynb . I don't think this example is linked or tested anywhere, ...
Read more >
Frequently Asked Questions | Mapbox Tiling Service
Both errors and warnings are arrays in the response data from the GET /jobs/<job_id> and GET /jobs endpoints. A tileset job will only...
Read more >
How to use the geoviews.WMTS function in geoviews - Snyk
WMTS examples, based on popular ways it is used in public projects. ... .com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{Z}/{Y}/{X}.jpg' wmts = gv.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found