buildingInsights एंडपॉइंट, किसी इमारत की जगह, डाइमेंशन, और सौर ऊर्जा की क्षमता के बारे में अहम जानकारी देता है. खास तौर पर, आपको इनके बारे में जानकारी मिल सकती है:
- सोलर पैनल का साइज़, साल भर में मिलने वाली धूप की मात्रा, कार्बन ऑफ़सेट करने वाले फ़ैक्टर वगैरह के आधार पर, सौर ऊर्जा पैदा करने की क्षमता
- सोलर पैनल की पोज़िशन, ओरिएंटेशन, और ऊर्जा उत्पादन
- सोलर पैनल के सबसे सही लेआउट से मिलने वाले ऊर्जा के अनुमानित हर महीने के बिल के साथ-साथ, उससे जुड़ी लागत और फ़ायदे
Solar API, सौर ऊर्जा की संभावना और धूप के बारे में कैसे बताता है, इस बारे में ज़्यादा जानने के लिए Solar API के कॉन्सेप्ट देखें.
एपीआई एक्सप्लोरर की मदद से, लाइव अनुरोध किए जा सकते हैं. इससे आपको एपीआई और एपीआई के विकल्पों के बारे में जानकारी मिलती है:
अहम जानकारी के अनुरोध बनाने के बारे में जानकारी
अहम जानकारी बनाने का अनुरोध करने के लिए, यहां दिए गए एचटीटीपी GET अनुरोध को भेजें:
https://solar.googleapis.com/v1/buildingInsights:findClosest?key=YOUR_API_KEY
अनुरोध के यूआरएल में ऐसे पैरामीटर शामिल करें जो जगह के अक्षांश और देशांतर निर्देशांक के साथ-साथ, नतीजों में दिखाए जाने वाले ज़रूरी क्वालिटी लेवल की जानकारी देते हों.
इमारत की अहम जानकारी के अनुरोध का उदाहरण
नीचे दिए गए उदाहरण में, अक्षांश = 37.4450 और देशांतर = -122.1390 के निर्देशांक वाली जगह के लिए, अहम जानकारी बनाने का अनुरोध किया गया है:
जवाब में दिए गए यूआरएल पर अनुरोध करने के लिए, यूआरएल में अपनी एपीआई कुंजी जोड़ें:
curl -X GET "https://solar.googleapis.com/v1/buildingInsights:findClosest?location.latitude=37.4450 &location.longitude=-122.1390 &requiredQuality=HIGH &key= YOUR_API_KEY "
अपने ब्राउज़र के यूआरएल बार में cURL अनुरोध में यूआरएल चिपकाकर भी एचटीटीपी अनुरोध किए जा सकते हैं. एपीआई पासकोड देने पर, आपको बेहतर इस्तेमाल और आंकड़े देखने की सुविधाएं मिलती हैं. साथ ही, जवाब के डेटा को ऐक्सेस करने का बेहतर कंट्रोल मिलता है.
ध्यान दें: यह फ़ॉर्मैट सिर्फ़ टेस्टिंग एनवायरमेंट के लिए है. ज़्यादा जानकारी के लिए, OAuth का इस्तेमाल करना लेख पढ़ें.
जवाब में दिए गए यूआरएल पर अनुरोध करने के लिए, अपने बिलिंग प्रोजेक्ट का नाम और OAuth टोकन डालें:
curl -H "Authorization: Bearer $(gcloud auth print-access-token)" \ -H "X-Goog-User-Project:PROJECT_NUMBER_OR_ID " \ "https://solar.googleapis.com/v1/buildingInsights:findClosest?location.latitude=37.4450&location.longitude=-122.1390"
जवाब में दिए गए यूआरएल का अनुरोध करने के लिए, अनुरोध में अपनी एपीआई कुंजी या OAuth टोकन शामिल करें. यहां एपीआई पासकोड का इस्तेमाल करने का उदाहरण दिया गया है:
/** * Fetches the building insights information from the Solar API. * https://developers.google.com/maps/documentation/solar/building-insights * * @param {LatLng} location Point of interest as latitude longitude. * @param {string} apiKey Google Cloud API key. * @return {Promise<DataLayersResponse>} Building Insights response. */ export async function findClosestBuilding( location: google.maps.LatLng, apiKey: string, ): Promise<BuildingInsightsResponse> { const args = { 'location.latitude': location.lat().toFixed(5), 'location.longitude': location.lng().toFixed(5), }; console.log('GET buildingInsights\n', args); const params = new URLSearchParams({ ...args, key: apiKey }); // https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest return fetch(`https://solar.googleapis.com/v1/buildingInsights:findClosest?${params}`).then( async (response) => { const content = await response.json(); if (response.status != 200) { console.error('findClosestBuilding\n', content); throw content; } console.log('buildingInsightsResponse', content); return content; }, ); }
डेटा टाइप की परिभाषाएं
इस तरह के डेटा का इस्तेमाल किया जा सकता है:
export interface DataLayersResponse { imageryDate: Date; imageryProcessedDate: Date; dsmUrl: string; rgbUrl: string; maskUrl: string; annualFluxUrl: string; monthlyFluxUrl: string; hourlyShadeUrls: string[]; imageryQuality: 'HIGH' | 'MEDIUM' | 'LOW'; } export interface Bounds { north: number; south: number; east: number; west: number; } // https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest export interface BuildingInsightsResponse { name: string; center: LatLng; boundingBox: LatLngBox; imageryDate: Date; imageryProcessedDate: Date; postalCode: string; administrativeArea: string; statisticalArea: string; regionCode: string; solarPotential: SolarPotential; imageryQuality: 'HIGH' | 'MEDIUM' | 'LOW'; } export interface SolarPotential { maxArrayPanelsCount: number; panelCapacityWatts: number; panelHeightMeters: number; panelWidthMeters: number; panelLifetimeYears: number; maxArrayAreaMeters2: number; maxSunshineHoursPerYear: number; carbonOffsetFactorKgPerMwh: number; wholeRoofStats: SizeAndSunshineStats; buildingStats: SizeAndSunshineStats; roofSegmentStats: RoofSegmentSizeAndSunshineStats[]; solarPanels: SolarPanel[]; solarPanelConfigs: SolarPanelConfig[]; financialAnalyses: object; } export interface SizeAndSunshineStats { areaMeters2: number; sunshineQuantiles: number[]; groundAreaMeters2: number; } export interface RoofSegmentSizeAndSunshineStats { pitchDegrees: number; azimuthDegrees: number; stats: SizeAndSunshineStats; center: LatLng; boundingBox: LatLngBox; planeHeightAtCenterMeters: number; } export interface SolarPanel { center: LatLng; orientation: 'LANDSCAPE' | 'PORTRAIT'; segmentIndex: number; yearlyEnergyDcKwh: number; } export interface SolarPanelConfig { panelsCount: number; yearlyEnergyDcKwh: number; roofSegmentSummaries: RoofSegmentSummary[]; } export interface RoofSegmentSummary { pitchDegrees: number; azimuthDegrees: number; panelsCount: number; yearlyEnergyDcKwh: number; segmentIndex: number; } export interface LatLng { latitude: number; longitude: number; } export interface LatLngBox { sw: LatLng; ne: LatLng; } export interface Date { year: number; month: number; day: number; } export interface RequestError { error: { code: number; message: string; status: string; }; }
रिस्पॉन्स ऑब्जेक्ट का उदाहरण
इस अनुरोध से, इस फ़ॉर्मैट में JSON रिस्पॉन्स मिलता है:
{ "name": "buildings/ChIJh0CMPQW7j4ARLrRiVvmg6Vs", "center": { "latitude": 37.4449439, "longitude": -122.13914659999998 }, "imageryDate": { "year": 2022, "month": 8, "day": 14 }, "postalCode": "94303", "administrativeArea": "CA", "statisticalArea": "06085511100", "regionCode": "US", "solarPotential": { "maxArrayPanelsCount": 1163, "maxArrayAreaMeters2": 1903.5983, "maxSunshineHoursPerYear": 1802, "carbonOffsetFactorKgPerMwh": 428.9201, "wholeRoofStats": { "areaMeters2": 2399.3958, "sunshineQuantiles": [ 351, 1396, 1474, 1527, 1555, 1596, 1621, 1640, 1664, 1759, 1864 ], "groundAreaMeters2": 2279.71 }, "roofSegmentStats": [ { "pitchDegrees": 11.350553, "azimuthDegrees": 269.6291, "stats": { "areaMeters2": 452.00052, "sunshineQuantiles": [ 408, 1475, 1546, 1575, 1595, 1606, 1616, 1626, 1635, 1643, 1761 ], "groundAreaMeters2": 443.16 }, "center": { "latitude": 37.444972799999995, "longitude": -122.13936369999999 }, "boundingBox": { "sw": { "latitude": 37.444732099999996, "longitude": -122.1394224 }, "ne": { "latitude": 37.4451909, "longitude": -122.13929279999999 } }, "planeHeightAtCenterMeters": 10.7835045 }, /.../ ], "solarPanelConfigs": [ { "panelsCount": 4, "yearlyEnergyDcKwh": 1819.8662, "roofSegmentSummaries": [ { "pitchDegrees": 12.273684, "azimuthDegrees": 179.12555, "panelsCount": 4, "yearlyEnergyDcKwh": 1819.8663, "segmentIndex": 1 } ] }, /.../ ] "financialAnalyses": [ { "monthlyBill": { "currencyCode": "USD", "units": "20" }, "panelConfigIndex": -1 }, { "monthlyBill": { "currencyCode": "USD", "units": "25" }, "panelConfigIndex": -1 }, { "monthlyBill": { "currencyCode": "USD", "units": "30" }, "panelConfigIndex": -1 }, { "monthlyBill": { "currencyCode": "USD", "units": "35" }, "panelConfigIndex": 0, "financialDetails": { "initialAcKwhPerYear": 1546.8864, "remainingLifetimeUtilityBill": { "currencyCode": "USD", "units": "2563" }, "federalIncentive": { "currencyCode": "USD", "units": "1483" }, "stateIncentive": { "currencyCode": "USD" }, "utilityIncentive": { "currencyCode": "USD" }, "lifetimeSrecTotal": { "currencyCode": "USD" }, "costOfElectricityWithoutSolar": { "currencyCode": "USD", "units": "10362" }, "netMeteringAllowed": true, "solarPercentage": 86.7469, "percentageExportedToGrid": 52.136684 }, "leasingSavings": { "leasesAllowed": true, "leasesSupported": true, "annualLeasingCost": { "currencyCode": "USD", "units": "335", "nanos": 85540771 }, "savings": { "savingsYear1": { "currencyCode": "USD", "units": "-10" }, "savingsYear20": { "currencyCode": "USD", "units": "1098" }, "presentValueOfSavingsYear20": { "currencyCode": "USD", "units": "568", "nanos": 380859375 }, "financiallyViable": true, "savingsLifetime": { "currencyCode": "USD", "units": "1098" }, "presentValueOfSavingsLifetime": { "currencyCode": "USD", "units": "568", "nanos": 380859375 } } }, "cashPurchaseSavings": { "outOfPocketCost": { "currencyCode": "USD", "units": "5704" }, "upfrontCost": { "currencyCode": "USD", "units": "4221" }, "rebateValue": { "currencyCode": "USD", "units": "1483", "nanos": 40039063 }, "paybackYears": 11.5, "savings": { "savingsYear1": { "currencyCode": "USD", "units": "325" }, "savingsYear20": { "currencyCode": "USD", "units": "7799" }, "presentValueOfSavingsYear20": { "currencyCode": "USD", "units": "1083", "nanos": 500244141 }, "financiallyViable": true, "savingsLifetime": { "currencyCode": "USD", "units": "7799" }, "presentValueOfSavingsLifetime": { "currencyCode": "USD", "units": "1083", "nanos": 500244141 } } }, "financedPurchaseSavings": { "annualLoanPayment": { "currencyCode": "USD", "units": "335", "nanos": 85540771 }, "rebateValue": { "currencyCode": "USD" }, "loanInterestRate": 0.05, "savings": { "savingsYear1": { "currencyCode": "USD", "units": "-10" }, "savingsYear20": { "currencyCode": "USD", "units": "1098" }, "presentValueOfSavingsYear20": { "currencyCode": "USD", "units": "568", "nanos": 380859375 }, "financiallyViable": true, "savingsLifetime": { "currencyCode": "USD", "units": "1098" }, "presentValueOfSavingsLifetime": { "currencyCode": "USD", "units": "568", "nanos": 380859375 } } } }, ], /.../ "panelCapacityWatts": 400, "panelHeightMeters": 1.879, "panelWidthMeters": 1.045, "panelLifetimeYears": 20, "buildingStats": { "areaMeters2": 2533.1233, "sunshineQuantiles": [ 348, 1376, 1460, 1519, 1550, 1590, 1618, 1638, 1662, 1756, 1864 ], "groundAreaMeters2": 2356.03 }, "solarPanels": [ { "center": { "latitude": 37.4449659, "longitude": -122.139089 }, "orientation": "LANDSCAPE", "yearlyEnergyDcKwh": 455.40714, "segmentIndex": 1 }, /.../ ] "imageryQuality": "HIGH", "imageryProcessedDate": { "year": 2023, "month": 8, "day": 4 } }
पैनल प्लेसमेंट के लिए छत के सेगमेंट चुनना
कुछ मामलों में, सोलर पैनल के प्लेसमेंट के लिए, छत के खास सेगमेंट चुने जा सकते हैं. roofSegmentStats
, किसी रूफ सेगमेंट के साइज़, ओरिएंटेशन, और धूप के हिसाब से क्वांटाइल के बारे में जानकारी देता है:
"roofSegmentStats": [ { "pitchDegrees": 11.350553, "azimuthDegrees": 269.6291, "stats": { "areaMeters2": 452.00052, "sunshineQuantiles": [409.601, 1482.1255, 1553.5117, 1582.7875, 1602.3456, 1613.7804, 1623.6434, 1634.0812, 1642.697, 1651.0267, 1771.4792], "groundAreaMeters2": 443.16 }, "center": { "latitude": 37.4449728, "longitude": -122.1393637 }, "boundingBox": { "sw": { "latitude": 37.4447321, "longitude": -122.1394224 }, "ne": { "latitude": 37.4451909, "longitude": -122.1392928 } }, "planeHeightAtCenterMeters": 10.7835045 }, { "pitchDegrees": 12.273684, "azimuthDegrees": 179.12555, "stats": { "areaMeters2": 309.87268, "sunshineQuantiles": [650.5504, 1701.709, 1745.0032, 1768.4081, 1779.1625, 1787.4258, 1794.9333, 1801.3938, 1806.7461, 1814.0724, 1845.8717], "groundAreaMeters2": 302.79 }, "center": { "latitude": 37.4449286, "longitude": -122.1389889 }, "boundingBox": { "sw": { "latitude": 37.4448617, "longitude": -122.1392095 }, "ne": { "latitude": 37.444982, "longitude": -122.1387809 } }, "planeHeightAtCenterMeters": 10.67585 }, /.../ ],
इन विशेषताओं के आधार पर, सिर्फ़ किसी खास रूफ़ सेगमेंट पर मौजूद पैनल चुने जा सकते हैं. buildingInsights
एंडपॉइंट के ज़रिए दिखाए गए हर पैनल में segmentIndex
वैल्यू शामिल होती है. इससे पता चलता है कि पैनल, छत के किस सेगमेंट पर रखा गया है:
{ "panelsCount": 142, "yearlyEnergyDcKwh": 101170.17, "roofSegmentSummaries": [ { "pitchDegrees": 12.273684, "azimuthDegrees": 179.12555, "panelsCount": 122, "yearlyEnergyDcKwh": 87260.48, "segmentIndex": 1 }, { "pitchDegrees": 11.245564, "azimuthDegrees": 179.204, "panelsCount": 18, "yearlyEnergyDcKwh": 12544.052, "segmentIndex": 3 }, { "pitchDegrees": 2.5699794, "azimuthDegrees": 86.05642, "panelsCount": 1, "yearlyEnergyDcKwh": 681.69183, "segmentIndex": 10 }, { "pitchDegrees": 0.10844088, "azimuthDegrees": 0, "panelsCount": 1, "yearlyEnergyDcKwh": 683.9312, "segmentIndex": 14 } ] },
खास विशेषताओं वाले रूफ़ सेगमेंट पर पैनल चुनने के लिए, segmentIndex
के हिसाब से फ़िल्टर किया जा सकता है. उदाहरण के लिए, अगर आपको छत के दक्षिणी हिस्से पर पैनल लगाने हैं, तो यह पता लगाएं कि छत के किन सेगमेंट में azimuthDegrees
की वैल्यू 90 से 270 के बीच है. इसके बाद, उन छत के सेगमेंट के लिए पैनल की पूरी सूची को फ़िल्टर करने के लिए, उससे जुड़े segmentIndex
का इस्तेमाल करें.
इसे आज़माएं!
एपीआई एक्सप्लोरर की मदद से, सैंपल अनुरोध किए जा सकते हैं, ताकि आपको एपीआई और एपीआई के विकल्पों के बारे में जानकारी मिल सके.
पेज की दाईं ओर मौजूद, एपीआई आइकॉन api चुनें.
इसके बाद, अनुरोध पैरामीटर में बदलाव करें. हालांकि, ऐसा करना ज़रूरी नहीं है.
लागू करें बटन चुनें. डायलॉग बॉक्स में, वह खाता चुनें जिसका इस्तेमाल करके आपको अनुरोध करना है.
एपीआई एक्सप्लोरर पैनल में, एपीआई एक्सप्लोरर विंडो को बड़ा करने के लिए, फ़ुलस्क्रीन आइकॉन फ़ुलस्क्रीन चुनें.