Project Goals
I plan to travel to New York with friends and am working on creating our travel itinerary. Traditional trip planning tools either repeat pre-existing full itineraries or only highlight famous attractions while ignoring needs like shopping, dining, and rest during the trip. Therefore, I developed an interactive map application that guides tourists through Manhattan's attractions and custom points of interest (POI), dynamically recommending walking or public transit routes based on real-time travel time and user preferences. This tool:
Can identify relatively vague needs, such as "feeling thirsty," "hungry," or "want to buy souvenirs"
Filters POIs by user request (e.g., “bookstores,” “bubble tea”) and minimum rating (≥ 4.0).
Groups iconic landmarks into Lower, Midtown, and Upper Manhattan, letting you pick multiple start/end points.
Selects the highest-rated POI for each category, but only if reachable:
If walking between POIs is > 40 min, those far-flung spots are automatically dropped.
Plans segment-by-segment: if a walk is ≤ 20 min, stay on foot; otherwise switch to public transit with a distinct purple dashed line.
By offering tailored route recommendations that honor both individual preferences and real-world travel constraints, this tool not only enhances traveler convenience but also serves as an urban tech demonstration—showcasing how AI-powered LLMs can interpret natural-language requests and seamlessly integrate mapping APIs with data-driven decision rules.
Method
API Keys
This project uses two different API keys.
1. OpenAI API Key (ChatGPT)
Used to call the GPT-3.5-Turbo model, which converts free-form travel requests into structured search categories (JSON array).
Responsible for the "needs identification" stage: extracting keywords such as "bookstore," "museum," or "bubble tea."
2. Google Maps API Key
Used for all location and mapping services, including:
Geocoding API: Converts landmarks (e.g., Statue of Liberty) and POI names into geographic coordinates.
Places API: Retrieves a list of POIs within a specified radius that meet keyword and rating conditions.
Directions API: Calculates walking or transit routes, durations, and distances based on coordinates, and returns polyline data for visualization with Folium.By combining ChatGPT’s natural language parsing with Google Maps' mapping and routing services, the system achieves a fully automated workflow from "where to go" to "how to get there."
Logic of the Route Planning
1. Dynamic POI selection
For each category, the system selects the highest-rated point of interest, but automatically excludes any POI whose walking time from the previous stop exceeds 40 minutes.
2. Landmark Grouping & User Choice
Landmarks grouped into three regions:
A (Lower Manhattan): Chinatown, Brooklyn Bridge, etc.
B (Midtown): Times Square, Rockefeller Center, etc.
C (Upper Manhattan): Met Museum, Columbia University, etc.
User picks codes (e.g., A1, B3, C2) for start/end points.
3. Segmented Routing
The application walks through each consecutive pair of stops—whether landmark to POI or POI to the next landmark—and for each segment it checks the walking time: if it’s 20 minutes or less, it draws a solid blue line; otherwise it requests public-transit directions and renders a purple dashed line. Each segment’s midpoint is labeled with its “Leg X: Y min, Z mi,” and at the overall route midpoint it displays the “Total time: T min.”
Outcomes
This map lets you pan, zoom, and click any marker to see its name and rating, then instantly recalculates a customized itinerary. You can toggle landmark and POI layers on or off, and watch as solid blue (walking) or purple dashed (transit) segments redraw themselves based on your stops.
For example, if you’re visiting Manhattan, select “Lower Manhattan” landmarks A1 (Chinatown) and A3 (Brooklyn Bridge) and ask for “bookstores,” “bubble tea,” and “museums.” The app filters top-rated spots, skips any that would take more than 40 min on foot, and stitches together an optimized route: start with a quick walk to a local tea shop, hop on the subway across the river (purple dashed line) for a 25-min ride, then stroll beneath the skyline (blue line) into an art museum. Each leg is labeled, and you can see your total travel time right on the map.
This helps simplify route selection and allows for planning the travel itinerary based on time. You can find the code here! Just follow the instructions, add your own API key, and you'll be ready to run it.
Reflection
By using GPT-3.5 to turn free-form travel requests into structured search terms, the system can better help people who don’t yet have a clear idea of where to go. People are not always aware of their exact needs, whereas most existing products assume users already know what they want—especially when it comes to choosing restaurants or stores. The model then automatically filters for highly rated points of interest to complement visits to famous landmarks. However, its labels are fairly limited—it can recognize broad categories (like “restaurants,” “cafes,” or “gift shops”) but not specific brands. For example, “I want to drink Heytea” (a bubble-tea chain) will only map to the “cafe” tag, not directly to Heytea itself.
In addition, the map does not support manually selecting POI points for route planning and can only rely on rating-based results. This reduces the flexibility of the map—sometimes people may prefer a store that wasn't selected by the system, even if its rating is slightly lower. That said, as a basic route planning tool, it still offers very useful information: estimated distances and travel times.
Another possible improvement would be using ChatGPT to generate suggested visit durations and recommended routes for each major landmark, which could help travelers plan their itineraries more effectively.
At one point, I added real-time location tracking as a reference feature. However, I found that in a “landmark-to-landmark” route planning model, real-time positioning lacks meaningful utility. If we wanted to implement a system that plans routes from the user’s current location and selects spots along the way based on shortest paths, it would require a more complex codebase.
I also attempted to build a website that connects the input and display features through a unified interface and designed a basic UI—but the final version of the code didn’t run successfully.
I used this map as a reference to help design my own travel route in New York, mainly focusing on dining spots. I plan to try it out on my next trip to New York. However, I still had to do most of the planning myself, because I wanted to include specific brands—which the current version of the map doesn’t support.
Link to Code & Data: https://github.com/Shengrui2025/Manhattan-route-planner.git