Categorygithub.com/GarvitSadhwani/spatialDataRestAPI
modulepackage
0.0.0-20220826072432-2aa46de5c061
Repository: https://github.com/garvitsadhwani/spatialdatarestapi.git
Documentation: pkg.go.dev

# README

RestAPI implementation for Spatial Data

A web API developed using golang to find neighbours for a country or search for a country name. Data for countries taken from datahub

Setup and Execution

  • Clone the repository in the desired directory
    > git clone https://github.com/GarvitSadhwani/spatialDataRestAPI
    
  • Install gdal if not present
  • Credentials to the PostGIS database are present in docker-compose.yml file
  • Start Docker
    > docker compose up
    
  • Run the following command to import countries.geojason data to the PostGIS database. This creates a table 'spatialdatadb' in the PostGIS database which is used by the code
    > ogr2ogr -f "PostgreSQL" PG:"dbname=spatialdata user=pixxeldb password=pixxeldb" "countries.geojson" -nln spatialdatadb -append
    
  • Execute the main.go file
    > go run main.go
    
  • The API will be hosted on localhost:8080

Features

  • Search for a country homepage homepage
  • Find neighbours for a country on the data list homepage homepage
  • Add or Delete any country
  • More features coming soon!

Dependencies

This app runs with the help of go-chi and jack's driver for PostgreSQL

# Functions

No description provided by the author

# Structs

No description provided by the author
No description provided by the author