
Overview
GeoRouteGoogle and GeoRouteHere provide high‑quality turn‑by‑turn routing using Google Maps Platform and HERE Technologies engines, respectively. While the legacy /api/georoute
(Bing Maps) has been retired, these two endpoints deliver reliable distance, duration, and step‑by‑step directions between origins and destinations via a single HTTP request.
Key Business Use Cases
1. Last‑Mile Delivery Optimization
Use live routing responses to assign drivers the fastest or shortest routes—integrate real‑time traffic data via Google or HERE to minimize delays and fuel consumption.
2. On‑Demand Ride‑Hailing & Logistics
Calculate precise pickup‑to‑dropoff routes for passenger or parcel services, choosing Google’s global coverage or HERE’s advanced lane‑level guidance where needed.
3. Field Service & Dispatching
Empower dispatch systems with optimal route plans for technicians, incorporating waypoints, avoidances, and ETA calculations from the chosen provider.
Developer Spotlight: C# Code Snippet
// GeoRouteGoogle C# example
using System;
using System.Net.Http;
using System.Text.Json;
using System.Threading.Tasks;
namespace CDXGeoDataSample
{
class Program
{
static async Task Main()
{
var apiKey = Environment.GetEnvironmentVariable("CDX_GEO_KEY");
var originLat = 47.6062; // Seattle
var originLon = -122.3321;
var destLat = 47.6205; // Space Needle
var destLon = -122.3493;
var format = "json";
var serviceParam = "google"; // or "here"
var url = $"https://geodata.cdxtech.com/api/georoute" +
$"?key={apiKey}" +
$"&service={serviceParam}" +
$"&origin={originLat},{originLon}" +
$"&destination={destLat},{destLon}" +
$"&format={format}";
using var client = new HttpClient();
var response = await client.GetAsync(url);
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
var root = JsonDocument.Parse(json).RootElement;
var route = root.GetProperty("routes")[0];
var distance = route.GetProperty("distance").GetDouble();
var duration = route.GetProperty("duration").GetDouble();
Console.WriteLine($"Distance: {distance} {route.GetProperty("distanceUnit").GetString()}");
Console.WriteLine($"Duration: {TimeSpan.FromSeconds(duration)}");
Console.WriteLine("Steps:");
foreach (var step in route.GetProperty("legs")[0].GetProperty("steps").EnumerateArray())
{
Console.WriteLine($" - {step.GetProperty("instruction").GetString()} " +
$"({step.GetProperty("distance").GetDouble()} {step.GetProperty("distanceUnit").GetString()})");
}
}
}
}
Sample Response
{
"service": "GeoRouteGoogle",
"routes": [
{
"distance": 3.2,
"distanceUnit": "miles",
"duration": 540,
"legs": [
{
"steps": [
{ "instruction": "Head north on 4th Ave", "distance": 0.2, "distanceUnit": "miles" },
{ "instruction": "Turn right onto Pike St", "distance": 0.5, "distanceUnit": "miles" },
// ...
]
}
]
}
],
"tokenCharge": 10
}
Getting Started
- Sign up for a free CDXGeoData account and grab your API key.
- Decide on your routing engine:
service=google
for Google Maps Platform or service=here
for HERE Technologies.
- Invoke
GET /api/georoute
with key
, service
, origin
, destination
, and format
.
- Parse the
routes
array for distance, duration, and step‑by‑step instructions.