Copyright | (c) 2013-2023 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Geocodes free-form text, such as an address, name, city, or region to allow you to search for Places or points of interest.
Optional parameters let you narrow your search results by bounding box or country, or bias your search toward a specific position on the globe.
You can search for places near a given position using BiasPosition
, or
filter results within a bounding box using FilterBBox
. Providing both
parameters simultaneously returns an error.
Search results are returned in order of highest to lowest relevance.
Synopsis
- data SearchPlaceIndexForText = SearchPlaceIndexForText' {}
- newSearchPlaceIndexForText :: Text -> Text -> SearchPlaceIndexForText
- searchPlaceIndexForText_biasPosition :: Lens' SearchPlaceIndexForText (Maybe (NonEmpty Double))
- searchPlaceIndexForText_filterBBox :: Lens' SearchPlaceIndexForText (Maybe (NonEmpty Double))
- searchPlaceIndexForText_filterCountries :: Lens' SearchPlaceIndexForText (Maybe (NonEmpty Text))
- searchPlaceIndexForText_language :: Lens' SearchPlaceIndexForText (Maybe Text)
- searchPlaceIndexForText_maxResults :: Lens' SearchPlaceIndexForText (Maybe Natural)
- searchPlaceIndexForText_indexName :: Lens' SearchPlaceIndexForText Text
- searchPlaceIndexForText_text :: Lens' SearchPlaceIndexForText Text
- data SearchPlaceIndexForTextResponse = SearchPlaceIndexForTextResponse' {}
- newSearchPlaceIndexForTextResponse :: Int -> SearchPlaceIndexForTextSummary -> SearchPlaceIndexForTextResponse
- searchPlaceIndexForTextResponse_httpStatus :: Lens' SearchPlaceIndexForTextResponse Int
- searchPlaceIndexForTextResponse_results :: Lens' SearchPlaceIndexForTextResponse [SearchForTextResult]
- searchPlaceIndexForTextResponse_summary :: Lens' SearchPlaceIndexForTextResponse SearchPlaceIndexForTextSummary
Creating a Request
data SearchPlaceIndexForText Source #
See: newSearchPlaceIndexForText
smart constructor.
SearchPlaceIndexForText' | |
|
Instances
newSearchPlaceIndexForText Source #
Create a value of SearchPlaceIndexForText
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
SearchPlaceIndexForText
, searchPlaceIndexForText_biasPosition
- An optional parameter that indicates a preference for places that are
closer to a specified position.
If provided, this parameter must contain a pair of numbers. The first number represents the X coordinate, or longitude; the second number represents the Y coordinate, or latitude.
For example, [-123.1174, 49.2847]
represents the position with
longitude -123.1174
and latitude 49.2847
.
BiasPosition
and FilterBBox
are mutually exclusive. Specifying both
options results in an error.
SearchPlaceIndexForText
, searchPlaceIndexForText_filterBBox
- An optional parameter that limits the search results by returning only
places that are within the provided bounding box.
If provided, this parameter must contain a total of four consecutive numbers in two pairs. The first pair of numbers represents the X and Y coordinates (longitude and latitude, respectively) of the southwest corner of the bounding box; the second pair of numbers represents the X and Y coordinates (longitude and latitude, respectively) of the northeast corner of the bounding box.
For example, [-12.7935, -37.4835, -12.0684, -36.9542]
represents a
bounding box where the southwest corner has longitude -12.7935
and
latitude -37.4835
, and the northeast corner has longitude -12.0684
and latitude -36.9542
.
FilterBBox
and BiasPosition
are mutually exclusive. Specifying both
options results in an error.
SearchPlaceIndexForText
, searchPlaceIndexForText_filterCountries
- An optional parameter that limits the search results by returning only
places that are in a specified list of countries.
- Valid values include
ISO 3166 3-digit
country codes. For example, Australia uses three upper-case
characters:
AUS
.
SearchPlaceIndexForText
, searchPlaceIndexForText_language
- The preferred language used to return results. The value must be a valid
BCP 47 language tag, for example,
en
for English.
This setting affects the languages used in the results, but not the results themselves. If no language is specified, or not supported for a particular result, the partner automatically chooses a language for the result.
For an example, we'll use the Greek language. You search for
Athens, Greece
, with the language
parameter set to en
. The result
found will most likely be returned as Athens
.
If you set the language
parameter to el
, for Greek, then the result
found will more likely be returned as Αθήνα
.
If the data provider does not have a value for Greek, the result will be in a language that the provider does support.
SearchPlaceIndexForText
, searchPlaceIndexForText_maxResults
- An optional parameter. The maximum number of results returned per
request.
The default: 50
SearchPlaceIndexForText
, searchPlaceIndexForText_indexName
- The name of the place index resource you want to use for the search.
SearchPlaceIndexForText
, searchPlaceIndexForText_text
- The address, name, city, or region to be used in the search in free-form
text format. For example, 123 Any Street
.
Request Lenses
searchPlaceIndexForText_biasPosition :: Lens' SearchPlaceIndexForText (Maybe (NonEmpty Double)) Source #
An optional parameter that indicates a preference for places that are closer to a specified position.
If provided, this parameter must contain a pair of numbers. The first number represents the X coordinate, or longitude; the second number represents the Y coordinate, or latitude.
For example, [-123.1174, 49.2847]
represents the position with
longitude -123.1174
and latitude 49.2847
.
BiasPosition
and FilterBBox
are mutually exclusive. Specifying both
options results in an error.
searchPlaceIndexForText_filterBBox :: Lens' SearchPlaceIndexForText (Maybe (NonEmpty Double)) Source #
An optional parameter that limits the search results by returning only places that are within the provided bounding box.
If provided, this parameter must contain a total of four consecutive numbers in two pairs. The first pair of numbers represents the X and Y coordinates (longitude and latitude, respectively) of the southwest corner of the bounding box; the second pair of numbers represents the X and Y coordinates (longitude and latitude, respectively) of the northeast corner of the bounding box.
For example, [-12.7935, -37.4835, -12.0684, -36.9542]
represents a
bounding box where the southwest corner has longitude -12.7935
and
latitude -37.4835
, and the northeast corner has longitude -12.0684
and latitude -36.9542
.
FilterBBox
and BiasPosition
are mutually exclusive. Specifying both
options results in an error.
searchPlaceIndexForText_filterCountries :: Lens' SearchPlaceIndexForText (Maybe (NonEmpty Text)) Source #
An optional parameter that limits the search results by returning only places that are in a specified list of countries.
- Valid values include
ISO 3166 3-digit
country codes. For example, Australia uses three upper-case
characters:
AUS
.
searchPlaceIndexForText_language :: Lens' SearchPlaceIndexForText (Maybe Text) Source #
The preferred language used to return results. The value must be a valid
BCP 47 language tag, for example,
en
for English.
This setting affects the languages used in the results, but not the results themselves. If no language is specified, or not supported for a particular result, the partner automatically chooses a language for the result.
For an example, we'll use the Greek language. You search for
Athens, Greece
, with the language
parameter set to en
. The result
found will most likely be returned as Athens
.
If you set the language
parameter to el
, for Greek, then the result
found will more likely be returned as Αθήνα
.
If the data provider does not have a value for Greek, the result will be in a language that the provider does support.
searchPlaceIndexForText_maxResults :: Lens' SearchPlaceIndexForText (Maybe Natural) Source #
An optional parameter. The maximum number of results returned per request.
The default: 50
searchPlaceIndexForText_indexName :: Lens' SearchPlaceIndexForText Text Source #
The name of the place index resource you want to use for the search.
searchPlaceIndexForText_text :: Lens' SearchPlaceIndexForText Text Source #
The address, name, city, or region to be used in the search in free-form
text format. For example, 123 Any Street
.
Destructuring the Response
data SearchPlaceIndexForTextResponse Source #
See: newSearchPlaceIndexForTextResponse
smart constructor.
SearchPlaceIndexForTextResponse' | |
|
Instances
newSearchPlaceIndexForTextResponse Source #
Create a value of SearchPlaceIndexForTextResponse
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:httpStatus:SearchPlaceIndexForTextResponse'
, searchPlaceIndexForTextResponse_httpStatus
- The response's http status code.
$sel:results:SearchPlaceIndexForTextResponse'
, searchPlaceIndexForTextResponse_results
- A list of Places matching the input text. Each result contains
additional information about the specific point of interest.
Not all response properties are included with all responses. Some properties may only be returned by specific data partners.
$sel:summary:SearchPlaceIndexForTextResponse'
, searchPlaceIndexForTextResponse_summary
- Contains a summary of the request. Echoes the input values for
BiasPosition
, FilterBBox
, FilterCountries
, Language
,
MaxResults
, and Text
. Also includes the DataSource
of the place
index and the bounding box, ResultBBox
, which surrounds the search
results.
Response Lenses
searchPlaceIndexForTextResponse_httpStatus :: Lens' SearchPlaceIndexForTextResponse Int Source #
The response's http status code.
searchPlaceIndexForTextResponse_results :: Lens' SearchPlaceIndexForTextResponse [SearchForTextResult] Source #
A list of Places matching the input text. Each result contains additional information about the specific point of interest.
Not all response properties are included with all responses. Some properties may only be returned by specific data partners.
searchPlaceIndexForTextResponse_summary :: Lens' SearchPlaceIndexForTextResponse SearchPlaceIndexForTextSummary Source #
Contains a summary of the request. Echoes the input values for
BiasPosition
, FilterBBox
, FilterCountries
, Language
,
MaxResults
, and Text
. Also includes the DataSource
of the place
index and the bounding box, ResultBBox
, which surrounds the search
results.