IBM Developer Advocacy

Geospatial Development with Cloudant & Mapbox



mikebreslin
4/11/16

Mapbox Integration for the Cloudant Dashboard

Cloudant is a database that lets you store JSON, and index that data a number of ways so queries run efficiently, even at large scale. One of those indexes is optimized for GeoJSON spatial data. Today, we’re introducing a feature to the Cloudant dashboard that makes working with Cloudant Geo data much more pleasant: integrated map visualizations via Mapbox.js.

Draw a complex spatial query using the Map tab in the Cloudant dashboard.

Draw a complex spatial query using the Map tab in the Cloudant dashboard, powered by Mapbox.

Cloudant Geo leverages the GeoJSON standard format for storing spatial data such as points, polygons, and linestrings. As a developer using Cloudant Geo’s API, you can perform radius, bounding box, complex polygon, and nearest neighbor queries. When our team was tasked with improving the experience of using Cloudant Geo, at the top of the list was adding a mapping UI so developers could visualize their data and easily learn the API.

Putting a GeoJSON Database on the Map(box)

We researched a number of tools and decided on Mapbox, both for their stunning base map layers as well as their powerful libraries, which the Cloudant team used to embed maps directly in the Cloudant dashboard. According to Ben Keen, IBM Cloudant lead JavaScript engineer, working with the Mapbox API went smoothly:

Integrating Mapbox into our dashboard proved to be extremely simple: it came with a clear, intuitive, feature-rich API that allowed us to quickly tie in the GeoJSON returned from our own Cloudant APIs.
—Ben Keen, lead JavaScript engineer, IBM Cloudant

Easily copy the corresponding API call for your query.

Easily copy the corresponding Cloudant API call for your query.

My counterpart at Mapbox, Matthew Irwin, had this to say about how Mapbox and Cloudant fit together:

Mapbox is geospatial Legos. We give developers the building blocks to integrate location into any application. The Cloudant team just gets it. Cloudant Geo is beautiful, speaks GeoJSON natively, and gives Cloudant users powerful new tools to understand their data.
—Matthew Irwin, business & strategy, Mapbox

Matt shares a bit more on the Cloudant integration work on the Mapbox blog. Check it out.

Try It, Live on Cloudant Shared Clusters

Where should you go next if you have a need for a database for storing and querying geospatial data in your application? Sign up for Cloudant and head over to the Learning Center to access videos, tutorials, and documentation on Cloudant Geo. If you then need to provide a map UI just like Cloudant did in its own dashboard, use Mapbox for its powerful mapping platform.

Fine tune lat-long coordinates and other parameters in the dashboard to avoid syntax errors.

Fine tune lat-long coordinates and other query parameters in the dashboard to avoid syntax errors. Mapbox, ftw!

Check out the dashboard at https://<youraccount>.cloudant.com/dashboard.html. Geospatial indexes, including the Mapbox-based tools, will be listed for databases containing them.

We hope you like the integration! —the IBM Cloudant & Mapbox teams

blog comments powered by Disqus