# 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
- Find neighbours for a country on the data list
- 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