在python中使用openstreetmap [英] Drawing upon openstreetmap in python

查看:155
本文介绍了在python中使用openstreetmap的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要做的是使用python并使用openstreetmap切片作为背景来生成静态图像(例如png).

What I want to do is to generate a static image (e.g. a png) using python and using openstreetmap tiles as a background.

Mathplotlib和底图几乎是我想要的.问题是能够使用OSM切片作为背景.我对 http://stevendkay.wordpress.com/2010/02/24/plotting-points-on-an-openstreetmap-export/

Mathplotlib and Basemap is almost what I'm looking for. The problem is being able to use OSM tiles as background. I'm not pleased by the approach suggested in http://stevendkay.wordpress.com/2010/02/24/plotting-points-on-an-openstreetmap-export/

我找到的最接近的答案是此答案,但使用R,而不是python

The closest I found is in this answer but using R, and not python Plotting points from a data.frame using OpenStreetMap

我想念任何明显且简单的解决方案吗?

Did I miss any obvious and easy solution?

感谢您的帮助

这个问题暗示了很多工具,但是似乎没有一个符合我的需求

EDIT : this questions suggests many tools, but none seems to match my needs How can I display OSM tiles using Python?

推荐答案

您忽略了OSM网站上的导出"标签,该标签能够生成具有所需尺寸和地图范围的静态图像.看看 http://wiki.openstreetmap.org/wiki/Export

You overlooked the "Export" tab at the OSM website, which is capable of generating a static image with the dimensions and map extents you want. Have a look at http://wiki.openstreetmap.org/wiki/Export

请注意,生成静态映像是一个占用大量资源的过程,如果您进行大量请求或滥用此功能,OSM sysadmin会让您烦恼.不幸的是,这意味着如果您要尝试处理大量图像,则必须找到其他解决方案.

Please be advised that generating static images is a resource-intensive process, and the OSM sysadmins will frown upon you if you do a large number of requests or abuse this feature. Unfortunately this means you'll have to find another solution if you're trying to do lots of images.

顺便说一句,您在顶部绘制的数据已正确投影到EPSG:3857中,而不仅仅是原始纬度/经度坐标,对吗?大缩放级别时原始纬度/经度数据看起来会失真.

By the way, the data you're plotting on top is properly projected into EPSG:3857 and not just raw lat/lon coordinates, right? Raw lat/lon data will look distorted at large zoom levels.

这篇关于在python中使用openstreetmap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