Comment by echoangle
2 days ago
I still don’t get it.
Situation a: Someone searches for location XYZ. The geocoding API returns lat and Lon and canonical name ABC. You save that and the slugified name abc in your DB. (If the API doesn’t return a name, you can use XYZ instead of ABC). You return slug abc to the user.
Situation b: Someone requests weather for location at slug abc. You look in your DB, ask the weather API for the weather at lat/lon and return that to the user.
Situation c: Someone searches for a place that happens to already exist in the DB. You geocode the search term and get a lat/lon pair that’s already in the DB so you return the saved slug.
How is that different than using a shortcode? In which situation are you doing a geocoding API request you don’t need to do with the current system?
No comments yet
Contribute on Hacker News ↗