by trojanik003
Bathymetry Data Loader
import logging
import os
from flask import request, flash, redirect, url_for
from werkzeug.utils import secure_filename
from gunicorn.app.base import BaseApplication
from app_init import create_initialized_flask_app
# Flask app creation should be done by create_initialized_flask_app to avoid circular dependency problems.
app = create_initialized_flask_app()
# Setup logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
# Configure upload folder
UPLOAD_FOLDER = 'uploads'
ALLOWED_EXTENSIONS = {'csv', 'tif', 'shp'}
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
def allowed_file(filename):
return '.' in filename and filename.rsplit('.', 1)[1].lower() in ALLOWED_EXTENSIONS
@app.route('/upload', methods=['POST'])
Created: | Last Updated:
Here's a step-by-step guide for using the Bathymetry Data Loader template:
Introduction
The Bathymetry Data Loader is a web application that allows users to upload and process bathymetry data files in CSV, GeoTIFF, or shapefile formats. This template provides a simple interface for uploading files and handling the processing of bathymetry data.
Getting Started
To begin using this template:
- Click the "Start with this Template" button in the Lazy Builder interface.
Test the Application
Once you've started with the template:
- Click the "Test" button in the Lazy Builder interface.
- This will initiate the deployment of your app and launch the Lazy CLI.
Using the Application
After the app is deployed:
- Lazy will provide you with a dedicated server link to access the web interface.
- Open this link in your web browser to view the Bathymetry Data Loader interface.
The interface will include:
- A title "Bathymetry Data Importer"
- A file upload form
To use the application:
- Click the "Choose File" button to select your bathymetry data file (CSV, GeoTIFF, or shapefile).
- Once a file is selected, click the "Upload and Process" button.
- The application will process the file and display a success message if the upload is completed successfully.
Integrating the Application
This web application is designed to be used standalone and doesn't require integration with external tools. Users can access it directly through the provided server link to upload and process bathymetry data files.
By following these steps, you'll have a functional Bathymetry Data Loader application up and running, ready to accept and process bathymetry data files.