GETTING STARTED | GEOCODER | KNIME ANALYTICS PLATFORM

OpenCage Geocoding Using KNIME

A reusable and shareable component to plot co-ordinates on a map

Bob Peers
Low Code for Data Science

--

As first published on Creative Data

The OpenCage Geocoder component is available on the KNIME Hub.

A standard installation of KNIME does not come with a built-in Geocoder node but it’s very easy to either install one or make your own.

KNIME has a page dedicated to Geo Nodes using the Palladian Community nodes that supports both MapQuest and Google.

But if you want to roll your own using another geocoding service it’s very easy.

Editor’s Note. Palladian Nodes for KNIME lives with NodePit now. KNIME cannot guarantee the smooth execution of these nodes.

OpenCage Geocoding API

OpenCage is a well known Geocoding API that has very reasonable pricing allowing you to test the service for free and paid plans starting at €45 per month for 10,000 requests per day. First you should sign up to the service and get an API key for the free trial plan.

Using my OpenCage component you can create a simple workflow as shown below. This example shown how easy it is to feed addresses, geocode and then present the results on a map colour coded by location.

Opening the OpenCage component shows the details. Essentially, it contains three configuration nodes used for the input, a GET Request node to connect to the OpenCage API, and a bunch of nodes to parse and clean the output data.

Node Configuration

The node has a few configuration options:

  • API Key provided by OpenCage
  • Field that contains the address information to Geocode
  • Rate limit option in requests per second (dependent on your plan)

Node Output

The node will output all input data plus:

  • Latitude
  • Longitude
  • Confidence Score
  • HTTP Status Code
  • OpenStreetMap link
  • Address returned by OpenCage

An example output looks like the table below:

Using the Latitude/Longitude to Coordinate (from Palladian), Colour Manager and Map Renderer (from Palladian) nodes , it’s easy to plot the co-ordinates on a map by colour and add labels.

Creating components like this is a great way to wrap a complex process into a simple to use and re-usable node!

--

--

Bob Peers
Low Code for Data Science

Builder. Automate all the things. Generally curious person.