No description, website, or topics provided.
Java Shell
Switch branches/tags
Nothing to show
Pull request Compare This branch is 6 commits ahead, 1 commit behind thesteve0:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


This is the code to go along with the OpenShift blog piece on how to use Flask (python) with MongoDB to create a REST like web service with spatial data

Running on OpenShift

Create an account at

Create a JBossEAP application with MongoDB

rhc app create javaws jbosseap-6 mongodb-2

Add this upstream flask repo

cd javaws
git remote add upstream -m master
git pull -s recursive -X theirs upstream master

Then push the repo upstream

git push

To add the data to the MongoDB instance please follow the instructions on this blog: Mongo Spatial on OpenShift

Now, ssh into the application.

Add the data to a collection called parkpoints:

mongoimport -d javaws -c parkpoints --type json --file $OPENSHIFT_REPO_DIR/parkcoord.json  -h $OPENSHIFT_MONGODB_DB_HOST  -u admin -p $OPENSHIFT_MONGODB_DB_PASSWORD

Create the spatial index on the documents:

use javaws
db.parkpoints.ensureIndex( { pos : "2d" } );

Once the data is imported you can now checkout your application at: