Table of Contents

Class GeocodingRequest

Namespace
GoogleMapsApi.Entities.Geocoding.Request
Assembly
GoogleMapsApi.dll

Request for the Google Geocoding API, which converts between addresses and geographic coordinates. Supports forward geocoding (address to coordinates) and reverse geocoding (coordinates to address).

public class GeocodingRequest : SignableRequest
Inheritance
GeocodingRequest
Inherited Members

Properties

Address

address (required) — The address that you want to geocode.*

public string? Address { get; set; }

Property Value

string

BaseUrl

Base URL (without scheme) for the Google Maps Web Service endpoint this request targets. Derived requests append their service-specific path.

protected override string BaseUrl { get; }

Property Value

string

Bounds

bounds (optional) — The bounding box of the viewport within which to bias geocode results more prominently. (For more information see Viewport Biasing below.) The bounds and region parameters will only influence, not fully restrict, results from the geocoder.

public Location[]? Bounds { get; set; }

Property Value

Location[]

Components

A component filter for which you wish to obtain a geocode. The components filter will also be accepted as an optional parameter if an address is provided. See more info: https://developers.google.com/maps/documentation/geocoding/intro#ComponentFiltering

public GeocodingComponents Components { get; set; }

Property Value

GeocodingComponents

Language

language (optional) — The language in which to return results. See the supported list of domain languages. Note that we often update supported languages so this list may not be exhaustive. If language is not supplied, the geocoder will attempt to use the native language of the domain from which the request is sent wherever possible.

public string? Language { get; set; }

Property Value

string

Location

latlng (required) — The textual latitude/longitude value for which you wish to obtain the closest, human-readable address.* If you pass a latlng, the geocoder performs what is known as a reverse geocode. See Reverse Geocoding for more information.

public Location? Location { get; set; }

Property Value

Location

PlaceId

placeId (required) — The place ID of the place for which you wish to obtain the closest, human-readable address.*

public string? PlaceId { get; set; }

Property Value

string

Region

region (optional) — The region code, specified as a ccTLD ("top-level domain") two-character value. (For more information see Region Biasing below.) The bounds and region parameters will only influence, not fully restrict, results from the geocoder.

public string? Region { get; set; }

Property Value

string

Methods

GetQueryStringParameters()

Builds the list of query-string parameters that will be sent with the request. Derived classes override to contribute their service-specific parameters.

protected override QueryStringParametersList GetQueryStringParameters()

Returns

QueryStringParametersList

The parameters to include in the request URL.