createPlaceIndex method
SearchPlaceIndexForText operation, and reverse geocode
coordinates by using the SearchPlaceIndexForPosition
operation, and enable autosuggestions by using the
SearchPlaceIndexForSuggestions operation.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter dataSource :
Specifies the geospatial data provider for the new place index.
Valid values include:
-
Esri– For additional information about Esri's coverage in your region of interest, see Esri details on geocoding coverage. -
Grab– Grab provides place index functionality for Southeast Asia. For additional information about GrabMaps' coverage, see GrabMaps countries and areas covered. -
Here– For additional information about HERE Technologies' coverage in your region of interest, see HERE details on goecoding coverage.
Parameter indexName :
The name of the place index resource.
Requirements:
- Contain only alphanumeric characters (A–Z, a–z, 0–9), hyphens (-), periods (.), and underscores (_).
- Must be a unique place index resource name.
-
No spaces allowed. For example,
ExamplePlaceIndex.
Parameter dataSourceConfiguration :
Specifies the data storage option requesting Places.
Parameter description :
The optional description for the place index resource.
Parameter pricingPlan :
No longer used. If included, the only allowed value is
RequestBasedUsage.
Parameter tags :
Applies one or more tags to the place index resource. A tag is a key-value
pair that helps you manage, identify, search, and filter your resources.
Format: "key" : "value"
Restrictions:
- Maximum 50 tags per resource.
- Each tag key must be unique and must have exactly one associated value.
- Maximum key length: 128 Unicode characters in UTF-8.
- Maximum value length: 256 Unicode characters in UTF-8.
- Can use alphanumeric characters (A–Z, a–z, 0–9), and the following characters: + - = . _ : / @
- Cannot use "aws:" as a prefix for a key.
Implementation
Future<CreatePlaceIndexResponse> createPlaceIndex({
required String dataSource,
required String indexName,
DataSourceConfiguration? dataSourceConfiguration,
String? description,
PricingPlan? pricingPlan,
Map<String, String>? tags,
}) async {
final $payload = <String, dynamic>{
'DataSource': dataSource,
'IndexName': indexName,
if (dataSourceConfiguration != null)
'DataSourceConfiguration': dataSourceConfiguration,
if (description != null) 'Description': description,
if (pricingPlan != null) 'PricingPlan': pricingPlan.value,
if (tags != null) 'Tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/places/v0/indexes',
exceptionFnMap: _exceptionFns,
);
return CreatePlaceIndexResponse.fromJson(response);
}