Список інструментів

Power Lines API

Доступ & обмеженняPublic, no key needed · Heavy▾

Відкрито для всіх. Безплатний ключ API з вашого профілю розширює обмеження: надішліть його у X-API-Key заголовок, або як api_key= в адресі.

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 за секунди. Відхилені запити не враховуються.

GET Ключ не потрібен JSON або бінарні файли До 30 км в квадраті 2-бітові класи та список опор 60 запитів на годину на адресу

Де знаходяться лінії електропередачі над квадратом навколо точки, і кожна опора на них з її висотою, ті самі дані, що Карта ліній електропередач видання. Запросіть його як 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Висота, дециметри
10uint16Napięcie jego linii, kV (0 nieznane)
12uint160
14uint8Тип: 1 пілон
15uint8Flags: bit 0, height estimated from the voltage; bit 1, voltage not known either

Приклади

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's 2 bit grid: (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Запитана компресія зараз недоступна

Спробуйте

Те 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”. До того ж, застосовуються всі кредити, які запитують власні джерела даних, перелічені на цій сторінці.