- LANDSAT
- Table of Contents
- Endpoints
- Example Requests
- 1. Location: Amazonia (Latitude: 6.0, Longitude: -74.0)
- 2. Location: Desierto del Sahara (Approximate Coordinates: Latitude: 24.0, Longitude: 25.0)
- 3. Location: Australia (Approximate Coordinates: Latitude: 70.0, Longitude: -55.0)
- 4. Location: Amazonia (Latitude: 1.0, Longitude: -70.0)
- 5. Location: Islandia (Latitude: 65.0, Longitude: -18.0)
- Setup and Installation
- Troubleshooting
Retrieve metadata for a Landsat satellite image based on latitude and longitude.
Parameters:
latitude
(float): Latitude of the target location.longitude
(float): Longitude of the target location.
Example:
curl -X GET "http://localhost:8000/metadata?latitude=6.0&longitude=-74.0"
Evaluate data based on provided context and role.
Headers:
Content-Type: application/json
Body Parameters:
latitude
(float): Latitude of the target location.longitude
(float): Longitude of the target location.context
(string): Contextual information for the evaluation.role
(string): Role of the user (e.g., farmer, researcher).
Example:
curl -X POST "http://localhost:8000/evaluate-data" -H "Content-Type: application/json" -d '{
"latitude": 6.0,
"longitude": -74.0,
"context": "I am studying the impact of cloud coverage on agricultural yield.",
"role": "farmer"
}'
Below are example requests demonstrating how to use the API for different geographic locations.
GET Metadata:
curl -X GET "http://localhost:8000/metadata?latitude=6.0&longitude=-74.0"
POST Evaluate Data:
curl -X POST "http://localhost:8000/evaluate-data" -H "Content-Type: application/json" -d '{
"latitude": 6.0,
"longitude": -74.0,
"context": "I am studying the impact of cloud coverage on agricultural yield.",
"role": "farmer"
}'
GET Metadata:
curl -X GET "http://localhost:8000/metadata?latitude=24.0&longitude=25.0"
POST Evaluate Data:
curl -X POST "http://localhost:8000/evaluate-data" -H "Content-Type: application/json" -d '{
"latitude": 24.0,
"longitude": 25.0,
"context": "I am assessing the impact of water vapor on local climate conditions.",
"role": "researcher"
}'
GET Metadata:
curl -X GET "http://localhost:8000/metadata?latitude=70.0&longitude=-55.0"
POST Evaluate Data:
curl -X POST "http://localhost:8000/evaluate-data" -H "Content-Type: application/json" -d '{
"latitude": 70.0,
"longitude": -55.0,
"context": "I am analyzing how high cloud coverage affects agricultural production.",
"role": "farmer"
}'
GET Metadata:
curl -X GET "http://localhost:8000/metadata?latitude=1.0&longitude=-70.0"
POST Evaluate Data:
curl -X POST "http://localhost:8000/evaluate-data" -H "Content-Type: application/json" -d '{
"latitude": 1.0,
"longitude": -70.0,
"context": "I am analyzing how high cloud coverage affects agricultural production.",
"role": "farmer"
}'
GET Metadata:
curl -X GET "http://localhost:8000/metadata?latitude=65.0&longitude=-18.0"
POST Evaluate Data:
curl -X POST "http://localhost:8000/evaluate-data" -H "Content-Type: application/json" -d '{
"latitude": 65.0,
"longitude": -18.0,
"context": "I am analyzing how high cloud coverage affects agricultural production.",
"role": "farmer"
}'
To get started with the Universidad de la Sabana API, follow these steps:
-
Clone the Repository:
git clone https://github.com/yourusername/universidad-de-la-sabana-api.git cd universidad-de-la-sabana-api
-
Create a Virtual Environment:
python3 -m venv venv source venv/bin/activate
-
Install Dependencies:
pip install -r requirements.txt
-
Run the FastAPI Server:
uvicorn app.main:app --reload
-
Access the Interactive API Documentation:
Open your browser and navigate to
http://localhost:8000/docs
to explore and test the API endpoints interactively.
If you encounter any issues while using the API, consider the following troubleshooting steps:
-
Check Server Logs:
Ensure that the FastAPI server is running without errors. Server logs can provide insights into any issues.
# If running the server in a terminal, observe the logs directly.
-
Validate JSON Files:
Ensure that all JSON files in the
app/data/
directory are correctly formatted. You can usejq
to validate JSON syntax.jq . app/data/LC09_L2SP_218015_20241002_20241003_02_T1.json
-
Verify File Permissions:
Ensure that the FastAPI application has read permissions for all JSON files.
chmod 644 app/data/*.json
-
Coordinate Validation:
Make sure the latitude and longitude provided in the requests fall within the regions covered by your metadata JSON files.
-
API Documentation:
Utilize FastAPI's interactive documentation at
http://localhost:8000/docs
to test endpoints and understand expected inputs and outputs. -
Restart the Server:
After making changes to JSON files or configurations, restart the FastAPI server to apply the updates.
uvicorn app.main:app --reload
If problems persist, please reach out to the project maintainer or consult the documentation for further assistance.