SkillAgentSearch skills...

geospatial-routing-data

Geospatial routing data handling for depot and station coordinates, route node IDs, internal index mappings, great-circle distance matrices, and route-distance reconstruction

Install / Use

npx skills add benchflow-ai/skillsbench --skill geospatial-routing-data

Installs into whichever agent you are using.

About this skill
📄

SKILL.md

Installable skill definition

Quality Score

85/100

Supported Platforms

Universal

Our assessment of geospatial-routing-data

geospatial-routing-data scores 85/100 on our quality scale, 2541st of 4,698 Development & Engineering skills we index.

Its SKILL.md is 5.7 KB long, well organised into 8 sections with 11 code examples: a solid amount of guidance for an agent.

With 1,813 GitHub stars, it is one of the more widely adopted skills in the catalogue.

Substance
26/30
Structure
20/20
Description
15/15
Adoption
14/20
Freshness
11/15

Maintenance, license and trust

  • The repository was last updated about 4 months ago. That is recent enough to be usable, but agent tooling moves fast, so check the instructions against your agent's current version.
  • Our last check on 2026-11-04 found the source still online.
  • It is released under the Apache-2.0 license, a permissive license that allows use, modification and commercial use with attribution.
  • Its trust signals score 98/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.

Safety scan

No issues found

Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.

AI review by kimi-k2.7-code on 2026-10-02. Automated pattern scan on 2026-10-02. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.

geospatial-routing-data compared with similar skills

All 4 of these similar skills score higher than geospatial-routing-data; compare them before choosing.

SkillScoreStarsUpdatedFormat
geospatial-routing-data (this skill)by benchflow-ai851.8k4mo agoSKILL.md
taste-skillby Leonxlnx100116.8k8d agoCLAUDE.md
Agent-Reachby Panniantong100112.3k8d agoCLAUDE.md
ai-job-searchby ai-job-search-dev10072.1ktodayCLAUDE.md
claude-howtoby luongnv8910047.3k2d agoCLAUDE.md

Frequently asked questions

How do I install geospatial-routing-data?
Run npx skills add benchflow-ai/skillsbench --skill geospatial-routing-data. The install tabs above show the steps for each supported agent.
Which AI agents does geospatial-routing-data work with?
It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
Is geospatial-routing-data safe to use?
Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It is Apache-2.0-licensed and scores 98/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
Is geospatial-routing-data still maintained?
The repository was last updated about 4 months ago. That is recent enough to be usable, but agent tooling moves fast, so check the instructions against your agent's current version.

name: geospatial-routing-data description: Geospatial routing data handling for depot and station coordinates, route node IDs, internal index mappings, great-circle distance matrices, and route-distance reconstruction. Use when optimization or reporting tasks involve latitude/longitude, station IDs, depots, distance metrics, vehicle routes, or validating travel distance from reported paths.

Geospatial Routing Data

Use this skill before building a routing model or validating a routing report that contains coordinates, depots, station IDs, and route sequences.

The main risk is mixing user-facing IDs with internal array indices or using a different distance metric from the task.

Parse Data Safely

Load structured data with a parser and build explicit mappings:

import json
from pathlib import Path

data = json.loads(Path("/root/data.json").read_text())
stations_data = data["stations"]

station_ids = [int(s["id"]) for s in stations_data]
if len(station_ids) != len(set(station_ids)):
    raise ValueError("duplicate station ids")

id_to_idx = {sid: idx for idx, sid in enumerate(station_ids)}
idx_to_id = {idx: sid for sid, idx in id_to_idx.items()}

Use internal indices in optimization variables. Use original station IDs in final reports.

Coordinate Validation

Check coordinates before building distances:

def parse_location(record, label):
    lat = float(record["latitude"])
    lon = float(record["longitude"])
    if not (-90.0 <= lat <= 90.0):
        raise ValueError(f"{label} latitude out of range: {lat}")
    if not (-180.0 <= lon <= 180.0):
        raise ValueError(f"{label} longitude out of range: {lon}")
    return {"latitude": lat, "longitude": lon}

depot = parse_location(data["depot"], "depot")
station_locations = [parse_location(s, f"station {s['id']}") for s in stations_data]

