Class: Google::Apis::SolarV1::SolarService

Inherits:
Core::BaseService
  • Object
show all
Defined in:
lib/google/apis/solar_v1/service.rb

Overview

Solar API

Solar API.

Examples:

require 'google/apis/solar_v1'

Solar = Google::Apis::SolarV1 # Alias the module
service = Solar::SolarService.new

See Also:

Constant Summary collapse

DEFAULT_ENDPOINT_TEMPLATE =
"https://solar.$UNIVERSE_DOMAIN$/"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSolarService

Returns a new instance of SolarService.



47
48
49
50
51
52
# File 'lib/google/apis/solar_v1/service.rb', line 47

def initialize
  super(DEFAULT_ENDPOINT_TEMPLATE, '',
        client_name: 'google-apis-solar_v1',
        client_version: Google::Apis::SolarV1::GEM_VERSION)
  @batch_path = 'batch'
end

Instance Attribute Details

#keyString

Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

Returns:

  • (String)

    API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.



40
41
42
# File 'lib/google/apis/solar_v1/service.rb', line 40

def key
  @key
end

#quota_userString

Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

Returns:

  • (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.



45
46
47
# File 'lib/google/apis/solar_v1/service.rb', line 45

def quota_user
  @quota_user
end

Instance Method Details

#find_building_insight_closest(location_latitude: nil, location_longitude: nil, required_quality: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SolarV1::BuildingInsights

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.

Parameters:

  • location_latitude (Float) (defaults to: nil)

    The latitude in degrees. It must be in the range [-90.0, +90.0].

  • location_longitude (Float) (defaults to: nil)

    The longitude in degrees. It must be in the range [-180.0, +180.0].

  • required_quality (String) (defaults to: nil)

    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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



82
83
84
85
86
87
88
89
90
91
92
# File 'lib/google/apis/solar_v1/service.rb', line 82

def find_building_insight_closest(location_latitude: nil, location_longitude: nil, required_quality: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/buildingInsights:findClosest', options)
  command.response_representation = Google::Apis::SolarV1::BuildingInsights::Representation
  command.response_class = Google::Apis::SolarV1::BuildingInsights
  command.query['location.latitude'] = location_latitude unless location_latitude.nil?
  command.query['location.longitude'] = location_longitude unless location_longitude.nil?
  command.query['requiredQuality'] = required_quality unless required_quality.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_data_layer(exact_quality_required: nil, location_latitude: nil, location_longitude: nil, pixel_size_meters: nil, radius_meters: nil, required_quality: nil, view: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SolarV1::DataLayers

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

Parameters:

  • exact_quality_required (Boolean) (defaults to: nil)

    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.

  • location_latitude (Float) (defaults to: nil)

    The latitude in degrees. It must be in the range [-90.0, +90.0].

  • location_longitude (Float) (defaults to: nil)

    The longitude in degrees. It must be in the range [-180.0, +180.0].

  • pixel_size_meters (Float) (defaults to: nil)

    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.

  • radius_meters (Float) (defaults to: nil)

    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.

  • required_quality (String) (defaults to: nil)

    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.

  • view (String) (defaults to: nil)

    Optional. The desired subset of the data to return.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/google/apis/solar_v1/service.rb', line 144

def get_data_layer(exact_quality_required: nil, location_latitude: nil, location_longitude: nil, pixel_size_meters: nil, radius_meters: nil, required_quality: nil, view: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/dataLayers:get', options)
  command.response_representation = Google::Apis::SolarV1::DataLayers::Representation
  command.response_class = Google::Apis::SolarV1::DataLayers
  command.query['exactQualityRequired'] = exact_quality_required unless exact_quality_required.nil?
  command.query['location.latitude'] = location_latitude unless location_latitude.nil?
  command.query['location.longitude'] = location_longitude unless location_longitude.nil?
  command.query['pixelSizeMeters'] = pixel_size_meters unless pixel_size_meters.nil?
  command.query['radiusMeters'] = radius_meters unless radius_meters.nil?
  command.query['requiredQuality'] = required_quality unless required_quality.nil?
  command.query['view'] = view unless view.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_geo_tiff(id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SolarV1::HttpBody

Returns an image by its ID.

Parameters:

  • id (String) (defaults to: nil)

    Required. The ID of the asset being requested.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



180
181
182
183
184
185
186
187
188
# File 'lib/google/apis/solar_v1/service.rb', line 180

def get_geo_tiff(id: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/geoTiff:get', options)
  command.response_representation = Google::Apis::SolarV1::HttpBody::Representation
  command.response_class = Google::Apis::SolarV1::HttpBody
  command.query['id'] = id unless id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end