Hello. I have a coordinates of a place and I want to get a corresponding section of map as an image. I know that it possible in Overpass Turbo ("Export" button), but can I do this from my code using Overpass API for Python?

asked 20 Nov, 12:19

Sertyhopss's gravatar image

Sertyhopss
113
accept rate: 0%

edited 20 Nov, 12:20


What overpass does when you export to an image, is to download individual tiles and place your query result on top. Since you do not seem to even need to export data, Overpass is the wrong tool. You can either download the individual tiles with Python and paste them together - see e.g. https://github.com/zverik/bigmap2 or https://github.com/geofabrik/GfStaticmap for inspiration in PHP - or you can use a hosted "Static map" service (https://wiki.openstreetmap.org/wiki/Static_map_images). Whichever you choose, understand that you are using someone else's computing resources for this, and that you cannot use this massively without causing harm. So before you publish something that you expect to be very widely used, check with the operators of the respective servers you are relying on.

permanent link

answered 20 Nov, 21:57

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
78.1k886911207
accept rate: 24%

Thank you for your answer. I want to use this for my bachelor's thesis and for only one city, without publishing the program. It contains a factor analysis of traffic accidents at intersections. I have the database which include coordinates of crashes, time, weather, information about cars etc. Also I want to add information about road: tile, priorities, traffic lights, max speed and maybe something else. Most of this information i can get using queries to Overpass API, but not tiles. Thanks for links, I'll see it.

(21 Nov, 08:50) Sertyhopss
1

@Serlyhopss I'd look at QGIS which can show tiles in the background (XYZ Tile layers) and pull data from OSM via Overpass-like queries (or just save the geojson from the queries). I do this all the time.

(21 Nov, 14:16) SK53 ♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×301
×81

question asked: 20 Nov, 12:19

question was seen: 108 times

last updated: 21 Nov, 14:16

powered by OSQA