Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prometheus

3D Light Pollution Visualization using Raylib and Earth Engine

Authors

Result

Result

Description

This project is a Python project focused on fetching, processing, and visualizing global light pollution data in a 3D environment. It utilizes the Google Earth Engine API to retrieve night light data and the raylib graphics library to render the data points on a 3D spherical representation of Earth. It has been created to explore 3D data visualization, spherical coordinates, and Earth Engine integration.

graph TD
    %% Styles
    classDef data fill:#BBDEFB,stroke:#1565C0,stroke-width:2px,color:black;
    classDef process fill:#C8E6C9,stroke:#2E7D32,stroke-width:2px,color:black;
    classDef graphics fill:#FFF9C4,stroke:#FBC02D,stroke-width:2px,color:black;
    classDef app fill:#E1BEE7,stroke:#6A1B9A,stroke-width:2px,color:black;

    %% Nodes
    App["PlanetApp<br/>Main Entry Point<br/>(sservant)"]:::app
    
    Data["EarthEngineDataProvider<br/>Fetch Data<br/>(sservant)"]:::data
    Processor["LightMapProcessor<br/>3D Projection<br/>(sservant)"]:::process
    Visualizer["PlanetVisualizer<br/>3D Rendering<br/>(sservant)"]:::graphics

    %% Connections
    App -->|1. Request data| Data
    App -->|2. Generate points| Processor
    App -->|3. Render planet| Visualizer
    
    Data -->|Image path| Processor
    Processor -->|3D Point Cloud| Visualizer
Loading

Instruction

The Prometheus visualizer can be run using standard Python tools. Dependencies are managed via pyproject.toml.

pip install .

Or using uv (recommended):

uv pip install -e .

Usage

Python Script

from src.app import PlanetApp

# Initialize and run the application
app = PlanetApp()
app.run()

Command Line

Run the application directly:

python -m src

Algorithms

3D Projection & Visualization

The project implements several key components for processing and rendering geographic data:

  • Data Acquisition: Interfacing with the Earth Engine API to download global night lights composite imagery.
  • Spherical Projection: Converting 2D equirectangular map coordinates from the image into 3D Cartesian coordinates (x, y, z) to map the light pollution points onto a sphere.
  • Point Cloud Optimization: Processing large image datasets and converting pixel intensities into scaled point sizes and colors for efficient 3D rendering.

The algorithm considers:

  1. Fetching data from Earth Engine
  2. Parsing and thresholding the 2D image array using pandas and matplotlib
  3. Calculating spherical coordinates to map data accurately on a sphere of radius 10.0
  4. Interactive 3D rendering using raylib

Project Structure

│  pyproject.toml  # Project configuration and dependencies
│  README.md       # Project documentation
└  src/
   ├── __main__.py   # Main entry point
   ├── app.py        # Core application logic
   ├── data.py       # Earth Engine data provider
   ├── processor.py  # Image to 3D point processor
   └── visualizer.py # Raylib 3D graphics engine

Resources

Disclaimer

⚠️ IMPORTANT — Educational use only:

  • Do not copy this code for assessed work in 42 or other courses.
  • Use this repository for study and reference only.

Feedback

If you have feedback, open an issue or contact the author.

About

3D Light Pollution

Resources

Stars

3 stars

Watchers

0 watching

Forks

Contributors

Languages