Code Monkey home page Code Monkey logo

geospatial-webapp-server's Introduction

Geospatial Webapp Server

A geospatial web application developed using Python, Django, and PostgreSQL. This project provides a server-side API for managing places, leveraging PostgreSQL's PostGIS extension for geospatial data storage and querying.

Table of Contents

Introduction

This geospatial web application allows users to manage places using a server-side API. It utilizes PostgreSQL's PostGIS extension to store and query geospatial data effectively. The application provides various features for creating, updating, retrieving, and deleting places.

Features

  • Create a new place with name, description, and geographic coordinates (latitude, longitude).
  • Update the details of a place, including its name, description, and coordinates.
  • Retrieve a list of all places or a specific place by ID.
  • Delete a place by ID.
  • Find the nearest place to a given set of coordinates (latitude, longitude).

Technologies

The geospatial web application is built using the following technologies:

  • Python
  • Django
  • PostgreSQL (with PostGIS extension)
  • Django REST Framework
  • drf_spectacular (for API documentation)

Installation

To install and set up the geospatial web application locally, follow these steps:

  1. Clone the repository:
git clone https://github.com/SergiiMachulin/geospatial-webapp-server.git
  1. Change to the project directory:
cd geospatial-webapp-server
  1. Create a virtual environment:
python3 -m venv venv
  1. Activate the virtual environment:
venv\Scripts\activate (on Windows)
source venv/bin/activate (on Linux/macOS)
  1. Install the required dependencies:
pip install -r requirements.txt
  1. Set up the PostgreSQL database and configure the connection in settings.py:
  • Set the required environment variables in .env file (need to be created, see example - .env.sample file):

    Postgres

    POSTGRES_DB

    POSTGRES_USER

    POSTGRES_PASSWORD

    POSTGRES_HOST

    Django

    DJANGO_SECRET_KEY

    DJANGO_DEBUG

    DJANGO_ALLOWED_HOSTS

  1. Run the database migrations: python manage.py migrate.
  2. Start the development server: python manage.py runserver
  3. Open your browser and visit http://localhost:8000 to access the application.

Usage

Once the application is up and running, you can use the server-side API to interact with the places. Here are some example API endpoints:

  • GET /api/places: Retrieves a list of all places.
  • POST /api/places: Creates a new place.
  • GET /api/places/{id}: Retrieves a specific place by ID.
  • PUT /api/places/{id}: Updates the details of a place.
  • DELETE /api/places/{id}: Deletes a place by ID.
  • GET /api/places/nearest_place/?latitude={latitude}&longitude={longitude}: Finds the nearest place to the given coordinates.

For detailed API documentation, refer to the API Documentation section below.

API Documentation

The API documentation provides detailed information about the available endpoints, request/response formats, and examples. To explore the API documentation, follow these steps:

  1. Start the development server: python manage.py runserver
  2. Open your browser and visit http://localhost:8000/api/schema/swagger-ui/ to view the Swagger UI documentation.

geospatial-webapp-server's People

Contributors

sergiimachulin avatar

Watchers

Kostas Georgiou avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.