KEMBAR78
MongoDB + GeoServer | PDF
MongoDB + GeoServer
Outline

    Why we use MongoDB
     What is GeoServer
The MongoDB GeoServer Plugin
      Lessons Learned

                                    2
Why we use MongoDB

Store Large Number          Store Mixed      Geospatial
   of Documents          Document Metadata    Support




                     +                   +
                                                          3
Why we use MongoDB

    Small Team


+                 =
                                      4
Our Use of MongoDB
                 Document
                                              { “_id”:
                 Processor                    "metadata" : {
                                                    “event”:”MongoDB DC 2013”,
                                                    “url”:”
                                              http://www.10gen.com/events/mon
                                              godb-washington-dc-2013”,
                                              }
Original Files               Extracted Text    "geo" : [
                                                  {
      +                            +                “place” : “Newseum”,
 Metadata                      Metadata              "location" : [-77.0194, 38.8930]
                                                 },
                                                 {
                                                    " place " : “Penn Quarter Sports
                                              Tavern",
                                                    "location" : [ -77.0215, 38.8942]
                                                 } ],
                                              ]}          spatial index created for geo.location




                                                                                         5
Store
                                       Document




     Spatial               Document    Analytic
    Services                Services   Services



                         REST API
     Custom Web Client
                                                  How we expose our data




6
I love your data, but…




                         7
I love your data, but…
How can I integrate it into my existing
workflow?

                                          8
I love your data, but…
How can I integrate it into my existing
workflow?
Answer: Open Geospatial Standards
                                          9
What is GeoServer?
 Open source software server that
  allows users to share geospatial
  data

 Reference implementation of the
  Open Geospatial Consortium
  (OGC) standards
     WMS (Web Map Service)
     WFS (Web Feature Service)
     WCS (Web Coverage Service)


 Open API allows integration of
  back-end data stores
                                                      10
WFS   WMS




            11
Examples




       12
GeoServer & MongoDB




