UNPKG

isochrone-explorer

Version:

A powerful isochrone and routing engine based on Dijkstra's algorithm for accurate travel time calculations.

23 lines (18 loc) 489 B
const axios = require('axios'); async function getOsmData(lat, lon) { const radius = 1000; const overpassApiUrl = 'https://overpass-api.de/api/interpreter'; const query = ` [out:json]; ( way["highway"](around:${radius},${lat},${lon}); >; ); out body; `; const response = await axios.post(overpassApiUrl, query, { headers: { 'Content-Type': 'text/plain' }, }); return response.data; } module.exports = { getOsmData };