Author: Felipe Limeira da Silva
This section describes the available API routes in the application, including their functionality, request format, and response structure.
Uploads GeoJSON data and stores it in the database.
- URL:
/upload/
- Method:
POST
- Body:
file
: A GeoJSON file.
- Success: Returns the ID and filename of the uploaded data.
- Failure: Returns an error message if no valid features are found or if an internal error occurs.
Deletes all GeoData records from the database.
- URL:
/delete-all/
- Method:
DELETE
- Success: A confirmation message indicating that all data has been successfully deleted.
- Failure: An error message if an internal error occurs.
Retrieves all GeoData records from the database.
- URL:
/get-all/
- Method:
GET
- Success: A list of all GeoData records, each including ID, filename, and geographic data (in WKT or GeoJSON format).
- Failure: An error message if an internal error occurs.
Updates the name of a specific GeoData record.
- URL:
/update-name/{item_id}
- Method:
PUT
- URL Parameters:
item_id
: The ID of the GeoData record to be updated.
- Body:
new_name
: The new name for the GeoData record.
- Success: A confirmation message indicating that the name has been successfully updated.
- Failure: An error message if the item is not found or if an internal error occurs.