PROCESSING SPATIAL DATA STORED IN MONGODB USING POSTGRESQL/POSTGIS SPATIAL FUNCTIONS
An upsurge of spatial data that, over the past decade, has scattered all over the internet has made the role of NoSQL databases to be more important than ever. It is due to the NoSQL, such as MongoDB, ability to store a vast and gradually increasing amount of data. But to date, MongoDB offers only a...
Saved in:
Main Author: | |
---|---|
Format: | Final Project |
Language: | Indonesia |
Online Access: | https://digilib.itb.ac.id/gdl/view/48783 |
Tags: |
Add Tag
No Tags, Be the first to tag this record!
|
Institution: | Institut Teknologi Bandung |
Language: | Indonesia |
Summary: | An upsurge of spatial data that, over the past decade, has scattered all over the internet has made the role of NoSQL databases to be more important than ever. It is due to the NoSQL, such as MongoDB, ability to store a vast and gradually increasing amount of data. But to date, MongoDB offers only a few numbers of spatial functions which makes spatial data processing in MongoDB to be troublesome. Therefore, a mechanism on how to process spatial data that is stored in MongoDB is defined in this final project.
One method that could be used to process spatial data, that is stored in MongoDB, is to retrieve the data from the database in question and by utilizing existing external spatial functions, the data that has just been retrieved then could be processed. PostgreSQL, with its spatial extension called PostGIS, is one out of many spatial databases that provides a large number of spatial functions, which could be used as external spatial functions to process spatial data retrieved from MongoDB. By taking the ease of access to spatial functions exist in PostGIS by using SQL into consideration, SQL will be used to query the data from MongoDB. There are some similarities in components between MongoDB and PostgreSQL query structure. The components in question are name of the table in PostgreSQL, or collections in MongoDB, and selection. Those components, whcih were extracted from SQL query, could then be used to query the data from MongoDB. Then, the data that has been retrieved from MongoDB will be used as the data source for SQL query by injecting it, as a constant table, to the query.
Node.js is used to implement the mechanism by utilizing a library named node-sql-parser, which is used to transform an SQL query to be an abstract syntax tree. By converting the query into a tree-based model, adding or deleting a component from the query will be much easier to be done. The implemented mechanism will be tested using some queries that contain various kind of spatial functions and subqueries. The tests’ results come out to be as what has been expected. The application then could be developed to support some other NoSQL databases. |
---|