Skip to content
Snippets Groups Projects
Commit 3a7eeb0f authored by Riccardo Boero's avatar Riccardo Boero :innocent:
Browse files

Added docstrings and updated code to new release of service package.

parent 58453cf6
No related branches found
No related tags found
No related merge requests found
...@@ -2,4 +2,4 @@ ...@@ -2,4 +2,4 @@
poetry config repositories.gitlab https://git.nilu.no/api/v4/projects/1217/packages/pypi poetry config repositories.gitlab https://git.nilu.no/api/v4/projects/1217/packages/pypi
poetry config http-basic.gitlab FACT_token glpat-1zG-TQx___xLsPjj2vsG poetry config http-basic.gitlab FACT_token glpat-1zG-TQx___xLsPjj2vsG
poetry add polygonqueryonraster@0.1.0 --source gitlab poetry add polygonqueryonraster --source gitlab
from polygonqueryonraster.app import GeoTIFFService from polygonqueryonraster.app import GeoTIFFService
if __name__ == "__main__": if __name__ == "__main__":
"""
Main execution point for running the GeoTIFFService as a standalone application.
This script initializes and starts the GeoTIFFService with a predefined data directory and port number.
It's designed to be run directly from the command line and is useful for quick setups or testing.
The GeoTIFFService is configured to analyze the GeoTIFF files located in the specified directory.
It sets up a Flask-based web server to listen for incoming requests for geospatial analysis.
Configuration:
- Data Directory: The directory where GeoTIFF files are stored. This should be an absolute path.
- Port Number: The port number on which the Flask web server will run.
- Categorical Analysis: Indicates whether the analysis should be categorical. It's set to 'false' by default.
Example:
When this script is run, it starts the GeoTIFFService on the specified port and ready to process
requests on GeoTIFF files located in the specified data directory.
Usage:
python scriptname.py
Note:
To use this script, ensure that the 'polygonqueryonraster' package is installed and accessible in your
Python environment. Modify the 'data_directory' and 'port_number' variables as needed for your setup.
"""
data_directory = '/app/data/aster30m' # Specify your local data directory data_directory = '/app/data/aster30m' # Specify your local data directory
port_number = 5000 # Specify the custom port number port_number = 5000 # Specify the custom port number
categorical = False # Specify whether the analysis is categorical
service = GeoTIFFService(directory=data_directory, port=port_number) service = GeoTIFFService(directory=data_directory, port=port_number, categorical=categorical)
service.run() service.run()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment