Power Lines API

גישה והגבלותPublic, no key needed · Heavy▾

פתוח לכולם. מפתח API חינמי מהפרופיל שלך מגביל את הגבולות: שלח אותו ב- X-API-Key כותרת, או כ api_key= בכתובת.

5 דקותHourיום
ללא מפתח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 וה-pylons כרשימה. bin: הרשת כקובץ. pylons: עמודי התאורה כקובץ.
compressאופציונלי. none (ברירת המחדל), zlib או lzma, כמו ב 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 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ריבוע האמצע, latitude × 107
16int32אמצע הריבוע, קו אורך × 107
20uint32הצד של הריבוע, מטרים
רשום בתיםסוגערך
0int32קו רוחב × 107
4int32Longitude × 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

קריאת הקבצים

הרשת קוראת בדיוק כמו 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הדחיסה המבוקשת אינה זמינה כעת

נסה זאת

ה- 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”. כל קרדיטים שמקורות הנתונים שלעצמם מבקשים, מופעלים בעמוד זה, חלים גם כן.