Use the power of MongoDB to make spatial queries, find boundaries and more for data analaysis from R.

roadmap

  • list of UK geocodes (most used)
  • list of another country’s?
  • enable generating MongoDB spatial queries

Dependencies

  • mongolite (main dependency)
  • geojsonsf (perfect package for link between sf and Mongo spatial)
  • jsonify (helping with validation)
  • sf

Import vancouver geojson data

Given a local docker instance of MongoDb

Lets add real data (a small slice of Uber’s Vancouver dataset.)

Quietly populate the collection

Now lets query the collection

development

To run all the tests, you will require mongo to run. Once you are sure that you have an instance (for example a container running as outliend above), you will need a flag in your R environment GEOCODER_MONGODB_AVAILABLE=true. You can use R package usethis::edit_r_environ().

But the steps should be straightforward for an R developer:

Acknowledgement

This work is funded under the Turing GeoVisualization Engine project.