findClosest method
Locates the building whose centroid is closest to a query point.
Returns an error with code NOT_FOUND if there are no buildings within
approximately 50m of the query point.
Request parameters:
exactQualityRequired - 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.
experiments - Optional. Specifies the pre-GA experiments to enable.
Requests using this field are classified as a pre-GA offering under the
Google Maps Platform Service Specific Terms.
See
launch stage descriptions
for more details.
location_latitude - The latitude in degrees. It must be in the range
[-90.0, +90.0].
location_longitude - The longitude in degrees. It must be in the range
[-180.0, +180.0].
requiredQuality - 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.
Possible string values are:
- "IMAGERY_QUALITY_UNSPECIFIED" : No quality is known.
- "HIGH" : Solar data is derived from aerial imagery captured at low-altitude and processed at 0.1 m/pixel.
- "MEDIUM" : Solar data is derived from enhanced aerial imagery captured at high-altitude and processed at 0.25 m/pixel.
- "LOW" : Solar data is derived from enhanced satellite imagery processed at 0.25 m/pixel.
- "BASE" : Solar data is derived from enhanced satellite imagery processed at 0.25 m/pixel.
$fields - Selector specifying which fields to include in a partial
response.
Completes with a BuildingInsights.
Completes with a commons.ApiRequestError if the API endpoint returned an error.
If the used http.Client completes with an error when making a REST call,
this method will complete with the same error.
Implementation
async.Future<BuildingInsights> findClosest({
core.bool? exactQualityRequired,
core.List<core.String>? experiments,
core.double? location_latitude,
core.double? location_longitude,
core.String? requiredQuality,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'exactQualityRequired': ?exactQualityRequired == null
? null
: ['${exactQualityRequired}'],
'experiments': ?experiments,
'location.latitude': ?location_latitude == null
? null
: ['${location_latitude}'],
'location.longitude': ?location_longitude == null
? null
: ['${location_longitude}'],
'requiredQuality': ?requiredQuality == null ? null : [requiredQuality],
'fields': ?$fields == null ? null : [$fields],
};
const url_ = 'v1/buildingInsights:findClosest';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return BuildingInsights.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}