

Die vorliegende Übersetzung wurde maschinell erstellt. Im Falle eines Konflikts oder eines Widerspruchs zwischen dieser übersetzten Fassung und der englischen Fassung (einschließlich infolge von Verzögerungen bei der Übersetzung) ist die englische Fassung maßgeblich.

# So geokodieren Sie in einer bestimmten Sprache
<a name="how-to-geocode-specific-language"></a>

Diese Funktion ermöglicht die Auswahl einer bevorzugten Antwortsprache aus BCP47 -kompatiblen Codes. Es erkennt die Abfragesprache anhand von Namensvarianten und verwendet die bevorzugte Sprache für nicht übereinstimmende Token und mehrdeutige Fälle. Wenn es keine angeforderte Sprache gibt, liefert die **Places-API** Ergebnisse in der offiziellen Landessprache, priorisiert jedoch die Regionalsprache in Regionen, in denen sie sich unterscheidet. Als Ausweichstrategie gibt **Places** APIs Adressen in der Standardsprache zurück, wenn Adresselemente in der angeforderten Sprache nicht verfügbar sind.

## Mögliche Anwendungsfälle
<a name="potential-use-geocode-language"></a>

Ein möglicher Anwendungsfall besteht darin, die Abfrage und and/or das Ergebnis zu lokalisieren.

## Beispiele
<a name="geocode-language-examples"></a>

### Ergebnis in einer bestimmten Sprache abrufen
<a name="geocode-language-result"></a>

------
#### [ Sample request ]

```
{
    "QueryText":"Patna, Bihar, Bharat",
    "Language": "HI"
}
```

------
#### [ Sample response ]

```
{
    "ResultItems": [
        {
            "PlaceId": "<Redacted>",
            "PlaceType": "Locality",
            "Title": "पटना, बिहार, भारत",
            "Address": {
                "Label": "पटना, बिहार, भारत",
                "Country": {
                    "Code2": "IN",
                    "Code3": "IND",
                    "Name": "भारत"
                },
                "Region": {
                    "Code": "BR",
                    "Name": "बिहार"
                },
                "SubRegion": {
                    "Name": "पटना"
                },
                "Locality": "पटना",
                "PostalCode": "800001"
            },
            "Position": [
                85.13752,
                25.60134
            ],
            "MapView": [
                85.03222,
                25.55157,
                85.27107,
                25.65917
            ],
            "MatchScores": {
                "Overall": 1,
                "Components": {
                    "Address": {
                        "Country": 1,
                        "Region": 1,
                        "Locality": 1
                    }
                }
            }
        }
    ]
}
```

------
#### [ cURL ]

```
curl --request POST \
  --url 'https://places.geo.eu-central-1.amazonaws.com/v2/geocode?key=Your_Key' \
  --header 'Content-Type: application/json' \
  --data '{
    "QueryText":"Patna, Bihar, Bharat",
    "Language": "HI"
}'
```

------
#### [ AWS CLI ]

```
aws geo-places geocode --key ${YourKey} --query-text "पटना, बिहार, भारत" --language "HI"
```

------

### Frage in einer bestimmten Sprache ab
<a name="geocode-language-query"></a>

------
#### [ Sample request ]

```
{
    "QueryText":"पटना, बिहार, भारत"
}
```

------
#### [ Sample response ]

```
{
    "ResultItems": [
        {
            "PlaceId": "<Redacted>",
            "PlaceType": "Locality",
            "Title": "Patana, Bihar, Bharat",
            "Address": {
                "Label": "Patana, Bihar, Bharat",
                "Country": {
                    "Code2": "IN",
                    "Code3": "IND",
                    "Name": "Bharat"
                },
                "Region": {
                    "Code": "BR",
                    "Name": "Bihar"
                },
                "SubRegion": {
                    "Name": "Patana"
                },
                "Locality": "Patana",
                "PostalCode": "800001"
            },
            "Position": [
                85.13752,
                25.60134
            ],
            "MapView": [
                85.03222,
                25.55157,
                85.27107,
                25.65917
            ],
            "MatchScores": {
                "Overall": 1,
                "Components": {
                    "Address": {
                        "Country": 1,
                        "Region": 1,
                        "Locality": 1
                    }
                }
            }
        }
    ]
}
```

------
#### [ cURL ]

```
curl --request POST \
  --url 'https://places.geo.eu-central-1.amazonaws.com/v2/geocode?key=Your_Key' \
  --header 'Content-Type: application/json' \
  --data '{
    "QueryText":"पटना, बिहार, भारत"
}'
```

------
#### [ AWS CLI ]

```
aws geo-places geocode --key ${YourKey} --query-text "पटना, बिहार, भारत"
```

------

### Abfrage und Ergebnis in einer bestimmten Sprache
<a name="geocode-language-query-result"></a>

------
#### [ Sample request ]

```
{
    "QueryText":"पटना, बिहार, भारत",
    "Language": "HI"
}
```

------
#### [ Sample response ]

```
{
    "ResultItems": [
        {
            "PlaceId": "<Redacted>",
            "PlaceType": "Locality",
            "Title": "पटना, बिहार, भारत",
            "Address": {
                "Label": "पटना, बिहार, भारत",
                "Country": {
                    "Code2": "IN",
                    "Code3": "IND",
                    "Name": "भारत"
                },
                "Region": {
                    "Code": "BR",
                    "Name": "बिहार"
                },
                "SubRegion": {
                    "Name": "पटना"
                },
                "Locality": "पटना",
                "PostalCode": "800001"
            },
            "Position": [
                85.13752,
                25.60134
            ],
            "MapView": [
                85.03222,
                25.55157,
                85.27107,
                25.65917
            ],
            "MatchScores": {
                "Overall": 1,
                "Components": {
                    "Address": {
                        "Country": 1,
                        "Region": 1,
                        "Locality": 1
                    }
                }
            }
        }
    ]
}
```

------
#### [ cURL ]

```
curl --request POST \
  --url 'https://places.geo.eu-central-1.amazonaws.com/v2/geocode?key=Your_Key' \
  --header 'Content-Type: application/json' \
  --data '{
    "QueryText":"पटना, बिहार, भारत",
    "Language": "HI"
}'
```

------
#### [ AWS CLI ]

```
aws geo-places geocode --key ${YourKey} --query-text "पटना, बिहार, भारत" --language "HI"
```

------