Latitude and longitude are degrees. Convert to radians only inside the distance function.

Great-Circle Distance

Match the task's declared distance metric. If the task specifies an Earth radius, use that exact value.

For great-circle miles with Earth radius 3960.0, use:

import math

def great_circle_miles(a, b, radius=3960.0):
    lat1 = float(a["latitude"])
    lon1 = float(a["longitude"])
    lat2 = float(b["latitude"])
    lon2 = float(b["longitude"])

    deg_to_rad = math.pi / 180.0
    phi1 = (90.0 - lat1) * deg_to_rad
    phi2 = (90.0 - lat2) * deg_to_rad
    theta1 = lon1 * deg_to_rad
    theta2 = lon2 * deg_to_rad

    cos_arc = (
        math.sin(phi1) * math.sin(phi2) * math.cos(theta1 - theta2)
        + math.cos(phi1) * math.cos(phi2)
    )
    cos_arc = max(-1.0, min(1.0, cos_arc))
    return math.acos(cos_arc) * radius

Clamp cos_arc into [-1, 1] to avoid floating-point domain errors.

Do not mix:

  • Euclidean distance on degrees;
  • haversine with a different Earth radius;
  • miles and meters;
  • rounded distances inside the optimization objective.

Build Routing Nodes

Use separate depot labels when the route output must show a start and end depot:

START = "depot_start"
END = "depot_end"

stations = range(len(stations_data))
from_nodes = [START, *stations]
to_nodes = [*stations, END]

def node_location(node):
    if node in (START, END):
        return depot
    return station_locations[int(node)]

Build distances over the same arc set used by the optimization model:

distances = {}
for i in from_nodes:
    for j in to_nodes:
        if i == j:
            continue
        if i == START and j == END:
            continue  # omit if vehicles must visit at least one station
        distances[i, j] = great_circle_miles(node_location(i), node_location(j))

If direct depot-to-depot travel is allowed, keep the (START, END) arc.

Convert Routes Between IDs and Indices

Optimization route using internal indices:

route_nodes = [START, 3, 7, 2, END]

Report route using original station IDs:

report_route = [
    node if isinstance(node, str) else idx_to_id[int(node)]
    for node in route_nodes
]

Parse a reported route back to internal indices:

def parse_report_route(route):
    if route[0] != START or route[-1] != END:
        raise ValueError("route must start at depot_start and end at depot_end")

    parsed = [START]
    for raw in route[1:-1]:
        sid = int(raw)
        if sid not in id_to_idx:
            raise ValueError(f"unknown station id {sid}")
        parsed.append(id_to_idx[sid])
    parsed.append(END)
    return parsed

Never assume station IDs are 0..n-1.

Reconstruct Route Distance

Recompute reported travel distance from route sequences:

def pairwise(items):
    return list(zip(items, items[1:]))

def route_distance_internal(route_nodes):
    total = 0.0
    for i, j in pairwise(route_nodes):
        total += distances[i, j]
    return total

def route_distance_reported_ids(route):
    internal = parse_report_route(route)
    return route_distance_internal(internal)

For multiple vehicles:

travel_distance = sum(
    route_distance_reported_ids(vehicle["route"])
    for vehicle in report["vehicles"]
)

Compare with tolerance, not exact string equality:

def assert_close(actual, expected, tol=1e-6):
    if abs(actual - expected) > max(tol, tol * max(1.0, abs(expected))):
        raise AssertionError(f"{actual} != {expected}")

Route Data Checks

Before trusting a route:

  • first node is the start depot label;
  • last node is the end depot label;
  • every non-depot node is a known station ID;
  • route has at least one station if vehicles cannot stay at the depot;
  • station sequence length equals the stop list length;
  • no repeated station within a route when per-vehicle no-repeat is required;
  • distance is recomputed from coordinates, not copied from model output.

Related Skills

View on GitHub
GitHub Stars1.8k
CategoryDevelopment
Updated3mo ago
Forks368

Languages

PDDL

Trust signals

98/100

From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.

1 info
geospatial-routing-data — Universal Skill: Install & Safety Check | SkillAgent