API Elektrických vedení

Přístup a limityPublic, no key needed · Heavy▾

Otevřeno všem. Bezplatný klíč API z vašeho profilu zvyšuje limity: odešlete jej v X-API-Key záhlaví, nebo jako api_key= v adrese.

5 minutHodinaDen
Bez klíče20120500
S klíčem604002,000

Each 100 square km of area counts as one request, so a 10 km square is 1 and a 30 km square is 9.

Přihlaste se a vytvořte bezplatný klíč na stránce svého profilu.

Každá odpověď nese X-RateLimit-Remaining a X-RateLimit-Reset. Přesáhne-li limit, odpověď je chyba 429 s retry_after za sekundy. Odmítnuté požadavky se nezapočítávají.

GET Není potřeba žádný klíč JSON nebo binární soubory Až 30 km čtverec 2bitové třídy a seznam pylonů 60 požadavků za hodinu na adresu

Kde jsou vzduchem vedené elektrické vedení nad čtvercem kolem bodu, a každý pylón na nich s jeho výškou, stejná data jako Mapa vedení kreslí. Požádejte jej jako JSON pro webovou stránku nebo skript, nebo jako malé binární soubory, které mohou nést počítač v letu nebo pozemní stanice.

GEThttps://www.altimetercloud.com/api/power/lat lon size_km

Parametry

ParametrSmysl
lat, lonStřed čtverce, desetinné stupně (lng také přijato)
size_kmStrana čtverce v km, více než 0 a až 30. Vynechano, 1. Čtverce přes 10 km se dodávají pouze jako soubor.
formatVolitelné. json (výchozí): mřížka jako base64 a pylony jako seznam. bin: mřížka jako soubor. pylons: pylony jako soubor.
compressVolitelné. none (výchozí), zlib nebo lzma, jak je na Inland Water API.
classesVolitelně. Třídy čar, které mají zůstat, například 1; the other classes come back as 0. Left out, all.
downloadOptional. 1 makes a browser save a file answer.

The lines

ClassWhatOpenStreetMap
0Nothing
1Transmission linepower=line
2Distribution linepower=minor_line
3Spare, not used yet

Any cell a line crosses at all takes its class, so each line comes back as an unbroken band of cells however it runs; where the two meet, transmission is kept. Lines mapped as underground or underwater are left out. The grid is the Inland Water API's: buňky 1/12000 stupně, řádek 0 je severní okraj a sloupec 0 je západní okraj, dva bity na buňku, čtyři buňky na bajt, první buňka v nejvyšších bitech, každý řádek začíná celým bajtem.

The pylons

Every pylon (power=tower) in the square, nearest the middle first, with its height in metres, the voltage of the line it carries in kV, and whether the height is estimated. Where OpenStreetMap records a pylon's height, that is used. Most have none, so the height is estimated from the voltage: 50 m for 380 kV and up, 45 m for 220 kV and up, 30 m for 110 kV and up, 22 m for 60 kV and up, 15 m for 30 kV and up, 12 m below that, and 30 m where the voltage is not known either. The wires hang from the pylon tops and sag lower between them, so a pylon's height is the most its wires can reach.

Odpověď JSON

{
  "success": true,
  "lat", "lon", "size_km", "bits",           bits is 2
  "rows", "cols", "cells", "row_bytes",      the grid, as above
  "cells_per_degree", "north_edge_cell", "west_edge_cell",
  "north", "south", "west", "east",
  "line_pct", "class_pct", "classes", "kept",
  "coverage_pct",
  "data_b64",                                the grid rows, row 0 first
  "pylon_count",
  "pylons": [ { "lat", "lon", "distance_m",
                "height_m", "kv", "height_estimated" } ],
  "credits": { "power", "licence", "data_licence", "full" }
}

The binary files

format=bin: the grid, with the same 32 byte header as the water, roads and tree canopy files, named ACPW, version 1, 2 bits a cell. format=pylons: a 32 byte header then 16 byte records, little endian, nearest the middle first.

Header byteTypeValue
0char[4]ACPY
4uint8Verze, 1
5uint8Velikost záznamu, 16
8uint32Záznamy
12int32Střed čtverce, zeměpisná šířka × 107
16int32Střed čtverce, zeměpisná délka × 107
20uint32Strana čtverce, metry
Záznamový byteTypHodnota
0int32Zeměpisná šířka × 107
4int32Zeměpisná délka × 107
8uint16Výška, decimetry
10uint16Napětí její linky, kV (0 není známo)
12uint160
14uint8Typ: 1 pylón
15uint8Flags: bit 0, height estimated from the voltage; bit 1, voltage not known either

Příklady

https://www.altimetercloud.com/api/power/?lat=54.35&lon=-2.95&size_km=3
https://www.altimetercloud.com/api/power/?lat=54.35&lon=-2.95&size_km=10&format=bin&compress=zlib
https://www.altimetercloud.com/api/power/?lat=54.35&lon=-2.95&size_km=10&format=pylons

Čtení souborů

Mřížka čte přesně tak jako Inland Water API's 2bitová mřížka: (row[i >> 2] >> (6 - 2 * (i & 3))) & 3 pro sloupec iPylony:

// C
typedef struct __attribute__((packed)) {
  int32_t  lat_e7, lon_e7;
  uint16_t height_dm, kv, reserved;
  uint8_t  type, flags;                  // flags bit 0: height estimated
} Pylon;
# Python
import requests, struct
f = requests.get('https://www.altimetercloud.com/api/power/',
                 params={'lat': 54.35, 'lon': -2.95, 'size_km': 10, 'format': 'pylons'}).content
n = struct.unpack('<I', f[8:12])[0]
for i in range(n):
    la, lo, h, kv, _, typ, fl = struct.unpack('<iiHHHBB', f[32 + 16 * i: 48 + 16 * i])
    print(la / 1e7, lo / 1e7, h / 10, kv, 'estimated' if fl & 1 else 'mapped')

Chyby

KódSmysl
412Chybí parametr nebo není platný, čtverec je větší než 30 km, nebo byl požadován JSON nad 10 km
413Čtverec má příliš mnoho buněk, což se vyskytuje pouze velmi blízko pólů
429Příliš mnoho požadavků z vaší adresy, nebo je stále odpovídán
501Požadovaná komprese není v tuto chvíli dostupná

Vyzkoušejte to

Ta Power Lines Map has a download panel: move the map so the cross sits on your launch site, choose the lines grid or the pylons, and it saves the file from this API.

Power lines data credits

Contains OpenStreetMap data © OpenStreetMap contributors, available under the Open Database Licence (ODbL), through the regional extracts published by Geofabrik. The lines are reduced here to a class a cell, and pylon heights are estimated from their line's voltage where none is mapped, which changes them: this is not the original data.

Licence of this data. Because it contains OpenStreetMap data, the data this API gives out is made available under the Open Database License (ODbL) 1.0. You may use it freely, commercially too, as long as you credit it as above and share any database you make from it under the same licence.

Zásluhy AltimeterCloud

Zdarma k použití. Pokud používáte this API, or anything made from the answers, in a commercial product or service, credit AltimeterCloud with a link to www.altimetercloud.com v místě použití: na obrazovce, stránce nebo výtisku, kde se data zobrazují, například “Data from AltimeterCloud.com”Jakékoli kredity, které si vyžádají vlastní zdroje dat, jsou uvedeny také na této stránce.