0

I am trying to add an image generated with Python Datashader to Mapbox layers as an overlay (https://www.mapbox.com/mapbox-gl-js/example/image-on-a-map/).

However it results a misaligned layers like this (green is from Datashader, gray is from Mapbox)

I want to create the overlay image with geospatial axes by specifying EPSG like tf.shade(agg, epsg=3857)

Is there any way to do that?

Thank you.

thama
  • 51
  • 6
  • Datashader doesn't reproject your data, so if you want to end up with an image in epsg 3857 coordinates, first reproject your data into that coordinate system, *before* calling Datashader in the first place. You can use Cartopy for that. – James A. Bednar Oct 28 '18 at 16:00
  • (It's possible to reproject the regularly gridded image returned by Datashader, but that's very much not recommended if you can avoid it, because it will result in non-uniform sampling in the final image that can be distracting and misleading.) – James A. Bednar Oct 28 '18 at 16:02
  • I have just found a converting technique which uses gdal (I think this is the latter, not recommended approach you mentioned) and got a right aligned layers. I will try the recommended way. Thank you very much! – thama Oct 28 '18 at 16:13

1 Answers1

4

Datashader doesn't reproject your data, so if you want to end up with an image in epsg 3857 coordinates, first reproject your data into that coordinate system, before calling Datashader in the first place. You can use Cartopy for that.

I believe this comment is the precise answer so I am quoting this to close the post.

thama
  • 51
  • 6