Draw a map with gps markers and save this image to file

一笑奈何 提交于 2019-12-05 01:11:26

问题


I have some GPS position recordings, which I want to draw into a map (e.g. OpenStreetMap) and save this as an image file.

I'm using python. I've found osm-gps-map as a candidate library to do the visualization, but apparantly the API lacks some functionality to satisfy all of my needs. What I need is a library that does:

  • draw stuff into a map (e.g. an OSM-based map), i.e. a list of GPS positions.
  • automatically adjust view (scale/position) to fit in all drawn positions
  • save this view to an image file

I seriously want to avoid being forced to manually make a screenshot from a widget or a browser window. And if possible I also want to avoid to implement the necessary projection functionality by myself (as in here). Does anyone know a library/toolchain that provides the desired functionality (if possible for use by Python)?


回答1:


You may want to consider using Basemap for matplotlib. Here is a blog post describing how to use this package with OSM.




回答2:


There are examples of how to draw custom GPS points on top of OSM background map using Matplotlib Basemap, Matplotlib or Cairo in GeoTiler project: https://github.com/wrobell/geotiler/tree/master/examples.



来源:https://stackoverflow.com/questions/9482335/draw-a-map-with-gps-markers-and-save-this-image-to-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!