Member-only story

The Algorithm That Ties Together Google Maps and InfluxData’s Giraffe

Anais Dotis
4 min readAug 19, 2019

--

One of the best parts about being a developer advocate is being able to share the developer’s work with the community. Working at InfluxData also means the code, projects or ideas that I blog about come from exceptional engineers who, like any good coding magicians, have several tricks up their sleeve. Today, I describe in detail one simple but important trick: the algorithm used in Giraffe, a React-based visualization library used to implement the InfluxDB Cloud 2.0 user interface (UI).

One algorithm, two types of visualizations

What do Google Maps and InfluxData’s Giraffe have in common? The implementation of the Ramer-Douglas-Peucker Algorithm (RDP Algorithm). As a point-reduce algorithm, it represents a complex line, with fewer points in a visually proper way.

Original dataset (right) and reduced output (left) from Ramer-Douglas-Peucker Algorithm. Image from NAMEKDEV.

Why it’s useful

It wasn’t until I learned about this algorithm that I ever even thought about asking the question: “How does Google Maps render the maps so quickly on my browser?” Maps contain millions of points of geospatial data, but the visualization of this data only uses several thousand pixels.

--

--

Anais Dotis
Anais Dotis

Written by Anais Dotis

Developer Advocate at InfluxData

No responses yet