Method: buildingInsights.findClosest

Locates the closest building to a query point. Returns an error with code NOT_FOUND if there are no buildings within approximately 50m of the query point.

HTTP request

GET https://solar.googleapis.com/v1/buildingInsights:findClosest

The URL uses gRPC Transcoding syntax.

Query parameters

Parameters
location

object (LatLng)

Required. The longitude and latitude from which the API looks for the nearest known building.

requiredQuality

enum (ImageryQuality)

Optional. The minimum quality level allowed in the results. No result with lower quality than this will be returned. Not specifying this is equivalent to restricting to HIGH quality only.

Request body

The request body must be empty.

Response body

Response message for Solar.FindClosestBuildingInsights. Information about the location, dimensions, and solar potential of a building.

If successful, the response body contains data with the following structure:

JSON representation
{
  "name": string,
  "center": {
    object (LatLng)
  },
  "boundingBox": {
    object (LatLngBox)
  },
  "imageryDate": {
    object (Date)
  },
  "imageryProcessedDate": {
    object (Date)
  },
  "postalCode": string,
  "administrativeArea": string,
  "statisticalArea": string,
  "regionCode": string,
  "solarPotential": {
    object (SolarPotential)
  },
  "imageryQuality": enum (ImageryQuality)
}
Fields
name

string

The resource name for the building, of the format building/<place ID>.

center

object (LatLng)

A point near the center of the building.

boundingBox

object (LatLngBox)

The bounding box of the building.

imageryDate

object (Date)

Date that the underlying imagery was acquired. This is approximate.

imageryProcessedDate

object (Date)

When processing was completed on this imagery.

postalCode

string

Postal code (e.g., US zip code) this building is contained by.

administrativeArea

string

Administrative area 1 (e.g., in the US, the state) that contains this building. For example, in the US, the abbreviation might be "MA" or "CA."

statisticalArea

string

Statistical area (e.g., US census tract) this building is in.

regionCode

string

Region code for the country (or region) this building is in.

solarPotential

object (SolarPotential)

Solar potential of the building.

imageryQuality

enum (ImageryQuality)

The quality of the imagery used to compute the data for this building.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

LatLngBox

A bounding box in lat/lng coordinates.

JSON representation
{
  "sw": {
    object (LatLng)
  },
  "ne": {
    object (LatLng)
  }
}
Fields
sw

object (LatLng)

The southwest corner of the box.

ne

object (LatLng)

The northeast corner of the box.

SolarPotential

Information about the solar potential of a building. A number of fields in this are defined in terms of "panels". The fields panelCapacityWatts, panelHeightMeters, and panelWidthMeters describe the parameters of the model of panel used in these calculations.

JSON representation
{
  "maxArrayPanelsCount": integer,
  "panelCapacityWatts": number,
  "panelHeightMeters": number,
  "panelWidthMeters": number,
  "panelLifetimeYears": integer,
  "maxArrayAreaMeters2": number,
  "maxSunshineHoursPerYear": number,
  "carbonOffsetFactorKgPerMwh": number,
  "wholeRoofStats": {
    object (SizeAndSunshineStats)
  },
  "buildingStats": {
    object (SizeAndSunshineStats)
  },
  "roofSegmentStats": [
    {
      object (RoofSegmentSizeAndSunshineStats)
    }
  ],
  "solarPanels": [
    {
      object (SolarPanel)
    }
  ],
  "solarPanelConfigs": [
    {
      object (SolarPanelConfig)
    }
  ],
  "financialAnalyses": [
    {
      object (FinancialAnalysis)
    }
  ]
}
Fields
maxArrayPanelsCount

integer

Size of the maximum array - that is, the maximum number of panels that can fit on the roof.

panelCapacityWatts

number

Capacity, in watts, of the panel used in the calculations.

panelHeightMeters

number

Height, in meters in portrait orientation, of the panel used in the calculations.

panelWidthMeters

number

Width, in meters in portrait orientation, of the panel used in the calculations.

panelLifetimeYears

integer

The expected lifetime, in years, of the solar panels. This is used in the financial calculations.

maxArrayAreaMeters2

number

Size, in square meters, of the maximum array.

maxSunshineHoursPerYear

number

Maximum number of sunshine hours received per year, by any point on the roof. Sunshine hours are a measure of the total amount of insolation (energy) received per year. 1 sunshine hour = 1 kWh per kW (where kW refers to kW of capacity under Standard Testing Conditions).

carbonOffsetFactorKgPerMwh

number

Equivalent amount of CO2 produced per MWh of grid electricity. This is a measure of the carbon intensity of grid electricity displaced by solar electricity.

wholeRoofStats

object (SizeAndSunshineStats)

Total size and sunlight quantiles for the part of the roof that was assigned to some roof segment. Despite the name, this may not include the entire building. See buildingStats.

