NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

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 '21, 12:19

Sertyhopss's gravatar image

Sertyhopss
16113
accept rate: 0%

edited 20 Nov '21, 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, 21:57

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

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 '21, 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 '21, 14:16) SK53 ♦

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:

×315
×85

question asked: 20 Nov '21, 12:19

question was seen: 2,718 times

last updated: 21 Nov '21, 14:16

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum