I tried to create a route with AWS LocationService. But when I run my code I get an error and I don't understand what it means…
Can you help me to understand what I did wrong?
Am I missing some credentials?
But even if I use the SearchPlaceIndexForPosition I get some information about the position. So I don't think it's a credential issue...
import boto3
location=boto3.client("location",region_name="eu-central-1")
response = location.calculate_route(CalculatorName='Default',
DeparturePosition=[10.00759,53.54930], # Hamburg
DestinationPosition=[6.95703,50.94176] # Cologne
)
ResourceNotFoundException Traceback (most recent call last)
File <command-12586>:3
1 import boto3
2 location=boto3.client("location",region_name="eu-central-1")
----> 3 response = location.calculate_route(CalculatorName='Default',
4 DeparturePosition=[10.00759,53.54930],
5 DestinationPosition=[9.9672534, 53.54617]
6 )
File /databricks/python/lib/python3.9/site-packages/botocore/client.py:401, in ClientCreator._create_api_method.<locals>._api_call(self, *args, **kwargs)
398 raise TypeError(
399 "%s() only accepts keyword arguments." % py_operation_name)
400 # The "self" in this scope is referring to the BaseClient.
--> 401 return self._make_api_call(operation_name, kwargs)
File /databricks/python/lib/python3.9/site-packages/botocore/client.py:731, in BaseClient._make_api_call(self, operation_name, api_params)
729 error_code = parsed_response.get("Error", {}).get("Code")
730 error_class = self.exceptions.from_code(error_code)
--> 731 raise error_class(parsed_response, operation_name)
732 else:
733 return parsed_response
ResourceNotFoundException: An error occurred (ResourceNotFoundException) when calling the CalculateRoute operation: Resource not found