Geospatial Routing Data logo

Geospatial Routing Data

OrganizationPopular
benchflow-ai
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. Use when optimization or reporting tasks involve latitude/longitude, station IDs, depots, distance metrics, vehicle routes, or validating travel distance from reported paths.

Overview

Publisherbenchflow-ai
Repositoryskillsbench
Skill namegeospatial-routing-data
Stars
1.8K
Forks
367
Bundled files
Instructions only
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by benchflow-ai on GitHub. Read the source before you install it.

Installation

Install the Geospatial Routing Data AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/benchflow-ai/skillsbench.git /tmp/skillsbench
mkdir -p .claude/skills
cp -r /tmp/skillsbench/tasks/bike-rebalance/environment/skills/geospatial-routing-data .claude/skills/geospatial-routing-data
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Geospatial Routing Data in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Geospatial Routing Data on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Geospatial Routing Data is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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:

python
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:

python
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:

python
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:

python
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:

python
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:

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

Report route using original station IDs:

python
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:

python
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:

python
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:

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

Compare with tolerance, not exact string equality:

python
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.

Frequently asked questions

What does the Geospatial Routing Data AI skill do?

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.

Why use Geospatial Routing Data on TypingMind?

Because you install it once and use it with any model. Geospatial Routing Data is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Geospatial Routing Data in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/benchflow-ai/skillsbench/tree/main/tasks/bike-rebalance/environment/skills/geospatial-routing-data. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Geospatial Routing Data?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Geospatial Routing Data?

As many as you like. As long as a model supports skills, you can use Geospatial Routing Data with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Geospatial Routing Data AI skill free?

Yes. It is published on GitHub by benchflow-ai under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