Class: Google::Apis::AddressvalidationV1::GoogleMapsAddressvalidationV1Geocode

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/addressvalidation_v1/classes.rb,
lib/google/apis/addressvalidation_v1/representations.rb,
lib/google/apis/addressvalidation_v1/representations.rb

Overview

Contains information about the place the input was geocoded to.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleMapsAddressvalidationV1Geocode

Returns a new instance of GoogleMapsAddressvalidationV1Geocode.



347
348
349
# File 'lib/google/apis/addressvalidation_v1/classes.rb', line 347

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#boundsGoogle::Apis::AddressvalidationV1::GoogleGeoTypeViewport

A latitude-longitude viewport, represented as two diagonally opposite low and high points. A viewport is considered a closed region, i.e. it includes its boundary. The latitude bounds must range between -90 to 90 degrees inclusive, and the longitude bounds must range between -180 to 180 degrees inclusive. Various cases include: - If low = high, the viewport consists of that single point. - If low.longitude > high.longitude, the longitude range is inverted (the viewport crosses the 180 degree longitude line). - If low.longitude = -180 degrees and high.longitude = 180 degrees, the viewport includes all longitudes. - If low.longitude = 180 degrees and high. longitude = -180 degrees, the longitude range is empty. - If low.latitude > high.latitude, the latitude range is empty. Both low and high must be populated, and the represented box cannot be empty (as specified by the definitions above). An empty viewport will result in an error. For example, this viewport fully encloses New York City: "low": "latitude": 40.477398, " longitude": -74.259087 , "high": "latitude": 40.91618, "longitude": -73. 70018 Corresponds to the JSON property bounds



309
310
311
# File 'lib/google/apis/addressvalidation_v1/classes.rb', line 309

def bounds
  @bounds
end

#feature_size_metersFloat

The size of the geocoded place, in meters. This is another measure of the coarseness of the geocoded location, but in physical size rather than in semantic meaning. Corresponds to the JSON property featureSizeMeters

Returns:

  • (Float)


316
317
318
# File 'lib/google/apis/addressvalidation_v1/classes.rb', line 316

def feature_size_meters
  @feature_size_meters
end

#locationGoogle::Apis::AddressvalidationV1::GoogleTypeLatLng

An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. Corresponds to the JSON property location



324
325
326
# File 'lib/google/apis/addressvalidation_v1/classes.rb', line 324

def location
  @location
end

#place_idString

The PlaceID of the place this input geocodes to. For more information about Place IDs see here. Corresponds to the JSON property placeId

Returns:

  • (String)


331
332
333
# File 'lib/google/apis/addressvalidation_v1/classes.rb', line 331

def place_id
  @place_id
end

#place_typesArray<String>

The type(s) of place that the input geocoded to. For example, ['locality', ' political']. The full list of types can be found here. Corresponds to the JSON property placeTypes

Returns:

  • (Array<String>)


338
339
340
# File 'lib/google/apis/addressvalidation_v1/classes.rb', line 338

def place_types
  @place_types
end

#plus_codeGoogle::Apis::AddressvalidationV1::GoogleMapsAddressvalidationV1PlusCode

Plus code (http://plus.codes) is a location reference with two formats: global code defining a 14mx14m (1/8000th of a degree) or smaller rectangle, and compound code, replacing the prefix with a reference location. Corresponds to the JSON property plusCode



345
346
347
# File 'lib/google/apis/addressvalidation_v1/classes.rb', line 345

def plus_code
  @plus_code
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



352
353
354
355
356
357
358
359
# File 'lib/google/apis/addressvalidation_v1/classes.rb', line 352

def update!(**args)
  @bounds = args[:bounds] if args.key?(:bounds)
  @feature_size_meters = args[:feature_size_meters] if args.key?(:feature_size_meters)
  @location = args[:location] if args.key?(:location)
  @place_id = args[:place_id] if args.key?(:place_id)
  @place_types = args[:place_types] if args.key?(:place_types)
  @plus_code = args[:plus_code] if args.key?(:plus_code)
end