Skip to content

Python REST API for spatial data. The repository has the architecture of the application is based on containerization. It includes the endpoint application, the database and the broker.

License

Notifications You must be signed in to change notification settings

BradPrit09/DataHub_Spatial_Backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DataHub_Spatial_Backend

Python REST API for spatial data. The repository is subdivided as the architecture of the application. It's based on containers. It includes the endpoint application, the database and the broker.

Requirements

GDAL¶

GDAL is an excellent open source geospatial library that has support for reading most vector and raster spatial data formats. Currently, GeoDjango only supports GDAL’s vector data capabilities [2]. GEOS and PROJ should be installed prior to building GDAL. GDAL is a translator library for raster and vector geospatial data formats.

sudo apt-get update
sudo apt-get install  -y build-essential
wget http://download.osgeo.org/gdal/x.x.x/gdal-x.x.x.tar.gz
tar xvfz gdal-x.x.x.tar.gz
cd gdal-x.x.x

Make sure libporj-dev is installed.

./configure --with-python
make
sudo make install

Then the path is exported to settings.py to ${GDAL_LIBRARY_PATH}

OGR2OGR

OGR Simple Features Library is a C++ open source library (and commandline tools) providing read (and sometimes write) access to a variety of vector file formats including ESRI Shapefiles, S-57, SDTS, PostGIS, Oracle Spatial, and Mapinfo mid/mif and TAB formats. OGR is a part of the GDAL library.

You can check the version installed by using command ogr2ogr --version

To import data to the database, you have to use this command.

sudo ogr2ogr -f "PostgreSQL" PG:"host=localhost::port user=postgres password=xxxx dbname=Datahub_Country" ./countries.geojson

Docker

Before you install Docker Engine for the first time on a new host machine, you need to set up the Docker repository. Afterward, you can install and update Docker from the repository.

Set up the repository

Update the apt package index and install packages to allow apt to use a repository over HTTPS:

 sudo apt-get update
 sudo apt-get install ca-certificates curl gnupg lsb-release

Add Docker’s official GPG key: curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg .

Use the following command to set up the stable repository. To add the nightly or test repository, add the word nightly or test (or both) after the word stable in the commands below. Learn about nightly and test channels.

 echo \"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Install Docker Engine

Update the apt package index, and install the latest version of Docker Engine, containerd, and Docker Compose, or go to the next step to install a specific version:

sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin

Verify that Docker Engine is installed correctly by running the hello-world image:sudo docker run hello-world

This command downloads a test image and runs it in a container. When the container runs, it prints a hello-world message and exits.

Setup

To start the project you have to make sure above requirements are met. You may use docker compose up --build command to build the Docker images. To run the project use docker compose up

About

Python REST API for spatial data. The repository has the architecture of the application is based on containerization. It includes the endpoint application, the database and the broker.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published