A full-stack web application for visualizing and tracking Antarctic iceberg positions using real-time geospatial data. Built with Flask, GeoPandas, and Folium, featuring AWS S3 integration and Docker containerization for scalable cloud deployment.
- Application: [http://iceberg-tracker-env.eba-jpbxjnfp.us-east-2.elasticbeanstalk.com/]
- Admin Panel: [http://iceberg-tracker-env.eba-jpbxjnfp.us-east-2.elasticbeanstalk.com/admin]
- Interactive Map Visualization: Real-time Antarctic iceberg positions with color-coded markers
- Geospatial Data Processing: DMS to decimal coordinate conversion for 1800+ iceberg records
- AWS S3 Integration: Cloud-based data storage with local fallback capabilities
- RESTful API: Endpoints for data synchronization and map refresh operations
- Admin Interface: Web-based control panel for AWS operations and data management
- Docker Containerization: Production-ready deployment with Nginx reverse proxy
- Comprehensive Error Handling: UTF-8 encoding resolution and data validation
Backend
- Python 3.11
- Flask 3.1.2
- GeoPandas 1.1.1 / Pandas 2.3.2
- Shapely 2.1.1 (geospatial operations)
- Folium 0.20.0 (interactive mapping)
Cloud & Infrastructure
- AWS S3 (data storage)
- boto3 1.40.35 (AWS SDK)
- Docker & Docker Compose
- Nginx (reverse proxy)
- Gunicorn (WSGI server)
Data Processing
- JSON parsing and validation
- DMS coordinate system conversion
- GeoPandas GeoDataFrame operations
- CRS transformations (EPSG:4326)
- Python 3.11+
- Docker & Docker Compose
- AWS Account (optional, local fallback available)
-
Clone repository
git clone https://github.com/yourusername/iceberg-tracker.git cd iceberg-tracker -
Set up virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txt
-
Configure environment
cp .env.example .env # Edit .env with your AWS credentials (optional) -
Run application
python run.py # Access at http://localhost:5000
-
Build and run with Docker Compose
docker-compose up --build # Access at http://localhost:80 -
Production deployment
chmod +x deploy.sh ./deploy.sh
- Create S3 bucket:
iceberg-tracker-data - Upload iceberg data to
data/iceberg_locations.json - Configure IAM role with S3 permissions
AWS_ACCESS_KEY_ID=your_access_key
AWS_SECRET_ACCESS_KEY=your_secret_key
AWS_DEFAULT_REGION=us-east-1
AWS_S3_BUCKET=iceberg-tracker-data
USE_AWS_S3=true- AWS Elastic Beanstalk: Single-instance deployment
- AWS ECS Fargate: Container orchestration
- Local Docker: Development and testing
| Endpoint | Method | Description |
|---|---|---|
/ |
GET | Main application with interactive map |
/admin |
GET | Admin control panel |
/api/health |
GET | Health check for load balancers |
/api/map/refresh |
POST | Regenerate map with latest data |
/api/aws/sync |
POST | Upload local data to S3 |
/api/aws/files |
GET | List S3 bucket contents |
/api/aws/toggle |
POST | Switch between S3/local data sources |
The application processes Antarctic iceberg data in this JSON structure:
{
"02/12/21": [
{
"iceberg": "a23a",
"recent_observation": "02/09/21",
"longitude": -400.0,
"dms_longitude": "40 0'W",
"dms_lattitude": "75 45'S",
"lattitude": -7545.0
}
]
}Coordinate Processing: Converts DMS format ("75 45'S") to decimal degrees (-75.75) for geospatial operations.
┌─────────────────┐ ┌──────────────┐ ┌─────────────────┐
│ Nginx Proxy │───→│ Flask App │───→│ AWS S3 │
│ (Port 80) │ │ (Port 5000) │ │ (Data Store) │
└─────────────────┘ └──────────────┘ └─────────────────┘
│
┌──────────────┐
│ GeoPandas │
│ Processing │
└──────────────┘
│
┌──────────────┐
│ Folium │
│ Map Gen │
└──────────────┘
app/api.py: Flask application with routing and error handling
app/map_gen.py: Geospatial data processing and map generation
app/s3_handler.py: AWS S3 operations and data synchronization
templates/: Jinja2 templates for web interface
nginx/nginx.conf: Reverse proxy configuration with security headers
- Extract: Load JSON from S3 or local file
- Transform: Parse DMS coordinates, validate data, create GeoDataFrame
- Load: Generate interactive Folium map with markers and popups
# Local testing
python -m pytest tests/
# Docker testing
docker-compose -f docker-compose.test.yml up --build- Caching: 30-second map generation cache to prevent duplicate processing
- Rate Limiting: Nginx-based API rate limiting (10req/s for APIs, 30req/s general)
- Compression: Gzip compression for static assets
- Health Monitoring: Built-in health checks and logging
- Resource Optimization: Efficient GeoPandas operations for 1800+ records
- Environment Isolation: Docker containerization with non-root user
- Credential Management: AWS credentials via environment variables, never in code
- Input Validation: Data sanitization and coordinate validation
- Security Headers: HTTPS-ready with security headers via Nginx
- Rate Limiting: Protection against API abuse
- Fork the repository
- Create feature branch (
git checkout -b feature/new-feature) - Commit changes (
git commit -am 'Add new feature') - Push to branch (
git push origin feature/new-feature) - Create Pull Request
MIT License - see LICENSE for details.
- Developer: [Aws Ali]
- Email: [aliaws123@outlook.com]
- LinkedIn: [https://www.linkedin.com/in/aws-ali-8ab74b2b9/]
- GitHub: AwsAli05