Class v1.SolarClient (0.1.0)

Service definition for the Solar API. v1

Package

@googlemaps/solar

Constructors

(constructor)(opts, gaxInstance)

constructor(opts?:ClientOptions,gaxInstance?:typeofgax|typeofgax.fallback);

Construct an instance of SolarClient.

Parameters
NameDescription
optsClientOptions
gaxInstancetypeofgax | typeoffallback

: loaded instance ofgoogle-gax. Useful if you need to avoid loading the default gRPC version and want to use the fallback HTTP implementation. Load only fallback version and pass it to the constructor: ``` const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC const client = new SolarClient({fallback: true}, gax); ```

Properties

apiEndpoint

getapiEndpoint():string;

The DNS address for this API service.

apiEndpoint

staticgetapiEndpoint():string;

The DNS address for this API service - same as servicePath.

auth

auth:gax.GoogleAuth;

descriptors

descriptors:Descriptors;

innerApiCalls

innerApiCalls:{[name:string]:Function;};

port

staticgetport():number;

The port for this API service.

scopes

staticgetscopes():string[];

The scopes needed to make gRPC calls for every method defined in this service.

servicePath

staticgetservicePath():string;

The DNS address for this API service.

solarStub

solarStub?:Promise<{[name:string]:Function;}>;

universeDomain

getuniverseDomain():string;

warn

warn:(code:string,message:string,warnType?:string)=>void;

Methods

close()

close():Promise<void>;

Terminate the gRPC channel and close the client.

The client will no longer be usable and all future behavior is undefined.

Returns
TypeDescription
Promise<void>

{Promise} A promise that resolves when the client is closed.

findClosestBuildingInsights(request, options)

findClosestBuildingInsights(request?:protos.google.maps.solar.v1.IFindClosestBuildingInsightsRequest,options?:CallOptions):Promise<[protos.google.maps.solar.v1.IBuildingInsights,(protos.google.maps.solar.v1.IFindClosestBuildingInsightsRequest|undefined),{}|undefined]>;

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

