我通过使用MySQL多项式在世界上的特定位置创建网格来计算地理密度。我在网格上使用地理空间索引,以便在运行MySQL st_contains命令时提高速度。这一切都很好但很慢,因为我使用1/1000度的分辨率。下面是使用Google Maps API折线绘制网格并根据使用st_contains找到的计数对网格着色的图。由于我需要完成整个世界,我需要为网格切换到更低的分辨率。
我尝试了以下Python绘图程序:pcolormesh,imshow,heatmap,scatter和contourf。我也看过使用Pythons griddata插值。我没有找到相当于在Google地图中绘制折线的东西。有什么建议吗?
答案 0 :(得分:0)
我的解决方案是在python中使用matplotlib的imshow创建“密度图”并将图像保存为png。最困难的部分是发现png图像周围有额外的空白区域。感谢stackoverflow.com Matplotlib plots: removing axis, legends and white spaces上的用户,我能够使用和删除多余的空白区域,因为我的图形被旋转了。
app.UseJwtBearerAuthentication(options =>
{
options.Authority = Configuration["Urls:IdentityServer"];
options.RequireHttpsMetadata = false;
options.Audience = Configuration["Urls:IdentityServer"] + "/resources";
options.AutomaticAuthenticate = true;
options.Events = new JwtBearerEvents
{
OnAuthenticationFailed = context =>
{
context.HandleResponse();
return Task.FromResult(0);
}
};
});
为了对图像进行地理定位并创建我的图块,我使用了https://developers.google.com/kml/articles/raster?hl=en
中的信息fig = mat.imshow(Zm,origin="lower",cmap='jet')
mat.axis('off')
fig.axes.get_xaxis().set_visible(False)
fig.axes.get_yaxis().set_visible(False)
mat.savefig('test_border.png', bbox_inches='tight', pad_inches = 0,edgecolor='none',transparent=True,dpi=DPI_OUTPUT)
现在,我只需要为世界上剩余的非陆地区域运行它......