Skip to content
Import Shapefile geospatial vector format into MongoDB
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Import Shapefile geospatial vector format into MongoDB

Fast shapefile import into MongoDB using Python

Before running ensure you have the PyMongo module installed:

pip install pymongo

This script also has a dependency on the GDAL/OGR library, which can be obtained from here:

Example usage:

python -f shapes.shp -d geospatial -c shapes

Additional parameters are required if your server is not on your local machine or if your database requires authentication. Use the "--help" flag or see the example below.

python -f shapes.shp -s -d mydb -c shapes -u user -p password

Script requires MongoDB 3.2 or higher (prior releases do not support bulk operations), and was developed using Python 2.7 and a MongoDB 3.4 server.

You can’t perform that action at this time.