TileSource with lat/lon data

Hi, I wanted to add my tile source to bokeh figure.
I started with OSM (http://c.tile.openstreetmap.org/{Z}/{X}/{Y}.png) and provided Tile classes:

fig.add_tile(tile)

fig.scatter(data.lon, data.lat)

  1. tile = BBoxTileSource(url, use_latlon=True)

data is shown no background tile is drawn.

  1. tile = TMSTileSource(url) or tile = WMTSTileSource(url)

data is shown and as background I get OSM ocean, which I guess it’s because it expects data in meters instead lat/lon coordinates.

Previously I was using leaflet, and there does not seem to be a problem with OSM tile and geojson data with lat/lon coordinates.

So is there some helper function, or do I have to transform my data to meters?

Thanks

This is what I have been using.

from pyproj import Proj, transform

from_proj = Proj(init=“epsg:4326”)

to_proj = Proj(init=“epsg:3857”)

x, y = transform(from_proj, to_proj, lon, lat)

···

On Friday, July 1, 2016 at 7:36:35 AM UTC-6, klo wrote:

Hi, I wanted to add my tile source to bokeh figure.
I started with OSM (http://c.tile.openstreetmap.org/{Z}/{X}/{Y}.png) and provided Tile classes:

fig.add_tile(tile)

fig.scatter(data.lon, data.lat)

  1. tile = BBoxTileSource(url, use_latlon=True)

data is shown no background tile is drawn.

  1. tile = TMSTileSource(url) or tile = WMTSTileSource(url)

data is shown and as background I get OSM ocean, which I guess it’s because it expects data in meters instead lat/lon coordinates.

Previously I was using leaflet, and there does not seem to be a problem with OSM tile and geojson data with lat/lon coordinates.

So is there some helper function, or do I have to transform my data to meters?

Thanks