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
| 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 |
| 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 |
| 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 |
| 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 |
- 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.
-
Get the Project
- Clone or download the project repository.
-
Open in Editor
- Open the project folder in your preferred code editor (e.g., VS Code, PyCharm).
-
Activate Virtual Environment
- On Windows:
.venv\Scripts\activate
- On macOS/Linux:
source .venv/bin/activate
- On Windows:
-
Install Dependencies
- pip install -r requirements.txt
- Install Dependencies
- python manage.py makemigrations
- python manage.py migrate
- Run the Server
- python manage.py runserver
- Test APIs
- Open Postman.
- Import the provided collection: spatial_platform.postman_collection.
- Explore and test the APIs.