Skip to content
kavi castelo edited this page Apr 7, 2025 · 2 revisions

Urban Air Quality Monitoring and Prediction System

commit activity GitHub language count GitHub Actions Workflow Status Netlify Website GitHub License GitHub Release

System Config

Note: Default configurations are set up for running the project on server.

Clone the repository:

https://github.com/kavicastelo/ai-geospatial-platform.git

Pre requests

  • Install Angular CLI 15.2.x
  • Node version 16.19.0
  • Java JDK 17
  • Python 3.10
  • Different runnable environment supportive IDEA (intellij ultimate is recommended)

Frontend

  • Move to the frontend branch
    git switch frontend
  • Move to the client directory
    cd client
  • Navigates to src\environment\environment.development.ts
  • Commented out the production base url and uncomment the local (port 3269 is recommended and default)
  • Move to the client directory in terminal and run npm install --force command

Important

Use --force for install deprecated packages. don't use --legacy-peers

  • Run ng serve command to start the development server
  • Project starts to run on localhost:4200/ port

Backend

Move to the backend branch

git switch backend

You have to change few files to run the project locally.

  1. AIModel.java (./src/main/java/com/api/air_quality/model/ai_models/AIModel.java)
    • Comment out line 143 and 145.
    • Uncomment line 142 and 144.
  2. All Python models except AIModelPython.py (./src/main/java/com/api/air_quality/python/*.py)
    • Replace all file paths in class *ModelPython: classes with actual file paths.
    • Ex: "/app/AI_Models/airHumidity_model.pkl" to "./AI_Models/airHumidity_model.pkl"
  3. CorsConfig.java (./src/main/java/com/api/air_quality/CorsConfig.java)
    • Uncomment line 17 and 29.
    • Comment out line 18 and 30.

If you need to use your own localhost database,

  • Create .env file in the root directory of the project.
  • Add SPRINGBOOT_URL_PYTHON environment variable in .env file. (Optional)
  • Add PYTHON_EXE_PATH environment variable in .env file. (Optional)
  • Add DATABASE environment variable in .env file. (Default Urban_Air)
  • Add DATABASE_PORT environment variable in .env file.
  • Add DATABASE_URI environment variable in .env file.
  • Add SERVER_PORT environment variable in .env file. (default 3269)

Add Environment for Python Models.

  • <python.exe path to computer drive> -m venv venv
  • source venv\bin\activate (Linux or Mac)
  • .\venv\Scripts\activate (Windows)
  • pip install -r requirements.txt (recommended)
  • venv\Scripts\python.exe -m pip install -r requirements.txt (only if not working pip install -r requirements.txt)
  • deactivate

Note

If you're facing any idea error, delete the .idea directory and rebuild the project

Data Dictionaries

1. Air Quality Data

  • timestamp: Date and time of the data point.
  • location: Geographic location where the data was collected.
  • pm25: Particulate Matter (PM) with a diameter of 2.5 micrometers or smaller.
  • pm10: Particulate Matter (PM) with a diameter of 10 micrometers or smaller.
  • co2: Carbon Dioxide levels.
  • ozone: Ozone levels.
  • no2: Nitrogen Dioxide levels.
  • temperature: Ambient temperature at the time of measurement.
  • humidity: Relative humidity at the time of measurement.
  • wind_speed: Wind speed at the time of measurement.

2. Meteorological Data

  • timestamp: Date and time of the data point.
  • location: Geographic location where the data was collected.
  • temperature: Ambient temperature.
  • humidity: Relative humidity.
  • wind_speed: Wind speed.
  • precipitation: Amount of precipitation (rainfall) during the specified period.

3. Land Use Data

  • location: Geographic location for which land use information is provided.
  • land_type: Type of land use (e.g., Residential, Commercial, Industrial, Park).