Skip to content

Repository files navigation

1. Overview

This API allows storage, retrieval, update, and deletion of spatial data, including points, lines, polygons, and multi-polygons. It supports both single geometries and collections of polygons (multipolygons) .

Supported Geometry Types:

  • Point – single coordinate \[longitude, latitude].
  • Line (LineString) – multiple coordinates forming a path.
  • Polygon – multiple coordinates forming a closed boundary.
  • MultiPolygon – multiple polygons representing an area.

API DESIGNS

Points

Endpoint Method Action
/points/ GET List all points
/points/{id}/ GET Retrieve a single point
/points/ POST Create a new point
/points/{id}/ PUT Update entire point
/points/{id}/ DELETE Delete point

Lines

Endpoint Method Action
/lines/ GET List all lines
/lines/{id}/ GET Retrieve a single line
/lines/ POST Create a new line
/lines/{id}/ PUT Update entire line
/lines/{id}/ DELETE Delete line

Polygons

Endpoint Method Action
/polygons/ GET List all polygons
/polygons/{id}/ GET Retrieve a single polygon
/polygons/ POST Create a new polygon
/polygons/{id}/ PUT Update entire polygon
/polygons/{id}/ DELETE Delete polygon

MultiPolygons

Endpoint Method Action
/multipolygons/ GET List all multipolygons
/multipolygons/{id}/ GET Retrieve a single multipolygon
/multipolygons/ POST Create a new multipolygon
/multipolygons/{id}/ PUT Update entire multipolygon
/multipolygons/{id}/ DELETE Delete multipolygon

Future Scope

  • If multiple users access the same location or pinpoint simultaneously, we can implement caching to reduce database load and improve response time. Additionally, a rate limiter can be used to prevent server overload from heavy requests.
  • Currently, SQLite is used as the database. For large-scale production environments, it is recommended to use PostgreSQL or another database depending on the requirements.
  • The platform can be redesigned or scaled according to future requirements. The current structure allows reusability of apps across multiple projects. Using Django helps solve the DRY (Don't Repeat Yourself) principle by enabling modular apps that can be reused efficiently in different projects.

Project Setup

  1. Get the Project

    • Clone or download the project repository.
  2. Open in Editor

    • Open the project folder in your preferred code editor (e.g., VS Code, PyCharm).
  3. Activate Virtual Environment

    • On Windows:
      .venv\Scripts\activate
    • On macOS/Linux:
      source .venv/bin/activate
  4. Install Dependencies

  • pip install -r requirements.txt
  1. Install Dependencies
  • python manage.py makemigrations
  • python manage.py migrate
  1. Run the Server
  • python manage.py runserver
  1. Test APIs
  • Open Postman.
  • Import the provided collection: spatial_platform.postman_collection.
  • Explore and test the APIs.

About

This API enables creating, retrieving, updating, and deleting spatial data, including points, lines, polygons, and multi-polygons. It supports both single geometries and collections of polygons.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages