0-CodeKit icon

0-CodeKit

A toolbox of no-code utilities

Overview

The Calculate → Geodistance operation in the 0-CodeKit n8n node calculates the geographical distance between two locations. This is useful for workflows that require measuring the straight-line (as-the-crow-flies) distance between cities, addresses, or coordinates. Common scenarios include logistics planning, travel estimations, mapping applications, and any automation where knowing the distance between two points is valuable.

Example use cases:

  • Determining the distance between a user's address and a service location.
  • Calculating delivery distances for logistics optimization.
  • Enriching datasets with geodistance information for analytics.

Properties

Name Meaning
Starting Location The starting point for the distance calculation. Accepts a city name, address, or coordinates.
Ending Location The ending point for the distance calculation. Accepts a city name, address, or coordinates.

Output

The output will be a JSON object containing the result of the geodistance calculation. While the exact structure depends on the API response, you can expect fields such as:

{
  "distance": 307.5,
  "unit": "km",
  "startPoint": "Berlin",
  "endPoint": "Flensburg"
}
  • distance: The calculated distance between the two locations.
  • unit: The unit of measurement (typically kilometers or miles).
  • startPoint: Echoes the input starting location.
  • endPoint: Echoes the input ending location.

Note: The actual field names may vary depending on the backend service.

Dependencies

  • External Service: Requires access to the CodeKit API endpoint for geodistance calculations.
  • API Key: You must configure the codeKitApi credential in n8n for authentication.

Troubleshooting

  • Invalid Locations: If the provided locations are not recognized, the node may return an error or a distance of zero. Ensure you use valid city names, addresses, or coordinates.
  • Authentication Errors: Missing or incorrect API credentials will result in authentication errors. Double-check your codeKitApi configuration.
  • Service Unavailable: If the external API is down or unreachable, the node will throw a connection error. Try again later or check your network settings.

Common error messages:

  • Error: Invalid location format: Check that both locations are spelled correctly and are valid.
  • 401 Unauthorized: Verify your API key in the n8n credentials.
  • Network Error: Ensure n8n can reach the CodeKit API endpoint.

Links and References

Discussion