Last active
August 29, 2015 14:18
-
-
Save vallettea/bb2d090c49a19b3dd5e2 to your computer and use it in GitHub Desktop.
load data and do a spatial query in mongo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| docker run --name mongo_instance -v /data/context:/data -d mongo | |
| docker exec -ti mongo_instance bash | |
| mongorestore --db context /data/pois.json/pois/ | |
| echo 'db.pois.find( { lonlat : | |
| { $geoWithin : | |
| { $geometry : | |
| { type : "Polygon", | |
| coordinates : [ [ [ 2.325612, 48.81079 ] , [ 2.325612, 48.84675 ] , [ 2.380082, 48.84675 ] , [ 2.380082, 48.81079 ] ,[ 2.325612, 48.81079 ] ] ] | |
| } } } } ).pretty().toArray() | |
| ' > myQuery.js | |
| mongo context < myQuery.js > output.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment