#BuiltWithHERE

SafeQueue Takes Lines Online for Social Distancing

By David Chura | 06 July 2020

Try HERE Maps

Create a free API key to build location-aware apps and services.

Get Started

I wasn’t even planning on entering IBM’s Call for Code contest until Lady Gaga asked me to. Not that she asked me, personally, but something about seeing her video about the contest on my local news station pushed the idea for SafeQueue from a “someone should do something about this” kind of problem into a “I should do something about this” kind of problem. 

That problem were the lines outside of restaurants and other establishments that were doing their best to stay open in spite of laws limiting their capacity in response to COVID-19. The pandemic had already affected me in other ways - forcing me to put the launch of an entirely separate company on hold - and I felt that Call for Code would provide an opportunity for me to stay productive in the meantime. I knew I could come up with a technology-based solution for these lines, there was an urgent need for it, and I had the time to work on it. 

What SafeQueue actually does is quite simple. If you’re within 1000 feet of a business, as determined by GPS, the app invites you to join a virtual line called a SafeQueue. There’s no need to call ahead to make a reservation, sign-up, or volunteer personal information. All that’s needed is proximity - and it allows people to “line up” for goods or services while maintaining safe social distancing. 

You can see how it works for yourself in the  web-app version of Safe Queue – just go to:   www.safequeueweb.com > select “MANAGER” > select “Add” in the upper-right (you’ll have to agree to share your GPS location), and you’ll see an address field that is filled in from the reverse geocode result. 

The result appears really fast—I don’t think I’ve ever seen a lag in filling in the result!

There are times when it gives only a partial result, but that is expected – that is why I give the option to edit the address.

It’s not too fancy, but here is the javascript function from our web-app that does this: (the callback fills in the form)


export const addressOfLocation = (loc, callback) => {

  var hereurl = "https://reverse.geocoder.ls.hereapi.com/6.2/reversegeocode.json?apiKey=xxxxxxxxxxxxxxxxxxxxxxxxx&mode=retrieveAddresses&prox=";
  var finalurl = `${hereurl}${loc}`;

  fetch(finalurl)
    .then(response => response.json())
    .then((jsonData) => {
      // jsonData is parsed json object received from url
      if (jsonData === undefined) {
        callback('');
        return;
      }

      var o = jsonData.Response.View[0].Result[0].Location.Address;
      var number = (o.HouseNumber == null) ? '' : o.HouseNumber;
      var street = (o.Street == null) ? '' : o.Street;
      var city = (o.City == null) ? '' : o.City;
      var state = (o.State == null) ? '' : o.State;
      var zip = (o.PostalCode == null) ? '' : o.PostalCode;

      callback(number + " " + street + "\n" + city + ", " + state + ' ' + zip);
    })
    .catch((error) => {
      // handle your errors here
      console.log(finalurl);
      console.error(error)
      callback(''); // no known address
    })
}

SafeQueue took about three weeks to develop in prototype, and another three weeks to develop to production quality for submission to Apple and Google App stores. And I developed a web-app version in another two weeks, so that anybody can use SafeQueue on essentially any device.

That fast production schedule was only possible because of HERE. Obviously, GPS location is critical for the app’s function, and HERE’s technology made integrating GPS locations for reverse-geolocation incredibly simple. It also makes it simple for businesses to start their SafeQueues by automatically determining a business’ GPS location and address for the business owner.

SafeQueue’s production wasn’t the only fast part about it though! I received an email very shortly after the Call for Code deadline with a request for more information about the app and a call with IBM staff. After the call, I was informed via email that I was in the top three, and would be interviewed by Bob Lord and Chelsea Clinton at IBM Think 2020! And then I was interviewed by Doug Kolk of KTLA - the same local news station that I saw the Lady Gaga video on! 

While I originally just imagined SafeQueue as a response to the pandemic, the backing of IBM helped me envision uses for it even after things “return to normal.” I envision adding a more map-centric user experience to help customers find businesses, and help businesses know exactly where their customers are, and their place in the virtual line. Furthermore, mapping will help businesses that operate without single, fixed-addresses - like ski resorts - better operate and keep track of their guests. SafeQueue Takes Lines Online for Social Distancing

But for now, SafeQueue is still in Beta with early adopter businesses - many of whom discovered us at IBM Think 2020. All I can hope right now is that the solution proves to have more staying power than the problem it was built to solve.