buildingStats

object (SizeAndSunshineStats)

Size and sunlight quantiles for the entire building, including parts of the roof that were not assigned to some roof segment. Because the orientations of these parts are not well characterised, the roof area estimate is unreliable, but the ground area estimate is reliable. It may be that a more reliable whole building roof area can be obtained by scaling the roof area from wholeRoofStats by the ratio of the ground areas of buildingStats and wholeRoofStats.

roofSegmentStats[]

object (RoofSegmentSizeAndSunshineStats)

Size and sunlight quantiles for each roof segment.

solarPanels[]

object (SolarPanel)

Each SolarPanel describes a single solar panel. They are listed in the order that the panel layout algorithm placed this. This is usually, though not always, in decreasing order of annual energy production.

solarPanelConfigs[]

object (SolarPanelConfig)

Each SolarPanelConfig describes a different arrangement of solar panels on the roof. They are in order of increasing number of panels. The SolarPanelConfig with panelsCount=N is based on the first N panels in the solarPanels list. This field is only populated if at least 4 panels can fit on a roof.

financialAnalyses[]

object (FinancialAnalysis)

A FinancialAnalysis gives the savings from going solar assuming a given monthly bill and a given electricity provider. They are in order of increasing order of monthly bill amount. This field will be empty for buildings in areas for which the Solar API does not have enough information to perform financial computations.

SizeAndSunshineStats

Size and sunniness quantiles of a roof, or part of a roof.

JSON representation
{
  "areaMeters2": number,
  "sunshineQuantiles": [
    number
  ],
  "groundAreaMeters2": number
}
Fields
areaMeters2

number

The area of the roof or roof segment, in m^2. This is the roof area (accounting for tilt), not the ground footprint area.

sunshineQuantiles[]

number

Quantiles of the pointwise sunniness across the area. If there are N values here, this represents the (N-1)-iles. For example, if there are 5 values, then they would be the quartiles (min, 25%, 50%, 75%, max). Values are in annual kWh/kW like maxSunshineHoursPerYear.

groundAreaMeters2

number

The ground footprint area covered by the roof or roof segment, in m^2.

RoofSegmentSizeAndSunshineStats

Information about the size and sunniness quantiles of a roof segment.

JSON representation
{
  "stats": {
    object (SizeAndSunshineStats)
  },
  "center": {
    object (LatLng)
  },
  "boundingBox": {
    object (LatLngBox)
  },
  "pitchDegrees": number,
  "azimuthDegrees": number,
  "planeHeightAtCenterMeters": number
}
Fields
stats

object (SizeAndSunshineStats)

Total size and sunlight quantiles for the roof segment.

center

object (LatLng)

A point near the center of the roof segment.

boundingBox

object (LatLngBox)

The bounding box of the roof segment.

pitchDegrees

number

Angle of the roof segment relative to the theoretical ground plane. 0 = parallel to the ground, 90 = perpendicular to the ground.

azimuthDegrees

number

Compass direction the roof segment is pointing in. 0 = North, 90 = East, 180 = South. For a "flat" roof segment (pitchDegrees very near 0), azimuth is not well defined, so for consistency, we define it arbitrarily to be 0 (North).

planeHeightAtCenterMeters

number

The height of the roof segment plane, in meters above sea level, at the point designated by center. Together with the pitch, azimuth, and center location, this fully defines the roof segment plane.

SolarPanel

SolarPanel describes the position, orientation, and production of a single solar panel. See the panelHeightMeters, panelWidthMeters, and panelCapacityWatts fields in SolarPotential for information on the parameters of the panel.

JSON representation
{
  "center": {
    object (LatLng)
  },
  "orientation": enum (SolarPanelOrientation),
  "yearlyEnergyDcKwh": number,
  "segmentIndex": integer
}
Fields
center

object (LatLng)

The centre of the panel.

orientation

enum (SolarPanelOrientation)

The orientation of the panel.

yearlyEnergyDcKwh

number

How much sunlight energy this layout captures over the course of a year, in DC kWh.

segmentIndex

integer

Index in roofSegmentStats of the RoofSegmentSizeAndSunshineStats which corresponds to the roof segment that this panel is placed on.

SolarPanelOrientation

The orientation of a solar panel. This must be interpreted relative to the azimuth of the roof segment that the panel is placed on.

Enums
SOLAR_PANEL_ORIENTATION_UNSPECIFIED No panel orientation is known.
LANDSCAPE A LANDSCAPE panel has its long edge perpendicular to the azimuth direction of the roof segment that it is placed on.
PORTRAIT A PORTRAIT panel has its long edge parallel to the azimuth direction of the roof segment that it is placed on.

SolarPanelConfig

SolarPanelConfig describes a particular placement of solar panels on the roof.

