Mapeo de Infraestructura con OSM
Resumen
Patrón OSINT para descubrir y mapear infraestructura del mundo real (torres, antenas, subestaciones, tuberías, vías) usando datos de OpenStreetMap via Overpass API.
Cuándo usar
- Mapear infraestructura de telecomunicaciones (antenas, torres)
- Visualizar red eléctrica (subestaciones, líneas de alta tensión)
- Análisis de infraestructura crítica de una zona
- Dashboard de infraestructura con datos abiertos
Patrón de uso
// Query Overpass API para infraestructura específica
async function fetchInfrastructure(bbox, type) {
const query = `
[out:json][timeout:25];
(
node["power"="tower"](${bbox});
node["power"="substation"](${bbox});
way["power"="line"](${bbox});
node["man_made"="communications_tower"](${bbox});
node["telecom"="data_center"](${bbox});
);
out geom;
`;
const response = await fetch('https://overpass-api.de/api/interpreter', {
method: 'POST',
body: 'data=' + encodeURIComponent(query)
});
return response.json();
}
// bbox: south,west,north,east
const infra = await fetchInfrastructure('40.3,-3.8,40.5,-3.6', 'power');
// Renderizar en Leaflet
infra.elements.forEach(el => {
if (el.type === 'node') {
L.circleMarker([el.lat, el.lon], {
radius: 5,
fillColor: getInfraColor(el.tags),
fillOpacity: 0.8
}).addTo(map).bindPopup(formatPopup(el.tags));
} else if (el.type === 'way' && el.geometry) {
const latlngs = el.geometry.map(g => [g.lat, g.lon]);
L.polyline(latlngs, { color: '#f97316', weight: 2 }).addTo(map);
}
});
function getInfraColor(tags) {
if (tags.power === 'substation') return '#dc2626';
if (tags.power === 'tower') return '#f97316';
if (tags.man_made === 'communications_tower') return '#2563eb';
return '#6b7280';
}
Tags OSM de infraestructura
| Categoría |
Tags |
Ejemplo |
| Eléctrica |
power=tower, power=substation, power=line |
Torres de alta tensión |
| Telecom |
man_made=communications_tower, telecom=* |
Antenas, data centers |
| Agua |
man_made=pipeline, pipeline=water |
Tuberías, depósitos |
| Gas |
man_made=pipeline, pipeline=gas |
Gasoductos |
| Ferroviaria |
railway=rail, railway=station |
Vías, estaciones |
Pitfalls
- Overpass rate limits: Máximo 2 queries/minute. Cachear resultados.
- Bbox grande: Queries muy grandes pueden timeout. Dividir en tiles.
- Datos incompletos: OSM no tiene toda la infraestructura. Verificar con fuentes oficiales.
- Sensibilidad: Infraestructura crítica puede tener datos limitados en OSM por seguridad.
Referencias
Hecho con ❤️ por David Antizar
1---2name: osm-infrastructure-mapping3description: Motor OSINT para mapear infraestructura del mundo real desde datos OpenStreetMap. Inspirado en ni5arga/sightline (⭐496). Descubre, mapea y visualiza infraestructura crítica.4---56# Mapeo de Infraestructura con OSM78## Resumen910Patrón OSINT para descubrir y mapear infraestructura del mundo real (torres, antenas, subestaciones, tuberías, vías) usando datos de OpenStreetMap via Overpass API.1112## Cuándo usar1314- Mapear infraestructura de telecomunicaciones (antenas, torres)15- Visualizar red eléctrica (subestaciones, líneas de alta tensión)16- Análisis de infraestructura crítica de una zona17- Dashboard de infraestructura con datos abiertos1819## Patrón de uso2021```javascript22// Query Overpass API para infraestructura específica23async function fetchInfrastructure(bbox, type) {24 const query = `25 [out:json][timeout:25];26 (27 node["power"="tower"](${bbox});28 node["power"="substation"](${bbox});29 way["power"="line"](${bbox});30 node["man_made"="communications_tower"](${bbox});31 node["telecom"="data_center"](${bbox});32 );33 out geom;34 `;35 36 const response = await fetch('https://overpass-api.de/api/interpreter', {37 method: 'POST',38 body: 'data=' + encodeURIComponent(query)39 });40 return response.json();41}4243// bbox: south,west,north,east44const infra = await fetchInfrastructure('40.3,-3.8,40.5,-3.6', 'power');4546// Renderizar en Leaflet47infra.elements.forEach(el => {48 if (el.type === 'node') {49 L.circleMarker([el.lat, el.lon], {50 radius: 5,51 fillColor: getInfraColor(el.tags),52 fillOpacity: 0.853 }).addTo(map).bindPopup(formatPopup(el.tags));54 } else if (el.type === 'way' && el.geometry) {55 const latlngs = el.geometry.map(g => [g.lat, g.lon]);56 L.polyline(latlngs, { color: '#f97316', weight: 2 }).addTo(map);57 }58});5960function getInfraColor(tags) {61 if (tags.power === 'substation') return '#dc2626';62 if (tags.power === 'tower') return '#f97316';63 if (tags.man_made === 'communications_tower') return '#2563eb';64 return '#6b7280';65}66```6768## Tags OSM de infraestructura6970| Categoría | Tags | Ejemplo |71|-----------|------|---------|72| Eléctrica | `power=tower`, `power=substation`, `power=line` | Torres de alta tensión |73| Telecom | `man_made=communications_tower`, `telecom=*` | Antenas, data centers |74| Agua | `man_made=pipeline`, `pipeline=water` | Tuberías, depósitos |75| Gas | `man_made=pipeline`, `pipeline=gas` | Gasoductos |76| Ferroviaria | `railway=rail`, `railway=station` | Vías, estaciones |7778## Pitfalls7980- **Overpass rate limits:** Máximo 2 queries/minute. Cachear resultados.81- **Bbox grande:** Queries muy grandes pueden timeout. Dividir en tiles.82- **Datos incompletos:** OSM no tiene toda la infraestructura. Verificar con fuentes oficiales.83- **Sensibilidad:** Infraestructura crítica puede tener datos limitados en OSM por seguridad.8485## Referencias8687- sightline: https://github.com/ni5arga/sightline88- Overpass API: https://overpass-api.de/89- OSM Tags: https://wiki.openstreetmap.org/wiki/Map_Features9091---9293**Hecho con ❤️ por David Antizar**