Performance analysis of MongoDB versus PostGIS/PostGreSQL databases for line intersection and point containment spatial queries


Relational databases have been around for a long time, and Spatial databases have exploited this feature for close to two decades. The recent past has seen the development of NoSQL non-relational databases, which are now being adopted for spatial object storage and handling too. Moreover, this is gaining ground in the context of increased shift towards Geospatial Web Services on both the Web and mobile platforms especially in the user-centric services, where there is a need to improve the query response time. This paper attempts to evaluate the performance of an existing NoSQL database ‘MongoDB’ with its inbuilt spatial functions with that of an SQL database with spatial extension ‘PostGIS’ for two fundamental spatial problems—line intersection and point containment problem, across a range of datasets, with varying feature counts. Given these results, NoSQL databases may be better suited for simultaneous multiple-user query systems including Web-GIS and mobile-GIS. Further studies are required to understand the full potential of NoSQL databases across various geometries and spatial query types.

This is a preview of subscription content, access via your institution.

Fig. 1
 Fig. 2
Fig. 3


  1. 1.

    Soni, G. (2013). Open source spatial database for mobile devices. Computer Engineering and Intelligent Systems (IISTE).

  2. 2.

    Baas, B., Quak, W., Van Oosterom, P. et al. (2012). NoSQL spatial: Neo4j versus PostGIS. Master Thesis, Geographical Information Management and Applications.

  3. 3.

    Scholz, J. (2011). Coping with dynamic, unstructured data sets—NoSQL a buzzword or a savior? In M. Schrenk, V. V. Popovich, P. Zeile (Eds.), Proceedings of 16th international conference on urban planning, regional development and information society REAL CORP (pp. 121–129). ISBN: 978-3-9503110-1-3.

  4. 4.

    Kolb, L. (n.d.). NoSQL-Datenbanken. Kapitel 1: Einführung; Universität Leipzig.

  5. 5.

    NoSQL Databases Explained | MongoDB. White Paper (n.d.).

  6. 6.

    Lourenço, J. R., et al. (2015). Choosing the right NoSQL database for the job: a quality attribute evaluation. Journal of Big Data, 2, 18. doi:10.1186/s40537-015-0025-0.

    Article  Google Scholar 

  7. 7.

    de Souza Baptista, C., de Oliveira, M. G., da Silva, T. E. (2011). Using OGC services to interoperate spatial data stored in SQL and NoSQL databases. XII GEOINFO, Campos do Jordão, Brazil, November 27–29, 2011.

  8. 8.

    Xiao, Z. F., & Liu, Y. M. (2011). Remote sensing image database based on NOSQL database. Geoinformatics, 2011, 1–5.

    Google Scholar 

  9. 9.

    Schmid, S., Galicz, E., Reinhardt, W. (2015). Performance investigation of selected SQL and NoSQL databases. AGILE 2015, Lisbon, June 9–12, 2015.

  10. 10.

    Popescu, A., Bacalu, A.-M. (2009). Geo NoSQL: CouchDB, MongoDB, and Tokyo cabinet.

  11. 11.

    Steiniger, S., & Hunter, A. J. S. (2012). Free and open source GIS software for building a spatial data infrastructure. Geospatial Free and Open Source Software in the 21st Century (Part 5). doi:10.1007/978-3-642-10595-1_15.

    Google Scholar 

  12. 12.

    van der Veen, J. S., van der Waaij, B., Meijer, R. J. (2012). Sensor data storage performance: SQL or NoSQL, physical or virtual. In: IEEE fifth international conference on cloud computing, Honolulu, Hawaii, USA, June 24–29, 2012.

  13. 13.

    PostGIS Development Group, Postgis Manual. Accessed January 14, 2014.

  14. 14.

    Chris. (2014). A primer on geospatial data and MongoDBmLab Blog. Accessed August 19, 2014.

  15. 15.

    Butler, H. et al. (2015). The GeoJSON format specification. Internet Engineering Task Force.

Download references


We would like to acknowledge the responses and interactions with MongoDB developers through emails which helped during this research project.

Author information



Corresponding author

Correspondence to Sarthak Agarwal.

Rights and permissions

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Agarwal, S., Rajan, K.S. Performance analysis of MongoDB versus PostGIS/PostGreSQL databases for line intersection and point containment spatial queries. Spat. Inf. Res. 24, 671–677 (2016).

Download citation


  • Spatial databases
  • Sql
  • Nosql
  • Intersection
  • Containment
  • Spatial queries