JSON representation
{
  "panelsCount": integer,
  "yearlyEnergyDcKwh": number,
  "roofSegmentSummaries": [
    {
      object (RoofSegmentSummary)
    }
  ]
}
Fields
panelsCount

integer

Total number of panels. Note that this is redundant to (the sum of) the corresponding fields in roofSegmentSummaries.

yearlyEnergyDcKwh

number

How much sunlight energy this layout captures over the course of a year, in DC kWh, assuming the panels described above.

roofSegmentSummaries[]

object (RoofSegmentSummary)

Information about the production of each roof segment that is carrying at least one panel in this layout. roofSegmentSummaries[i] describes the i-th roof segment, including its size, expected production and orientation.

RoofSegmentSummary

Information about a roof segment on the building, with some number of panels placed on it.

JSON representation
{
  "panelsCount": integer,
  "yearlyEnergyDcKwh": number,
  "pitchDegrees": number,
  "azimuthDegrees": number,
  "segmentIndex": integer
}
Fields
panelsCount

integer

The total number of panels on this segment.

yearlyEnergyDcKwh

number

How much sunlight energy this part of the layout captures over the course of a year, in DC kWh, assuming the panels described above.

pitchDegrees

number

Angle of the roof segment relative to the theoretical ground plane. 0 = parallel to the ground, 90 = perpendicular to the ground.

azimuthDegrees

number

Compass direction the roof segment is pointing in. 0 = North, 90 = East, 180 = South. For a "flat" roof segment (pitchDegrees very near 0), azimuth is not well defined, so for consistency, we define it arbitrarily to be 0 (North).

segmentIndex

integer

Index in roofSegmentStats of the corresponding RoofSegmentSizeAndSunshineStats.

FinancialAnalysis

Analysis of the cost and benefits of the optimum solar layout for a particular electric bill size.

JSON representation
{
  "monthlyBill": {
    object (Money)
  },
  "defaultBill": boolean,
  "averageKwhPerMonth": number,
  "financialDetails": {
    object (FinancialDetails)
  },
  "leasingSavings": {
    object (LeasingSavings)
  },
  "cashPurchaseSavings": {
    object (CashPurchaseSavings)
  },
  "financedPurchaseSavings": {
    object (FinancedPurchaseSavings)
  },
  "panelConfigIndex": integer
}
Fields
monthlyBill

object (Money)

The monthly electric bill this analysis assumes.

defaultBill

boolean

Whether this is the bill size selected to be the default bill for the area this building is in. Exactly one FinancialAnalysis in BuildingSolarPotential should have defaultBill set.

averageKwhPerMonth

number

How much electricity the house uses in an average month, based on the bill size and the local electricity rates.

financialDetails

object (FinancialDetails)

Financial information that applies regardless of the financing method used.

leasingSavings

object (LeasingSavings)

Cost and benefit of leasing the solar panels.

cashPurchaseSavings

object (CashPurchaseSavings)

Cost and benefit of buying the solar panels with cash.

financedPurchaseSavings

object (FinancedPurchaseSavings)

Cost and benefit of buying the solar panels by financing the purchase.

panelConfigIndex

integer

Index in solarPanelConfigs of the optimum solar layout for this bill size. This can be -1 indicating that there is no layout. In this case, the remaining submessages will be omitted.

Money

Represents an amount of money with its currency type.

JSON representation
{
  "currencyCode": string,
  "units": string,
  "nanos": integer
}
Fields
currencyCode

string

The three-letter currency code defined in ISO 4217.

units

string (int64 format)

The whole units of the amount. For example if currencyCode is "USD", then 1 unit is one US dollar.

nanos

integer

Number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If units is positive, nanos must be positive or zero. If units is zero, nanos can be positive, zero, or negative. If units is negative, nanos must be negative or zero. For example $-1.75 is represented as units=-1 and nanos=-750,000,000.

FinancialDetails

Details of a financial analysis. Some of these details are already stored at higher levels (e.g., out of pocket cost). Total money amounts are over a lifetime period defined by the panelLifetimeYears field in SolarPotential. Note: The out of pocket cost of purchasing the panels is given in the outOfPocketCost field in CashPurchaseSavings.

JSON representation
{
  "initialAcKwhPerYear": number,
  "remainingLifetimeUtilityBill": {
    object (Money)
  },
  "federalIncentive": {
    object (Money)
  },
  "stateIncentive": {
    object (Money)
  },
  "utilityIncentive": {
    object (Money)
  },
  "lifetimeSrecTotal": {
    object (Money)
  },
  "costOfElectricityWithoutSolar": {
    object (Money)
  },
  "netMeteringAllowed": boolean,
  "solarPercentage": number,
  "percentageExportedToGrid": number
}
Fields
initialAcKwhPerYear

