उपकरण सूची

Power Lines API

Access & limitsPublic, no key needed · Heavy▾

सभी के लिए खुला। आपकी प्रोफाइल से एक निःशुल्क API कुंजी सीमा बढ़ाती है: इसे भेजें X-API-Key शीर्ष लेख, या जैसा api_key= पते में।

5 मिनटघंटादिन
एक key के बिना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.

एक मुफ़्त key बनाने के लिए अपने profile page में log in करें।

हर उत्तर ले जाता है X-RateLimit-Remaining और X-RateLimit-Reset. सीमा से अधिक, उत्तर त्रुटि है 429 के साथ retry_after सेकंड में। अस्वीकृत अनुरोध गिनती नहीं करते हैं।

GET कोई कुंजी की आवश्यकता नहीं JSON या बाइनरी फ़ाइलें 30 किमी वर्ग तक 2-bit वर्ग और पाइलन सूची प्रति पता 60 अनुरोध प्रति घंटा

जहां ओवरहेड पावर लाइनें किसी बिंदु के चारों ओर एक वर्ग के ऊपर हैं, और उन पर हर पायलन अपनी ऊंचाई के साथ, समान डेटा Power Lines Map अनुरोध करें। वेब पेज या स्क्रिप्ट के लिए JSON के रूप में, या फ्लाइट कंप्यूटर या ग्राउंड स्टेशन ले जा सकते हैं छोटी बाइनरी फाइलें।

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

पैरामीटर

पैरामीटरअर्थ
lat, lonवर्ग के बीच में, दशमलव डिग्री (lng also accepted)
size_kmkm में वर्ग की भुजा, 0 से अधिक और 30 तक। छोड़ा गया, 1। 10 km से अधिक के वर्ग केवल फाइल के रूप में आते हैं।
formatवैकल्पिक। json (डिफ़ॉल्ट): ग्रिड को base64 के रूप में और पाइलन को एक सूची के रूप में। bin: grid को फ़ाइल के रूप में। pylons: 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की: 1/12000 डिग्री की कोशिकाएँ, पंक्ति 0 उत्तरी किनारा और स्तंभ 0 पश्चिमी किनारा, दो बिट एक सेल, चार सेल एक बाइट, highest bits में पहली cell, प्रत्येक row एक whole 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 byteTypeValue
0char[4]ACPY
4uint8संस्करण, 1
5uint8रिकॉर्ड आकार, 16
8uint32रिकॉर्ड
12int32वर्ग का मध्य, latitude × 107
16int32वर्ग का मध्य, देशांतर × 107
20uint32वर्ग की भुजा, मीटर
Record byteटाइपमान
0int32Latitude × 107
4int32Longitude × 107
8uint16ऊंचाई, डेसीमीटर
10uint16इसकी लाइन का वोल्टेज, kV (0 ज्ञात नहीं है)
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

फाइलें पढ़ना

ग्रिड बिल्कुल ठीक पढ़ता है इनलैंड वाटर API's 2 बिट ग्रिड: (row[i >> 2] >> (6 - 2 * (i & 3))) & 3 कॉलम के लिए ipylons:

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

त्रुटियां

Codeअर्थ
412एक पैरामीटर गायब है या मान्य नहीं है, वर्ग 30 किमी से अधिक है, या 10 किमी से अधिक के लिए JSON मांगा गया था
413वर्ग में बहुत सारे cells हैं, जो केवल poles के बहुत पास ही होता है
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 को credit देना

उपयोग करने के लिए मुफ्त। यदि आप 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”. इस पृष्ठ पर सूचीबद्ध डेटा के अपने स्रोतों के लिए कोई भी क्रेडिट लागू होता है।