Stay Connected with the Boundless Blog

Boundless Collaborates with Mongo DB for Enterprise

We’ve been receiving increased interest of late to use OpenGeo Suite in new “Big Data” environments, as customers are seeking to store, manage, and leverage their growing volumes of data. In response, we’ve been working on MongoDB support for our enterprise customers and collaborating with LocationTech and CCRi on GeoServer integration with GeoMesa and Accumulo. We’ll have more to say about our work with GeoMesa in the near future, but I wanted to take a moment to share some additional details about our work with MongoDB.

GeoTools Collaboration

In June we had the pleasure of donating the OpenGeo Suite 4.6 implementation of MongoDB DataStore to the GeoTools project. Setting up MongoDB as a community module allows Boundless to smoothly collaborate with the GeoTools community without duplicating effort.

In the short time the code has been available we have already seen:

  • Fix: Filter on attributes that were not included in your query results (Stefano Costa)
  • Fix: Arrays of objects in a collection are now ignored, rather than preventing the collection from being published (Torben Barsballe)
  • New Feature: Support for LIKE filter pattern matching (Stefano Costa)
  • Lots of small improvements to test coverage

This improved implementation will be provided to our customers in the next release of OpenGeo Suite.
Screen Shot 2015-11-06 at 11.44.46 AM

Details on the MongoDB DataStore

The MongoDB DataStore provides access to any collections that have been set up 2dsphere spatial index. The DataStore can use (or generate) a schema mapping collection content to the  FeatureType Attributes used by the GeoTools feature model.

For the following GeoJSON feature:

{   "type": "Feature",
    "geometry": {
        "type": "Point",
        "coordinates": [ 45.52, -122.681944 ]
    },
    "properties": {
        "city": "Portland",
        "year": "2014"
        "attendance": "840"
    }
}

The following schema maps content to a FeatureCollection on the fly:

{   "typeName": "places",
    "userData": {
        "collection": "places"
    },
    "geometryDescriptor": {
        "localName": "location",
        "crs": {
            "properties": {
                "name": "urn:ogc:def:crs:EPSG:4326"
            },
            "type": "name"
        }
    },
    "attributeDescriptors": [
        {
            "localName": "location",
            "type": {
                "binding": "com.vividsolutions.jts.geom.Point"
            },
            "userData": {
                "encoding": "GeoJSON",
                "mapping": "geometry"
            }
        },
        {   "localName": "city",
            "type": { "binding": "java.lang.String" },
            "userData": { "mapping": "properties.name" }
        },
        {   "localName": "year",
            "type": { "binding": "java.lang.String" },
            "userData": { "mapping": "properties.year" }
        },
        {   "localName": "attendance",
            "type": { "binding": "java.lang.String" },
            "userData": {  "mapping": "properties.attendance" }
        }
    }
}

The use of GeoJSON carries with it the assumption of WGS84 (as expected by the 2dsphere spatial index). MongoDB 2.5 or newer is recommended for MultiGeometry support.

Interested developers can check out the community module for more information and we look forward to hearing from you on geotools-devel.

Torben Barsballe

Torben Barsballe

Software Engineer

Tobrn is a software developer at Boundless, primarily involved with Boundless Suite and a committer on both the GeoTools and GeoServer projects.