number

How many AC kWh we think the solar panels will generate in their first year.

remainingLifetimeUtilityBill

object (Money)

Utility bill for electricity not produced by solar, for the lifetime of the panels.

federalIncentive

object (Money)

Amount of money available from federal incentives; this applies if the user buys (with or without a loan) the panels.

stateIncentive

object (Money)

Amount of money available from state incentives; this applies if the user buys (with or without a loan) the panels.

utilityIncentive

object (Money)

Amount of money available from utility incentives; this applies if the user buys (with or without a loan) the panels.

lifetimeSrecTotal

object (Money)

Amount of money the user will receive from Solar Renewable Energy Credits over the panel lifetime; this applies if the user buys (with or without a loan) the panels.

costOfElectricityWithoutSolar

object (Money)

Total cost of electricity the user would have paid over the lifetime period if they didn't install solar.

netMeteringAllowed

boolean

Whether net metering is allowed.

solarPercentage

number

Percentage (0-100) of the user's power supplied by solar. Valid for the first year but approximately correct for future years.

percentageExportedToGrid

number

The percentage (0-100) of solar electricity production we assumed was exported to the grid, based on the first quarter of production. This affects the calculations if net metering is not allowed.

LeasingSavings

Cost and benefit of leasing a particular configuration of solar panels with a particular electricity usage.

JSON representation
{
  "leasesAllowed": boolean,
  "leasesSupported": boolean,
  "annualLeasingCost": {
    object (Money)
  },
  "savings": {
    object (SavingsOverTime)
  }
}
Fields
leasesAllowed

boolean

Whether leases are allowed in this juristiction (leases are not allowed in some states). If this field is false, then the values in this message should probably be ignored.

leasesSupported

boolean

Whether leases are supported in this juristiction by the financial calculation engine. If this field is false, then the values in this message should probably be ignored. This is independent of leasesAllowed: in some areas leases are allowed, but under conditions that aren't handled by the financial models.

annualLeasingCost

object (Money)

Estimated annual leasing cost.

savings

object (SavingsOverTime)

How much is saved (or not) over the lifetime period.

SavingsOverTime

Financial information that's shared between different financing methods.

JSON representation
{
  "savingsYear1": {
    object (Money)
  },
  "savingsYear20": {
    object (Money)
  },
  "presentValueOfSavingsYear20": {
    object (Money)
  },
  "savingsLifetime": {
    object (Money)
  },
  "presentValueOfSavingsLifetime": {
    object (Money)
  },
  "financiallyViable": boolean
}
Fields
savingsYear1

object (Money)

Savings in the first year after panel installation.

savingsYear20

object (Money)

Savings in the first twenty years after panel installation.

presentValueOfSavingsYear20

object (Money)

Using the assumed discount rate, what is the present value of the cumulative 20-year savings?

savingsLifetime

object (Money)

Savings in the entire panel lifetime.

presentValueOfSavingsLifetime

object (Money)

Using the assumed discount rate, what is the present value of the cumulative lifetime savings?

financiallyViable

boolean

Indicates whether this scenario is financially viable. Will be false for scenarios with poor financial viability (e.g., money-losing).

CashPurchaseSavings

Cost and benefit of an outright purchase of a particular configuration of solar panels with a particular electricity usage.

JSON representation
{
  "outOfPocketCost": {
    object (Money)
  },
  "upfrontCost": {
    object (Money)
  },
  "rebateValue": {
    object (Money)
  },
  "savings": {
    object (SavingsOverTime)
  },
  "paybackYears": number
}
Fields
outOfPocketCost

object (Money)

Initial cost before tax incentives: the amount that must be paid out-of-pocket. Contrast with upfrontCost, which is after tax incentives.

upfrontCost

object (Money)

Initial cost after tax incentives: it's the amount that must be paid during first year. Contrast with outOfPocketCost, which is before tax incentives.

rebateValue

object (Money)

The value of all tax rebates.

savings

object (SavingsOverTime)

How much is saved (or not) over the lifetime period.

paybackYears

number

Number of years until payback occurs. A negative value means payback never occurs within the lifetime period.

FinancedPurchaseSavings

Cost and benefit of using a loan to buy a particular configuration of solar panels with a particular electricity usage.

JSON representation
{
  "annualLoanPayment": {
    object (Money)
  },
  "rebateValue": {
    object (Money)
  },
  "loanInterestRate": number,
  "savings": {
    object (SavingsOverTime)
  }
}
Fields
annualLoanPayment

object (Money)

Annual loan payments.

rebateValue

object (Money)

The value of all tax rebates (including Federal Investment Tax Credit (ITC)).

loanInterestRate

number

The interest rate on loans assumed in this set of calculations.

savings

object (SavingsOverTime)

How much is saved (or not) over the lifetime period.