Списък на инструментите

Power Lines API

Достъп и лимитиPublic, no key needed · Heavy▾

Отворен за всички. Безплатен API ключ от твоя профил увеличава лимитите: изпрати го в X-API-Key заглавка, или като api_key= w adresie.

5 минутиЧасДен
Без ключ20120500
С ключ604002,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.

Влезте, за да създадете безплатен ключ на вашата страница профил.

Всеки отговор носи X-RateLimit-Remaining и X-RateLimit-Reset. Над лимит, отговорът е грешка 429 с retry_after v sekundách. Odmítnuté požadavky se nezapočítávají.

GET Не е необходим ключ JSON или двоични файлове До 30 км квадрат 2-битови класи и списък на пилоните 60 заявки в час на адрес

Където са надземните линии на захранване над квадрат около точка и всеки пилон върху тях с неговата височина, същите данни, които Mappa delle linee elettriche изтегляния. Поискай го като JSON за уеб страница или скрипт, или като малки двоични файлове, които полетен компютър или наземна станция могат да носят.

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

Параметри

ПараметърЗначение
lat, lonСерединта на квадрата, десетични градуса (lng също приет)
size_kmСтраната на квадрата в км, повече от 0 и до 30. Ако е пропусната, 1. Квадрати над 10 км идват само като файл.
formatПо желание. json (по подразбиране): мрежата като base64 и пилоните като списък. bin: мрежата като файл. pylons: пилоните като файл.
compressПо желание. none (по подразбиране), zlib или lzma, както на Inland Water API.
classesОпционално. Класовете на редове, които трябва да се запазят, като например 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: клетки от 1/12000 на степен, ред 0 северния край и колона 0 западния край, два бита на клетка, четири клетки на байт, първата клетка в най-високите битове, всеки ред започвайки на цял байт.

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.

Отговорът 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
4uint8Версия, 1
5uint8Размер на записа, 16
8uint32Записи
12int32Средната част на квадрата, ширина × 107
16int32Средната на квадрата, дължина × 107
20uint32Страната на квадрата, метри
Запис на байтТипСтойност
0int32Ширина × 107
4int32Дължина × 107
8uint16Височина, дециметри
10uint16Напрежение на неговата линия, kV (0 неизвестно)
12uint160
14uint8Тип: 1 пилон
15uint8Flags: bit 0, height estimated from the voltage; bit 1, voltage not known either

Przykłady

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

Четене на файловете

Решетката чете точно както Inland Water APIМрежа 2 бита: (row[i >> 2] >> (6 - 2 * (i & 3))) & 3 за колона iПилоните:

// 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')

Грешки

КодЗначение
412Липсва параметър или е невалиден, квадратът е над 30 км, или JSON е поискан над 10 км
413Квадратът има твърде много клетки, което се случва само много близо до полюсите
429Твърде много заявки от вашия адрес, или една още се обработва
501Поискането на компресия не е налично точно сега

Опитайте го

The 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.

Приписване на AltimeterCloud

Безплатно за използване. Ако използвате this API, or anything made from the answers, in a commercial product or service, credit AltimeterCloud with a link to www.altimetercloud.com в точката на употреба: на екрана, страницата или отпечатъка, където се появяват данните, например “Data from AltimeterCloud.com”. Всички благодарности, които собствените източници на данните изискват, наредени на тази страница, също се прилагат.