# Route Stationing Calculator AI Agent Connect

> Route Stationing Calculator MCP handles the math for projecting spatial points onto ordered routes. It calculates station values, segment indices, and offsets, allowing your AI client to perform complex linear referencing and spatial analysis on road networks without manual coordinate math.

## Overview
- **Category:** engineering
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_NYHZjDqfsOjlPcYC7VTh3kh04iCPVEa94XhvHncD/ai-agent-connect
- **Tags:** polyline, stationing, chainage, linear-reference, spatial-analysis

## Description

You can use this MCP to automate the tedious process of assigning stationing to spatial data. Instead of manually calculating distances along a polyline, you tell your AI client where a point is, and it determines exactly where that point sits on the route. This includes finding the specific segment, the station value, and the offset from the start of that segment. 

Whether you are working with highway alignments or utility corridors, this tool handles the geometry. You can pull high-level summaries of a route's total length or drill down into specific segments to see their individual metrics. It turns raw coordinate data into actionable linear references that fit standard engineering workflows. Your agent can now query specific coordinates to find their nearest station or project entire sets of points onto a path in one go.

## Tools

### find_nearest_station
This tool locates the specific stationing information for a single target coordinate. It is used for quick lookups of a single point's position on a route.

### calculate_stationing
This tool projects a set of points onto a route to find their linear reference data. It returns station values, segment indices, and offsets for each point provided.

### get_route_summary
This tool provides high-level metrics for the entire route. It returns the total length and details regarding the route's complexity.

### get_segment_metrics
This tool analyzes specific parts of a route. You use it to find the length or the stationing range of an individual segment.

## Prompt Examples

**Prompt:** 
```
Calculate the stationing for these points: [{"x": 10, "y": 10}, {"x": 20, "y": 20}] along this route: [{"x": 0, "y": 0}, {"x": 50, "y": 50}]
```

**Response:** 
```
The points have been projected. Point 1 is at station 14.14m (segment 0) and Point 2 is at station 28.28m (segment 0).
```

**Prompt:** 
```
What is the total length of a route defined by points (0,0), (100,0), and (100,100)?
```

**Response:** 
```
The total length of the route is 200.0 units.
```

**Prompt:** 
```
Find the station for the coordinate (5, 5) on a route from (0,0) to (10,10).
```

**Response:** 
```
The coordinate (5, 5) is located at station 7.07 on segment 0.
```

## Capabilities

### Linear Referencing
Your agent converts raw XY coordinates into station and offset values along a polyline.

### Bulk Point Projection
Your agent processes multiple points at once to find their positions on a specific route.

### Route Summarization
Your agent retrieves the total length and complexity of a defined path.

### Segment Analysis
Your agent calculates the specific length and stationing range for individual segments within a route.

### Single Point Lookup
Your agent finds the nearest station for a specific coordinate instantly.

## Use Cases

### Roadway Design
Assign stationing to design elements along a highway centerline.

### Asset Management
Locate specific infrastructure assets by finding their station and offset on a route.

### Survey Data Processing
Project survey points onto a polyline to determine their exact position on a corridor.

### Corridor Analysis
Analyze the length and complexity of specific segments within a long linear route.

## Benefits

- Eliminates manual distance calculations along complex polylines.
- Converts raw spatial coordinates into standard engineering stationing.
- Provides instant segment-level metrics for route analysis.
- Automates the projection of multiple points onto a single path.

## How It Works

Connecting to this MCP gives your AI client immediate access to linear referencing tools.

1. Connect your preferred MCP-compatible client to Vinkius.
2. Provide the route polyline and the target points to your AI agent.
3. Your agent calls the necessary tools to perform the math.
4. Your agent returns the station values, segment indices, and offsets.

## Frequently Asked Questions

**What is this MCP used for?**
This MCP is used to calculate linear references, such as stationing and offsets, for points along a route polyline.

**Can I use this with Claude or Cursor?**
Yes, you can connect this MCP to any MCP-compatible client including Claude, Cursor, and Windsurf.

**Does it work with any polyline?**
It works with ordered routes defined by a series of points to determine stationing and segment data.

**How do I get the total length of a route?**
You can use the get_route_summary tool to retrieve the total length and complexity of the route.

**Can I find the station for a single coordinate?**
Yes, the find_nearest_station tool is designed specifically for single-point lookups.

**What is stationing?**
Stationing is a method of providing a unique linear address to any point along a route based on its cumulative distance from a starting point.

**How do I handle points that are not exactly on the road?**
You can use the `tolerance` parameter in `calculate_stationing` or `find_nearest_station` to define the maximum perpendicular distance for a point to be considered 'on route'.

**Can I get the total length of my route?**
Yes, use the `get_route_summary` tool to get the total length, segment count, and vertex count of your polyline.
