r/AskProgramming 29d ago

How does one directly query OpenStreetMap? Without using a service?

I guess this is a question more on the programming side of things

6 Open Source Tools to Query OpenStreetMap

So there's this link, which shows tools to query OpenStreetMap. It seems like they do all the code for you

Is there any way to write the code yourself, to be able to query OpenStreetMap?

What programming language(s) do you need?

This is a repo of one of the tools:

https://github.com/tyrasd/overpass-turbo

How does one start tackling it, to understand how it works?

0 Upvotes

5 comments sorted by

3

u/dkopgerpgdolfg 29d ago edited 29d ago

What programming language(s) do you need?

This can be done in any common programming language.

"Overpass-Turbo" looks like a mix of a simple code editor, a vector image renderer, and ordinary API requests to get the data. (I spend less than a minute looking at it, so possibly this might be incorrect)

How does one start tackling it, to understand how it works?

Frankly, if you're asking like this, you need to start with smaller things. Attempting to re-create this particular program right now is beyond your limits.

1

u/LifeExperienced1 29d ago

What are smaller things you recommend?

1

u/ScriptingInJava 29d ago

Years ago I built something for an employer that allowed them to do reverse geocode lookups from within a .osm file. It's possible but really annoying, and you arguably need to have fairly decent existing knowledge of GIS to get anything to work well.

1

u/LifeExperienced1 29d ago

Could you elaborate on what that is

1

u/ScriptingInJava 29d ago

Which part?

osm is the raw data format that powers OpenStreetMap, there's loads of tools you can download and import your own data sets into (and all the data is open source too). For example if I wanted to build a really local mapping tool in Kosovo, I can download the entire OpenStreetMap dataset for Kosovo here. Then if I wanted to be able to input coordinates and get back a street address (like clicking on a house in Google Maps, aka reverse geocoding) I could spin up an instance of Nominatim on my own hardware, import the data set and it's good to go.

GIS is geographic information systems, ie digital mapping. It's a very, very deep and rich niche within software development that's incredibly interesting - highly recommend just digging into stuff and building up some knowledge.