@siva-sub/mcp-public-transport
Version:
A Model Context Protocol server for Singapore transport data with real-time information and routing
82 lines (81 loc) • 2.36 kB
TypeScript
/**
* OneMap Themes Service
* Provides access to Singapore's thematic layers including landmarks, facilities, and points of interest
*/
import { OneMapService } from './onemap.js';
import { CacheService } from './cache.js';
export interface ThemeInfo {
themeName: string;
queryName: string;
icon?: string;
expiryDate?: string;
publishedDate?: string;
category: string;
themeOwner: string;
}
export interface ThemeFeature {
name: string;
description: string;
hyperlink?: string;
category: string;
owner: string;
coordinates: [number, number];
properties: Record<string, any>;
iconName?: string;
distance?: number;
}
export interface ThemeSearchResult {
theme: ThemeInfo;
features: ThemeFeature[];
totalCount: number;
searchArea?: {
center: [number, number];
radius: number;
};
}
export declare class ThemesService {
private oneMapService;
private cacheService;
private readonly CACHE_DURATION;
constructor(oneMapService: OneMapService, cacheService: CacheService);
/**
* Get all available themes from OneMap
*/
getAllThemes(): Promise<ThemeInfo[]>;
/**
* Search for landmarks and facilities near a location
*/
findLandmarksNear(latitude: number, longitude: number, radius?: number, categories?: string[]): Promise<ThemeSearchResult[]>;
/**
* Search for specific types of facilities (e.g., schools, hospitals, parks)
*/
findFacilitiesByType(facilityType: string, latitude?: number, longitude?: number, radius?: number): Promise<ThemeSearchResult[]>;
/**
* Get landmarks near a postal code
*/
findLandmarksNearPostalCode(postalCode: string, radius?: number, categories?: string[]): Promise<ThemeSearchResult[]>;
/**
* Search a specific theme within an area
*/
private searchThemeInArea;
/**
* Search a specific theme
*/
private searchTheme;
/**
* Calculate search extents based on center point and radius
*/
private calculateExtents;
/**
* Calculate distance between two points in meters
*/
private calculateDistance;
/**
* Get popular landmark categories
*/
getPopularCategories(): string[];
/**
* Get common facility types
*/
getCommonFacilityTypes(): string[];
}