shift-org / shift-org/shift-docs

Geocode addresses and include latitude & longitude coordinates in the events API

Open
#548 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

API backend enhancement frontend
Dominant language
JavaScript
Stars
30
Forks
25
Avg merge
9m
Merged PRs (30d)
1

Description

The events API currently sends a location name and address (venue and address); the web client then passes the address to Google Maps as a query to generate the map link (see helper.js).

This works OK, but:

  • It puts the onus on the client to map the address every time it's retrieved. This isn't really an issue on web currently, since we only display a link to Google Maps and it gets mapped just-in-time when a user clicks that link. But if we wanted to have a map view, for example, it would add a bunch of overhead to map all of the events just-in-time, every time. (We also heard this specific feedback from an iOS developer using our API who did create a map view. He said that providing geocoded locations in the API would be the biggest API improvement for him.)
  • If the written address doesn't map cleanly with Google Maps, it could map to an unexpected location (this happens sometimes when the quadrant isn't specified, or a slightly wrong address or intersection is used)

We should look at geocoding the address once, then serving latitude & longitude coordinates to clients. We could do the geocoding on the back end, or the front end could handle it during event creation and then pass it to the back end. An advantage of doing it on the front end is that we could give the user an opportunity to see the location on a map to verify if it's correct.

Note that we don't necessarily have to use Google's geocoding service, even if we're ultimately using Google Maps on the web. We could use Mapbox, HERE Maps, Bing, etc to obtain lat & long coordinates, and then send those to any mapping service on the front end. We should compare services for rate limits, accuracy, and so on to see which makes the most sense.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the events API section in docs/CALENDAR_API.md and the client logic in site/themes/s2b_hugo_theme/static/js/cal/helpers.js. Compare the proposed geocoding approaches and determine where coordinates should be generated and stored. Done means the API supplies latitude and longitude for events and clients no longer need to geocode addresses on demand.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.