Giter Site home page Giter Site logo

django_peak_crud_mfi's Introduction

Test project for MFI

This API is coded using Django/ Django rest framework/ GEOdjango/ The database is PostgreSQL with PostGIS extension This project use the development server provided by Django which is not suitable for production. For production use docker NGINX image and use gunicorn on web image.

Installation

Require docker and docker compose.

Clone this repo.

Install and everything by doing:

docker compose up

Use

The API run on localhost:8000/api/peak All coordinates must be in WGS84 (EPSG 4326)

In order to get all peaks : GET localhost:8000/api/peak

To get a particular peak : GET localhost:8000/api/peak/<id>

To update a particular peak : PUT localhost:8000/api/peak/<id>

To delete a particular peak : DELETE localhost:8000/api/peak/<id>

You can use the embedded doc to POST peak at : POST localhost:8000/api/peak the location field in the form should be like:

{"type": "Point", "coordinates": [6.952242, 48.1696017]}

Or : POST localhost:8000/api/peak with this content in request body:

{
    "name":"peak_name",
    "elevation":4808,
    "location": {
            "type": "Point",
            "coordinates": [
                6.952242,
                48.1696017 
            ]
        }
}

To GET all peaks inside a bounding box use: POST localhost:8000/api/peak/bounding_box with this content in request body to define the bbox coordinates:

{
    "min_x":-5.679688,
    "min_y":-70.313043,
    "max_x":-18.820313,
    "max_y":-16.553726
}

You can also pass bbox coordinates as URL parameters: POST localhost:8000/api/peak/bounding_box?min_x=10&min_y=10&max_x=12&max_y=15

django_peak_crud_mfi's People

Contributors

toine14 avatar

Watchers

 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.