geospatial intelligence database

This week at the Esri Developers Summit in Palm Springs, our friends at Esri are previewing upcoming features for the next release of MemSQL, using a huge real-world geospatial dataset.

Esri develops geographic information systems (GIS) that function as an integral component in nearly every type of organization. In a recent report by the ARC Advisory Group, the Geographic Information System Global Market Research Study, the authors stated, “Esri is, without a doubt, the dominant player in the GIS market.”

MemSQL showcases Geospatial features at Esri Developers Summit – Click to Tweet

Everything happens somewhere. But, traditionally, spatial data has been locked away in specialized software that either lacked general database features, or didn’t scale out. With MemSQL we are making geospatial data a first-class citizen: just as easy to use, at scale, at great speed and high throughput, as any other kind of data.

The demonstration uses the “Taxistats” dataset: a compilation of 170 million real-world NYC taxi rides. It includes GPS coordinates of the pickup and dropoff, distance, and travel time. MemSQL is coupled with the new version of Esri’s ArcGIS Server, which has a new feature to translate ArcGIS queries into external database queries. From there we generate heatmaps from the raw data in sub-second time.

Heatmaps are a great way to visualize aggregate geospatial data. The X and Y are the longitude and latitude of “cells” or “pixels” on the map, and the color shows the intensity of the values. From there you can explore the dataset across any number of dimensions: zoom in on an area, filter by time, length of ride, and more.

Geospatial Intelligence

How it Works

To prepare the data, we simply loaded it into a MemSQL table running on a modest Amazon AWS cluster. At first we thought about pre-processing the geospatial points to calculate hexgrid values for faster querying, but that turned out to be unnecessary. MemSQL is fast enough to aggregate the point data into heatmap “pixels” on the fly. Alternatively, we could have generated a table of hexagons and performed a spatial join between the point table and the pixel table.

The queries are almost absurdly simple. We filter the table to an area on the map using GEOGRAPHY_INTERSECTS, filter further by time and date, round off the GPS coordinates to gather them into rough “pixels” about 100 meters wide, and group them. Spatial data is just another type of data in MemSQL, complete with lock-free indexes and powerful functions for manipulating it. The demo zips through nearly 200 million complex records in under 150 milliseconds:

Real-world Use Cases for Geospatial

Slicing by hour of the day, we can calculate the average speed of a taxi ride (distance / time) and find the best and worst places for traffic jams. Slicing by day of week, we can see the ebb and flow of traffic during workdays and weekends. For a city planner, this kind of data can be used to redirect traffic at specific times in effort to unclog traffic congestion. For the taxi business, this data can improve efficiency with supply and demand of cabs during times of high or low traffic for any given region.

Welcoming Geospatial to the World of Relational In-Memory Databases

For too long, geospatial data has been relegated to specific databases and datastores. With the emergence of mobile phones and the coming wave of wearables and sensor data related to the Internet of Things, everything is now logged in both time and space.

Now enterprises have an opportunity to combine geospatial data with the rest of their organizational data in a single database that is in-memory, linearly scalable, and supports a full range of relational SQL and geospatial functions. We look forward to a whole world of applications and opportunities.