Parameters
NameDescription
requestIFindClosestBuildingInsightsRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.maps.solar.v1.IBuildingInsights, (protos.google.maps.solar.v1.IFindClosestBuildingInsightsRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representingBuildingInsights. Please see thedocumentation for more details and examples.

Example
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  Required. The longitude and latitude from which the API looks for the   *  nearest known building.   */// const location = {}/**   *  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.   */// const requiredQuality = {}/**   *  Optional. Whether to require exact quality of the imagery.   *  If set to false, the `required_quality` field is interpreted as the minimum   *  required quality, such that HIGH quality imagery may be returned when   *  `required_quality` is set to MEDIUM.  If set to true, `required_quality`   *  is interpreted as the exact required quality and only `MEDIUM` quality   *  imagery is returned if `required_quality` is set to `MEDIUM`.   */// const exactQualityRequired = true// Imports the Solar libraryconst{SolarClient}=require('@googlemaps/solar').v1;// Instantiates a clientconstsolarClient=newSolarClient();asyncfunctioncallFindClosestBuildingInsights(){// Construct requestconstrequest={location,};// Run requestconstresponse=awaitsolarClient.findClosestBuildingInsights(request);console.log(response);}callFindClosestBuildingInsights();

findClosestBuildingInsights(request, options, callback)

findClosestBuildingInsights(request:protos.google.maps.solar.v1.IFindClosestBuildingInsightsRequest,options:CallOptions,callback:Callback<protos.google.maps.solar.v1.IBuildingInsights,protos.google.maps.solar.v1.IFindClosestBuildingInsightsRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestIFindClosestBuildingInsightsRequest
optionsCallOptions
callbackCallback<protos.google.maps.solar.v1.IBuildingInsights,protos.google.maps.solar.v1.IFindClosestBuildingInsightsRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

findClosestBuildingInsights(request, callback)

findClosestBuildingInsights(request:protos.google.maps.solar.v1.IFindClosestBuildingInsightsRequest,callback:Callback<protos.google.maps.solar.v1.IBuildingInsights,protos.google.maps.solar.v1.IFindClosestBuildingInsightsRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestIFindClosestBuildingInsightsRequest
callbackCallback<protos.google.maps.solar.v1.IBuildingInsights,protos.google.maps.solar.v1.IFindClosestBuildingInsightsRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getDataLayers(request, options)

getDataLayers(request?:protos.google.maps.solar.v1.IGetDataLayersRequest,options?:CallOptions):Promise<[protos.google.maps.solar.v1.IDataLayers,protos.google.maps.solar.v1.IGetDataLayersRequest|undefined,{}|undefined]>;

Gets solar information for a region surrounding a location. Returns an error with codeNOT_FOUND if the location is outside the coverage area.

Parameters
NameDescription
requestIGetDataLayersRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.maps.solar.v1.IDataLayers,protos.google.maps.solar.v1.IGetDataLayersRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representingDataLayers. Please see thedocumentation for more details and examples.

Example
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  Required. The longitude and latitude for the center of the region to get   *  data for.   */// const location = {}/**   *  Required. The radius, in meters, defining the region surrounding that   *  centre point for which data should be returned. The limitations   *  on this value are:   *  * Any value up to 100m can always be specified.   *  * Values over 100m can be specified, as long as   *    `radius_meters` <= `pixel_size_meters="" *="" 1000`.="" *="" *="" however,="" for="" values="" over="" 175m,="" the="" `datalayerview`="" in="" the="" *="" request="" must="" not="" include="" monthly="" flux="" or="" hourly="" shade.="" */=""const=""radiusmeters="1234"*=""*=""optional.=""the=""desired=""subset=""of=""the=""data=""to=""return.=""*/="" const="" view="{}" *="" *="" 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.="" */=""const=""requiredquality="{}"*=""*=""optional.=""the=""minimum=""scale,=""in=""meters=""per=""pixel,=""of=""the=""data=""to=""return.=""*=""values=""of=""0.1=""(the=""default,=""if=""this=""field=""is=""not=""set=""explicitly),=""*=""0.25,=""0.5,=""and=""1.0=""are=""supported.=""imagery=""components=""whose=""normal=""*=""resolution=""is=""less=""than=""`pixel_size_meters`=""will=""be=""returned=""at=""*=""the=""resolution=""specified=""by=""`pixel_size_meters`;=""imagery=""*=""components=""whose=""normal=""resolution=""is=""equal=""to=""or=""greater=""than=""*=""`pixel_size_meters`=""will=""be=""returned=""at=""that=""normal=""resolution.=""*/="" const="" pixelsizemeters="1234" *="" *="" optional.="" whether="" to="" require="" exact="" quality="" of="" the="" imagery.="" *="" if="" set="" to="" false,="" the="" `required_quality`="" field="" is="" interpreted="" as="" the="" minimum="" *="" required="" quality,="" such="" that="" high="" quality="" imagery="" may="" be="" returned="" when="" *="" `required_quality`="" is="" set="" to="" medium.="" if="" set="" to="" true,="" `required_quality`="" *="" is="" interpreted="" as="" the="" exact="" required="" quality="" and="" only="" `medium`="" quality="" *="" imagery="" is="" returned="" if="" `required_quality`="" is="" set="" to="" `medium`.="" */=""const=""exactqualityrequired="true"imports=""the=""solar=""library=""const=""{solarclient}="require('@googlemaps/solar').v1;"instantiates=""a=""client=""const=""solarclient="new"solarclient();=""async=""function=""callgetdatalayers()=""{=""construct=""request=""const=""request="{"location,=""radiusmeters,=""};=""run=""request=""const=""response="await"solarclient.getdatalayers(request);=""console.log(response);=""}=""callgetdatalayers();="">

getDataLayers(request, options, callback)

getDataLayers(request:protos.google.maps.solar.v1.IGetDataLayersRequest,options:CallOptions,callback:Callback<protos.google.maps.solar.v1.IDataLayers,protos.google.maps.solar.v1.IGetDataLayersRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestIGetDataLayersRequest
optionsCallOptions
callbackCallback<protos.google.maps.solar.v1.IDataLayers,protos.google.maps.solar.v1.IGetDataLayersRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getDataLayers(request, callback)

getDataLayers(request:protos.google.maps.solar.v1.IGetDataLayersRequest,callback:Callback<protos.google.maps.solar.v1.IDataLayers,protos.google.maps.solar.v1.IGetDataLayersRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestIGetDataLayersRequest
callbackCallback<protos.google.maps.solar.v1.IDataLayers,protos.google.maps.solar.v1.IGetDataLayersRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getGeoTiff(request, options)

getGeoTiff(request?:protos.google.maps.solar.v1.IGetGeoTiffRequest,options?:CallOptions):Promise<[protos.google.api.IHttpBody,protos.google.maps.solar.v1.IGetGeoTiffRequest|undefined,{}|undefined]>;

Returns an image by its ID.

Parameters
NameDescription
requestIGetGeoTiffRequest

The request object that will be sent.

optionsCallOptions

Call options. SeeCallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.api.IHttpBody,protos.google.maps.solar.v1.IGetGeoTiffRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representingHttpBody. Please see thedocumentation for more details and examples.

Example
/**   * This snippet has been automatically generated and should be regarded as a code template only.   * It will require modifications to work.   * It may require correct/in-range values for request initialization.   * TODO(developer): Uncomment these variables before running the sample.   *//**   *  Required. The ID of the asset being requested.   */// const id = 'abc123'// Imports the Solar libraryconst{SolarClient}=require('@googlemaps/solar').v1;// Instantiates a clientconstsolarClient=newSolarClient();asyncfunctioncallGetGeoTiff(){// Construct requestconstrequest={id,};// Run requestconstresponse=awaitsolarClient.getGeoTiff(request);console.log(response);}callGetGeoTiff();

getGeoTiff(request, options, callback)

getGeoTiff(request:protos.google.maps.solar.v1.IGetGeoTiffRequest,options:CallOptions,callback:Callback<protos.google.api.IHttpBody,protos.google.maps.solar.v1.IGetGeoTiffRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestIGetGeoTiffRequest
optionsCallOptions
callbackCallback<protos.google.api.IHttpBody,protos.google.maps.solar.v1.IGetGeoTiffRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getGeoTiff(request, callback)

getGeoTiff(request:protos.google.maps.solar.v1.IGetGeoTiffRequest,callback:Callback<protos.google.api.IHttpBody,protos.google.maps.solar.v1.IGetGeoTiffRequest|null|undefined,{}|null|undefined>):void;
Parameters
NameDescription
requestIGetGeoTiffRequest
callbackCallback<protos.google.api.IHttpBody,protos.google.maps.solar.v1.IGetGeoTiffRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getProjectId()

getProjectId():Promise<string>;
Returns
TypeDescription
Promise<string>

getProjectId(callback)

getProjectId(callback:Callback<string,undefined,undefined>):void;
Parameter
NameDescription
callbackCallback<string, undefined, undefined>
Returns
TypeDescription
void

initialize()

initialize():Promise<{[name:string]:Function;}>;

Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.

You can await on this method if you want to make sure the client is initialized.

Returns
TypeDescription
Promise<{ [name: string]:Function; }>

{Promise} A promise that resolves to an authenticated service stub.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-10-30 UTC.