【问题标题】:how to make a wind quiver plot on the geospatial map using plotly?如何使用 plotly 在地理空间地图上制作风颤图?
【发布时间】:2019-07-30 16:22:33
【问题描述】:

我有一系列带有 u/v 分量的风数据集,并尝试在地理空间地图上使用 plot.ly 将其作为颤动(风矢量)图。但是,我仍然很难做到这一点。有人可以帮我解决这个问题吗?

以下是我的代码

###- This is operating on Jupyter lab with dash extension
###- lon/lat/u/v are 2-D numpy array 

fig = ff.create_quiver(lon,lat,u,v,
                       scale=.25,
                       arrow_scale=.4,
                       name='quiver',
                       line=dict(width=1))

fig['layout'].update(title='Quiver Plot')
fig['layout'].update(geo=dict(
        resolution=50,
        scope='usa',
        showframe=False,
        showcoastlines=True,
        showland=True,
        landcolor="lightgray",
        countrycolor="white" ,
        coastlinecolor="white",
        projection=dict(type='equirectangular'),
        domain = dict(x=[0, 1], y=[ 0, 1])
))

app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
app.layout = html.Div(children=[
    html.H1(children='Hello Dash'),
    dcc.Graph(
        id='example-graph-0',
        figure=fig),
])

viewer.show(app)

【问题讨论】:

  • 我基本上问了同样的问题。 stackoverflow.com/questions/63053688/…你发现了吗?
  • 我当时放弃了,改回使用WMS服务。感谢您让我知道有更新。
  • 弗兰克感谢您的更新。通过找到箭头的尖端并在它们周围制作新的轨迹,我能够在我的地图上绘制箭头。我知道这很荒谬,但它确实有效。如果您对此感兴趣,我可以回答您的问题并向您展示详细信息
  • 拜托!!我想看看细节。
  • 我一有时间就去

标签: python-3.x geospatial plotly-dash jupyter-lab


【解决方案1】:

在保留箭头的地理位置的同时,您将无法在散点图框上使用注释。 See my solution 关于如何找到箭头点并将它们作为轨迹添加到地图中。 如果你有几条痕迹,甚至40-50条痕迹或箭头,性能就会直线下降。 不幸的是,这是一个已知的 plotly 问题,我认为它基本上没有用。

您可以查看其他地图 API,例如谷歌地图和苹果地图。我在 Angular 应用中测试了谷歌地图,性能非常好。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-10-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-10-12
    • 1970-01-01
    • 2021-01-26
    相关资源
    最近更新 更多