Power Lines API
Πρόσβαση & όριαPublic, no key needed · Heavy▾
Ανοιχτό σε όλους. Ένα δωρεάν κλειδί API από το προφίλ σας αυξάνει τα όρια: στείλτε το σε ένα X-API-Key header, ή ως api_key= στη διεύθυνση.
| 5 λεπτά | Ώρα | Ημέρα | |
|---|---|---|---|
| Χωρίς κλειδί | 20 | 120 | 500 |
| Με ένα κλειδί | 60 | 400 | 2,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 σε δευτερόλεπτα. Οι αρνηθείσες αιτήσεις δεν μετράνε.
Πού βρίσκονται οι εναέριες γραμμές ηλεκτρικής ενέργειας πάνω από ένα τετράγωνο γύρω από ένα σημείο, και κάθε πυλώνας σε αυτές με το ύψος του, τα ίδια δεδομένα τα Χάρτης Γραμμών Ηλεκτρικής Ενέργειας draws. Ζητήστε το ως JSON για μια ιστοσελίδα ή ένα σενάριο, ή ως μικρά δυαδικά αρχεία που μπορεί να φέρει ένας flight computer ή σταθμός εδάφους.
lat lon size_kmΠαράμετροι
| Παράμετρος | Νόημα |
|---|---|
lat, lon | Το μέσο του τετραγώνου, δεκαδικές μοίρες (lng επίσης αποδεκτό) |
size_km | Η πλευρά του τετραγώνου σε km, περισσότερα από 0 και έως 30. Αν λείπει, 1. Τετράγωνα πάνω από 10 km έρχονται ως αρχείο μόνο. |
format | Προαιρετικό. json (το προεπιλεγμένο): το πλέγμα ως base64 και οι πυλώνες ως λίστα. bin: το πλέγμα ως αρχείο. pylons: τα πυλώνες ως αρχείο. |
compress | Προαιρετικό. none (η προεπιλογή), zlib ή lzma, όπως στο Inland Water API. |
classes | Προαιρετικό. Οι κλάσεις γραμμών που πρέπει να διατηρηθούν, όπως 1; the other classes come back as 0. Left out, all. |
download | Optional. 1 makes a browser save a file answer. |
The lines
| Class | What | OpenStreetMap |
|---|---|---|
| 0 | Nothing | |
| 1 | Transmission line | power=line |
| 2 | Distribution line | power=minor_line |
| 3 | Spare, 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 το δυτικό άκρο, δύο bits ανά κελί, τέσσερα κελιά ένα byte, το πρώτο κελί στα υψηλότερα bits, κάθε σειρά ξεκινώντας σε ολόκληρο byte.
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 byte | Type | Value |
|---|---|---|
| 0 | char[4] | ACPY |
| 4 | uint8 | Verze, 1 |
| 5 | uint8 | Μέγεθος εγγραφής, 16 |
| 8 | uint32 | Εγγραφές |
| 12 | int32 | Το μέσο του τετραγώνου, γεωγραφικό πλάτος × 107 |
| 16 | int32 | Το κέντρο του τετραγώνου, γεωγραφικό μήκος × 107 |
| 20 | uint32 | Πλευρά του τετραγώνου, μέτρα |
| Byte εγγραφής | Τύπος | Τιμή |
|---|---|---|
| 0 | int32 | Γεωγραφικό πλάτος × 107 |
| 4 | int32 | Γεωγραφικό μήκος × 107 |
| 8 | uint16 | Ύψος, δεκάμετρα |
| 10 | uint16 | Napięcie jego linii, kV (0 nieznane) |
| 12 | uint16 | 0 |
| 14 | uint8 | Τύπος: 1 πυλώνας |
| 15 | uint8 | Flags: 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 APIgrid 2 bit του ': (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 km, ή ζητήθηκε JSON για πάνω από 10 km |
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”. Τυχόν πιστώσεις που ζητούν οι δικές της πηγές δεδομένων, που αναφέρονται σε αυτή τη σελίδα, ισχύουν επίσης.



















