VYGEO OPALENA is an interactive web-based GIS application designed for the management, monitoring, and visualization of geographical data within the Opálená ski resort in the Beskydy mountains. This project integrates web technologies, geoinformatics, and IoT to enable real-time operational data management and analysis.
Key objectives include:
- Centralized area management within a unified map environment.
- Visualization of technological and natural elements (snowmaking, lifts, services).
- Processing of weather and elevation data.
- AI-powered sheep detection on slopes using the YOLOv8 model.
- Provision of analytical tools for operational management and prediction.
- Interactive Map: Dynamic mapping interface with custom tile layers.
- Object Management: Comprehensive CRUD (Create, Read, Update, Delete) operations for geographical features (points, lines, polygons) with GeoJSON support.
- Elevation Data Integration: Automatic retrieval and display of elevation data for map objects.
- Real-time Weather: Display of current temperature, weather conditions, and 3-day forecasts from OpenWeatherMap.
- GPS Localization: User location tracking for enhanced navigation and data collection.
- Wet-bulb Temperature Calculator: Specialized tool for optimizing snowmaking conditions.
- Layer Management: Toggle visibility of various map layers for customized views.
- Photo Documentation: Upload and display photos linked to specific map features.
- AI Sheep Detection: Real-time monitoring and visualization of sheep count on ski lifts for safety using YOLOv8.
- Authentication & Authorization: Secure login system with role-based access control (admin/test) for managing data and exports.
- Data Visualization: Integration of Chart.js for displaying statistics and graphs.
- Frontend: HTML5, CSS3, JavaScript (ES6+), Leaflet.js (mapping), Chart.js (data visualization).
- Backend: PHP 7.4+ with a RESTful API for robust data handling and processing.
- Database: MySQL 5.7+ as the primary data store, with SQLite fallback for local/offline operations.
- AI/IoT Integration: Python scripts for AI inference (YOLOv8) and potential future IoT sensor integration.
- External APIs: OpenWeatherMap, Mapy.cz, OpenElevation, Teal.cz (webcam stream).
VYGEO/
├── api/ # Backend API endpoints (PHP, SQL)
├── assets/ # Static assets (icons, images, 3D models)
├── css/ # Stylesheets
├── data/ # Data files (e.g., sheep.json, snow_calc)
├── js/ # Frontend JavaScript modules
├── scripts/ # Python scripts for AI and data processing
├── tiles/ # Custom map tile data
├── wet-bulb-calculator/ # Wet-bulb temperature calculator module
├── index.html # Main application entry point
├── README.md # Project documentation
└── ... (other root files)
- Web server (Apache, Nginx, or PHP's built-in server)
- PHP 7.4+ (with
mysqliandpdo_mysqlorpdo_sqliteextensions enabled) - MySQL 5.7+ or SQLite
- Composer (optional, for PHP dependencies if any)
- Node.js & npm (optional, if frontend build tools are used)
- Git
-
Clone the repository:
git clone https://github.com/MetrPikeska/VYGEO.git cd VYGEO -
Database Setup (MySQL example): Create a MySQL database and user. Then, execute the following SQL to create the necessary tables:
CREATE DATABASE vygeo; USE vygeo; CREATE TABLE map_features ( id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255) NOT NULL, type VARCHAR(50) NOT NULL, geojson TEXT NOT NULL, elevation_data TEXT NULL, color VARCHAR(7) NULL, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ); CREATE TABLE feature_photos ( id INT AUTO_INCREMENT PRIMARY KEY, feature_id INT NOT NULL, photo_data LONGTEXT NOT NULL, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (feature_id) REFERENCES map_features(id) ON DELETE CASCADE ); CREATE TABLE sheep_log ( id INT AUTO_INCREMENT PRIMARY KEY, timestamp DATETIME DEFAULT CURRENT_TIMESTAMP, count INT DEFAULT 0, confidence FLOAT NULL );
-
Environment Configuration: Create a
.envfile in the project root based onconfig.example.js(for JS) andapi/hosting_config.php(for PHP backend). Example.envcontent:DB_HOST=localhost DB_USER=your_username DB_PASS=your_password DB_NAME=vygeo MAPY_CZ_API_KEY=your_mapy_cz_api_key OPENWEATHER_API_KEY=your_openweather_api_key
-
Download YOLO Model (Optional - for Sheep Detection): If you intend to use the AI sheep detection feature, download a YOLOv8 model (e.g.,
yolov8n.pt) and place it in the project directory:wget https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8n.pt # Or download manually from: https://github.com/ultralytics/ultralytics
Using PHP's Built-in Server (for development):
- Open your terminal in the
VYGEOproject root directory. - Run the command:
php -S localhost:8000
- Access the application in your web browser at
http://localhost:8000.
Using Apache/Nginx (for production or local setup like WAMP/XAMPP):
- Ensure your web server is configured to serve the
VYGEOdirectory. - Make sure PHP is correctly installed and configured to process
.phpfiles in your web server's settings (e.g.,httpd.conffor Apache, or virtual host settings). - Access the application via your configured domain or
http://localhost/VYGEO/.
- Open the application in your web browser.
- Login as admin (
username: admin,password: opalena) for full functionality. - Interact with the map: Create, edit, or delete geographical objects.
- View weather data and use the wet-bulb calculator.
- Monitor sheep count (if AI detection is set up).
- Upload photos to map features.
GET /api/features.php?action=list: Retrieve all geographical features.POST /api/features.php: Create a new geographical feature.PUT /api/features.php: Update an existing geographical feature.DELETE /api/features.php?id=X: Delete a geographical feature by ID.POST /api/auth.php: Handle user authentication (login/logout).GET /api/map_proxy.php: Proxy for map tiles (hides API key).GET /api/weather_proxy.php: Proxy for weather data (hides API key).POST /api/update.php: Update sheep count data.POST /api/upload_photo.php: Upload photos linked to features.
- API Key Protection: External API keys are handled via proxy servers.
- CORS Restrictions: Cross-Origin Resource Sharing is configured to allowed domains.
- Input Validation: Measures are in place to prevent SQL injection and other vulnerabilities.
- File Upload Security: Validation for file type, size, and dimensions for uploaded photos.
- Authentication & Authorization: Secure login system with role-based access control.
- HTTPS Requirement: GPS localization, camera access, and photo uploads require a secure HTTPS connection.
We welcome contributions to the VYGEO OPALENA project! To contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature-name). - Make your changes and ensure they adhere to the project's coding standards.
- Commit your changes (
git commit -m 'Add new feature'). - Push to the branch (
git push origin feature/your-feature-name). - Open a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
For questions, issues, or collaborations, please contact:
Petr Mikeska petrmikeska.cz
VYGEO OPALENA v1.0 - Monitoring and Management for Opálená Ski Resort