# OpenStreetMap and Overpass Queries

> Leverage OpenStreetMap data and Overpass API queries to extract geospatial intelligence, identify infrastructure, and geolocate targets using open map datasets.

- **URL:** https://hackindex.io/platforms/osint/geolocation-and-imagery-intelligence/street-level-and-map-intelligence/openstreetmap-and-overpass
- **Path:** OSINT > Geolocation & Imagery Intelligence > Street-Level and Map Intelligence
- **Up:** [Street-Level and Map Intelligence](https://hackindex.io/platforms/osint/geolocation-and-imagery-intelligence/street-level-and-map-intelligence.md)
- **Published:** 2026-08-10
- **Updated:** 2026-08-10

## Overview

OpenStreetMap is a structured, queryable database of the physical world, not just a rendered map. Every feature carries tags describing what it is, and the Overpass API lets you ask precise questions such as list every fuel station within 500 metres of this point or find all surveillance cameras on this street. This turns a coordinate into a described environment and helps confirm a location by the features that should surround it.

- **Nominatim geocoding** converts between place names and coordinates in both directions for quick address resolution.
- **Overpass QL queries** find any tagged feature type (fuel stations, cameras, bus stops, hotels) within a radius of a coordinate.
- **Location confirmation** tests a hypothesis by querying surrounding features and checking whether the spatial arrangement matches the target image.
- **Overpass Turbo** provides an interactive front-end for building and visualising queries before scripting them.

## Geocoding with Nominatim

Nominatim converts between place names and coordinates in both directions. Forward geocoding turns an address into a coordinate, reverse geocoding turns a coordinate into the nearest named address and feature.

```bash
curl -s "https://nominatim.openstreetmap.org/reverse?lat=$LAT&lon=$LON&format=jsonv2" -H "User-Agent: research" | jq '{display_name, category, type, address}'
# {
#   "display_name": "Eiffel Tower, 5, Avenue Anatole France, ...",
#   "category": "tourism",
#   "type": "attraction",
#   "address": { "city": "Paris", "country": "France", "postcode": "75007" }
# }
```

## Overpass Queries Around a Point

Overpass QL queries the live OSM database. This example returns every fuel station within 500 metres of a coordinate, which is exactly the kind of surrounding-feature check that confirms or refutes a suspected location:

```
[out:json][timeout:25];
node(around:500,$LAT,$LON)[amenity=fuel];
out body;
```

Run it against the public endpoint from the command line and parse the results:

```bash
curl -s -G "https://overpass-api.de/api/interpreter" --data-urlencode 'data=[out:json];node(around:500,$LAT,$LON)[amenity=fuel];out body;' | jq '.elements[] | {name: .tags.name, lat, lon}'
```

The same pattern locates any tagged feature. Swap the tag filter to match what is visible in the target image:

```
[amenity=place_of_worship]   # churches, mosques, temples
[man_made=surveillance]       # cameras
[shop=supermarket]            # named supermarket chains
[tourism=hotel]               # hotels
[highway=bus_stop]            # bus stops
```

The interactive Overpass Turbo web front-end is the fastest way to build and visualise these queries before scripting them.

## Confirming a Location by Its Surroundings

Use OSM to test a hypothesis rather than to find a location cold. If the target image shows a church next to a supermarket across from a bus stop, query each feature type around the suspected coordinate and check the spatial arrangement matches. A layout that fits strengthens the geolocation, one that cannot exist rules the spot out.

## OpSec Note

The public Overpass and Nominatim endpoints enforce rate limits and require a descriptive User-Agent. Heavy automated querying will be throttled or blocked, and Nominatim's usage policy caps bulk use. For sustained work, run a local Overpass instance or a self-hosted Nominatim rather than hammering the shared servers.

## References

- [Overpass Turbo](https://overpass-turbo.eu/) - Interactive front-end for building and visualising Overpass QL queries.
- [OpenStreetMap Map Features](https://wiki.openstreetmap.org/wiki/Map_features) - Reference for OSM tags used to filter features in Overpass queries.
- [Nominatim API](https://nominatim.org/release-docs/latest/api/Overview/) - Forward and reverse geocoding between place names and coordinates.
