您的问题对于您到底要做什么有点含糊,代码示例将有助于提供更好的答案。
通常,当尝试绘制从在线资源获得的地理数据时,您将拥有坐标系 (WGS84) 中的数据,其中纬度为 y,经度为 x。 Bokeh 可以简单地通过在 ColumnDataSource 中指定适当的名称来绘制经度和纬度。
from bokeh.io import show
from bokeh.models import ColumnDataSource
from bokeh.plotting import figure
longitude = [44.990961]
latitude = [41.552164]
source = ColumnDataSource(data=dict(longitude=longitude, latitude=latitude))
p = figure(plot_width=400, plot_height=400)
p.circle(x='longitude', y='latitude', source=source)
show(p)
如果您的问题确实与数据的坐标变换有关,那么如果没有更多详细信息,将很难回答您的问题。我建议您查看https://en.wikipedia.org/wiki/Map_projection 以了解地图投影。
如果您需要将经度/纬度坐标转换为不同的坐标系。您可以使用pyproj 包。
import pyproj
project_projection = pyproj.Proj("+init=EPSG:4326") # wgs84
google_projection = pyproj.Proj("+init=EPSG:3857") # default google projection
longitude = [44.990961]
latitude = [41.552164]
x, y = pyproj.transform(google_projection, project_projection, longitude, latitude)
print(x, y)
参考谷歌投影Google map api v3 projection?