http://repo.opengeo.org/org/geotools/gt-mongodb/   13
Existing MongoDB Plugin
 Open sourced in 2011 by Data Tactics
  Corp.
                                                         GeoJSON
                                         { "type": "FeatureCollection",

 Developed against MongoDB 1.8.x           "features": [
                                             { "type": "Feature",
                                               "geometry": {
                                                    "type": "Point",
                                                   "coordinates": [-77.0194, 38.8930]},
                                                "properties": {" place": “Newseum"} },
 Natively supports GeoJSON               { "type": "Feature",
                                               "geometry": {

  documents                                         "type": "Point",
                                                   "coordinates": [-77.0215, 38.8942]},
                                                "properties": {" place": " Penn Quarter Sports
                                         Tavern "} },
                                         }

 Supports all geometry types
                                                                                         14
Added support for multi-
                                                                             location documents


                                  Leveraged existing                            { “_id”:
                                                                                "metadata" : {
                                  GeoServer MongoDB Plugin                            “event”:”MongoDB DC 2013”
                                                                                      “url" :
                                                                                “http://www.10gen.com/events/mo
                                                                                ngodb-washington-dc-2013”
                                  http://repo.opengeo.org/org/geotools/gt-            }
                                  mongodb/                                       "geo" : [
                                                                                    {
                                                                                      “place” : “Newseum”
                                                                                       "location" : [-77.0194, 38.8930]
                                                                                   },
                                                                                   {
Skipped calculating full schema                                                       " place " : “Penn Quarter Sports
                                                                                Tavern",
& geospatial extents                                                                  "location" : [ -77.0215, 38.8942]
                                                                                   } ],
                                            Configurable to work with           ]}

                                            your existing schema
      Authentication support
                                                               OR
MongoDB + GeoServer


           GeoServer
Document               WMS

  Store                WFS

                       KML


           REST API




                                     Custom Web Client   16
Lessons Learned…
 Translating MongoDB document results to GeoServer Feature Data
  is not 1:1

 Challenging to filter bounding box results when location is within
  nested document

 Challenging to provide accurate page limits

 Not perfect, lots of room for improvement… but was worth it

 Code provided to OpenGeo development team
                                                                       17
References
 http://geoserver.org/display/GEOS/What+is+GeoServer

 http://opengeo.org/publications/opengeo-architecture/

 Getting Started:
    Download Plugin: http://repo.opengeo.org/org/geotools/gt-mongodb/
    FOSS4G2011 Presentation:
     http://fosslc.org/drupal/content/integration-geoserver-nosql-databases
                                                                         18
JP Prochazka
jprochazka@radiantblue.com




Rich Fecher               Sam Kramer
rfecher@radiantblue.com   skramer@radiantblue.com

MongoDB + GeoServer

  • 1.
  • 2.
    Outline Why we use MongoDB What is GeoServer The MongoDB GeoServer Plugin Lessons Learned 2
  • 3.
    Why we useMongoDB Store Large Number Store Mixed Geospatial of Documents Document Metadata Support + + 3
  • 4.
    Why we useMongoDB Small Team + = 4
  • 5.
    Our Use ofMongoDB Document { “_id”: Processor "metadata" : { “event”:”MongoDB DC 2013”, “url”:” http://www.10gen.com/events/mon godb-washington-dc-2013”, } Original Files Extracted Text "geo" : [ { + + “place” : “Newseum”, Metadata Metadata "location" : [-77.0194, 38.8930] }, { " place " : “Penn Quarter Sports Tavern", "location" : [ -77.0215, 38.8942] } ], ]} spatial index created for geo.location 5
  • 6.
    Store Document Spatial Document Analytic Services Services Services REST API Custom Web Client How we expose our data 6
  • 7.
    I love yourdata, but… 7
  • 8.
    I love yourdata, but… How can I integrate it into my existing workflow? 8
  • 9.
    I love yourdata, but… How can I integrate it into my existing workflow? Answer: Open Geospatial Standards 9
  • 10.
    What is GeoServer? Open source software server that allows users to share geospatial data  Reference implementation of the Open Geospatial Consortium (OGC) standards  WMS (Web Map Service)  WFS (Web Feature Service)  WCS (Web Coverage Service)  Open API allows integration of back-end data stores 10
  • 11.
    WFS WMS 11
  • 12.
  • 13.
  • 14.
    Existing MongoDB Plugin Open sourced in 2011 by Data Tactics Corp. GeoJSON { "type": "FeatureCollection",  Developed against MongoDB 1.8.x "features": [ { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-77.0194, 38.8930]}, "properties": {" place": “Newseum"} },  Natively supports GeoJSON { "type": "Feature", "geometry": { documents "type": "Point", "coordinates": [-77.0215, 38.8942]}, "properties": {" place": " Penn Quarter Sports Tavern "} }, }  Supports all geometry types 14
  • 15.
    Added support formulti- location documents Leveraged existing { “_id”: "metadata" : { GeoServer MongoDB Plugin “event”:”MongoDB DC 2013” “url" : “http://www.10gen.com/events/mo ngodb-washington-dc-2013” http://repo.opengeo.org/org/geotools/gt- } mongodb/ "geo" : [ { “place” : “Newseum” "location" : [-77.0194, 38.8930] }, { Skipped calculating full schema " place " : “Penn Quarter Sports Tavern", & geospatial extents "location" : [ -77.0215, 38.8942] } ], Configurable to work with ]} your existing schema Authentication support OR
  • 16.
    MongoDB + GeoServer GeoServer Document WMS Store WFS KML REST API Custom Web Client 16
  • 17.
    Lessons Learned…  TranslatingMongoDB document results to GeoServer Feature Data is not 1:1  Challenging to filter bounding box results when location is within nested document  Challenging to provide accurate page limits  Not perfect, lots of room for improvement… but was worth it  Code provided to OpenGeo development team 17
  • 18.
    References  http://geoserver.org/display/GEOS/What+is+GeoServer  http://opengeo.org/publications/opengeo-architecture/ Getting Started:  Download Plugin: http://repo.opengeo.org/org/geotools/gt-mongodb/  FOSS4G2011 Presentation: http://fosslc.org/drupal/content/integration-geoserver-nosql-databases 18
  • 19.
    JP Prochazka jprochazka@radiantblue.com Rich Fecher Sam Kramer rfecher@radiantblue.com skramer@radiantblue.com