Actions40
- AI Actions
- Business Actions
- Calculate Actions
- Code Actions
- Convert Actions
- Crypto Actions
- Generate Actions
- Operator Actions
- PDF Actions
- Storage Actions
Calculate → Geodistance
AI-generatedOverview
This node calculates the geographical distance between two locations using the "Geodistance" operation under the "Calculate" resource. It is useful in scenarios where you need to determine the distance (likely as-the-crow-flies) between two cities or addresses, for example:
- Calculating travel distances for logistics and delivery planning.
- Estimating proximity between customer and service locations.
- Enriching datasets with geospatial information.
Practical Example:
Given "Berlin" as the starting location and "Flensburg" as the ending location, the node will return the distance between these two places.
Properties
| Name | Meaning |
|---|---|
| Starting Location | The name or address of the starting point for the distance calculation (e.g., "Berlin"). |
| Ending Location | The name or address of the destination point (e.g., "Flensburg"). |
Output
The output will be a JSON object containing the result of the geodistance calculation. While the exact structure depends on the API response, it typically includes fields such as:
{
"distance": 357.2,
"unit": "km",
"startPoint": "Berlin",
"endPoint": "Flensburg"
}
distance: The calculated distance between the two points.unit: The unit of measurement (e.g., kilometers).startPoint: The resolved starting location.endPoint: The resolved ending location.
Dependencies
- External Service: Requires access to the CodeKit API.
- Credentials: You must configure the
codeKitApicredential in n8n for authentication.
Troubleshooting
Missing Credentials:
Error Message: "No credentials found for codeKitApi."
Resolution: Ensure that thecodeKitApicredential is set up in your n8n instance.Invalid Locations:
Error Message: "Location not found" or similar.
Resolution: Double-check the spelling and format of the provided locations.API Errors or Timeouts:
Error Message: "Request failed with status code..."
Resolution: Check your network connection and ensure the external API is reachable.
Links and References
- n8n Documentation: Custom Nodes
- Geodistance Concepts (Wikipedia)
- CodeKit API Documentation (Replace with actual link if available)