Getting Lost in the World

This post was originally published on this site

The Daily WTF

Unit tests are important, but unit tests alone don’t guarantee a good code base. Sandra, still suffering at InitAg brings us a bug that was sitting in their project for months, undetected.

In this case, Sandra’s team needed to work with geographic information. Now, this is hard. Geography is hard. Maps are hard. Coordinate systems are hard.

These complexities can express themselves in surprisingly simple ways. In common communication, many of us likely describe the coordinates as “latitude and longitude”. It’s how textbooks and even Wikipedia describe locations. But Geographic Information Systems do it the opposite way- lon/lat. Longitudes first.

In fact, there’s a standard for it, called GeoJSON, which defines a point thus:

{ “type”: “Point”, “coordinates”: [lon, lat] }

The problem Sandra’s team needed to solve was “simple”: pull data from one set of databases,

To read the full article click on the 'post' link at the top.