Conversation
Parse coordinates typed into the search box (latitude first) into
[lon, lat]. Supports decimal degrees, DMS (40°44'30.8"N 73°59'21.5"W),
DDM (40° 44.514' N), and N/S/E/W hemisphere letters before or after the
number, in either order (73 W 40 N).
Inputs that are ambiguous or out of range are rejected and left for
Photon: lone whole numbers ("28, 3"), lat > 90, lon > 180, minutes or
seconds >= 60, a minus sign combined with a hemisphere letter, and two
latitudes or two longitudes.
Not wired into geocode() yet.
When the input has no dot and doesn't parse as-is, retry with commas between digits read as decimal points, so "40,7419; -73,9893", "40,7419, -73,9893" and "40,7419 -73,9893" all resolve. Inputs with a dot never use the comma retry. Short pairs like "40,74" and "40,5 3" are still rejected, so ordinary queries like "28,3" keep going to Photon.
If the query parses as coordinates, geocode() returns a single result at that point, using the trimmed query as its name, and doesn't call Photon. Pasting "40.741895, -73.989308" into the origin or destination box now resolves to that exact spot instead of a fuzzy text match. This also works when PHOTON_URL is not set.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (5)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughCoordinate queries are parsed locally and return one geocoding result without a Photon request. Other queries continue through the Photon lookup path. Documentation describes supported coordinate formats and API behavior. ChangesCoordinate Input Geocoding
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Feature Merge Risk: ⚪ Minimal · up to Typed coordinates in the search boxes now resolve locally without Photon, and other queries behave as before. No merge-blocking issue was identified. Security Architecture ReviewSecurity architecture risk: ⚪ Minimal · up to Recognized coordinates use the existing result format and route-selection paths without adding privileges or bypassing request validation. No material security risk was found in the changed flow. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 42.86% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 2 files. (3 skipped: 3 unsupported.) ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Add a "Typing coordinates" section to the route guide that lists the accepted formats. Fix three places that said search finds nothing without Photon: typed coordinates now work without it. The /api/geocode reference now covers the single result it returns for a coordinate query.
Typing or pasting coordinates into the origin or destination box now resolves to that exact point, without calling Photon. Before this change, Photon got the coordinates as a text query and returned fuzzy, often wrong, matches.
Supported formats (latitude first)
40.741895, -73.989308·40.4168 -3.703840.7419°N 73.9893°W·N 40.7419 W 73.989340°44'30.8"N 73°59'21.5"W(also ′ ″ and space-separated)40° 44.514' N, 73° 59.359' W73.9893 W 40.7419 N40,7419; -73,9893·40,7419 -73,9893Inputs that are ambiguous or invalid are rejected and go to Photon as before:
28, 3,40,74-40.7 SSummary by CodeRabbit