DEV Community 👩‍💻👨‍💻

Cover image for Building Address Resolution Services with Redis Search
dmw
dmw

Posted on • Updated on

Building Address Resolution Services with Redis Search

Project Overview

A geocoder is a service for matching addresses to geographic locations. Geocoders use both geospatial queries and full text search to resolve incoming data to addresses and locations from a validated set of addresses.

For example, if a developer wants to resolve TIMES SQ MANHATTAN to a full address with coordinates, they may make a request against a forward geocoding API. This API will likely apply a full text search algorithm against a known database of addresses and return a list of potential matches (e.g. TIMES SQ MANHATTAN -> ["5 TIMES SQUARE MANHATTAN 10036", "42 TIMES SQUARE MANHATTAN 10036"]).

Alternatively, if a developer wanted to resolve (40.768044, -73.982372), they could use a reverse geocoding API. A reverse geocoder uses geospatial search to provide validated locations that are near the requested point (e.g. (40.768044, -73.982372) -> 2 COLUMBUS CIR MANHATTAN 10019)

Over the last few days, I built out a geocoder that uses Redis Search to implement both forward and reverse geocoding against approximately 1 million New York City addresses.

Full Arch Diagram

Then, using Redis Pub/Sub, I extended this service to provide a batch address resolution endpoint. With this batch service, developers can make geocoding requests and easily share the resolved addresses. In the video linked below, I go into detail about the system architecture and how Redis enabled this service.

Project Video

Submission Details

  • Submission Category: Microservice Mavens
  • Language Used: Go

A full description of the project is available on the project's GitHub repo below. The gcaas repo contains detail about the data structures used for each component of the application and all sample data shown in the video walkthrough.

GitHub logo DMW2151 / gcaas

Submission for Redis 2022 Hackathon - Geocoding API

Geocoding with Redis

A geocoder is a service for matching addresses to geographic locations and the entities containing those addresses. Geocoders use both geospatial queries and full text search to resolve incomplete addresses to addresses and locations from a validated. This repo builds a geocoder using Redis Search and PubSub to provide both a synchronous and asynchronous geocoding services. I go into detail about the implementation of this application in this walkthrough video.

Application Description

Figure 1.0 Synchronous Geocoding Architecture
arch
  • The synchronous geocoding API allows a user to submit a query address or location and receive a list of scored, potentially matching addresses. See examples below.
# sample forward query :: address -> (address, coordinates)
curl -XPOST https://gc.dmw2151.com/geocode/ \
-d '{"method": "FWD_FUZZY", "max_results": 3, "query_addr": "ATLANTIC AVE BROOKLYN"}'
{
  "result": [
    {
      "address": {
        "location": {
          "latitude
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Take a look at this:

Settings

Go to your customization settings to nudge your home feed to show content more relevant to your developer experience level. 🛠