Skip to content

RO-HIT17/Defense-Target-Visibility

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Defense Visibility & Line of Sight System

A geospatial web application for defense planning, allowing users to simulate viewshed (visibility) and line-of-sight (LOS) analysis over terrain using digital elevation models (DEMs).

Features

  • Viewshed Simulation: Compute and visualize areas visible from an observer point at a given height and location.
  • Line of Sight Checker: Check if a direct line of sight exists between two points (observer and target) with specified heights.
  • Interactive Maps: Results are displayed on interactive Folium maps in the browser.
  • Backend Scripts: FastAPI backend for geospatial computation; Python scripts for raster viewshed analysis.

Project Structure

DefenseVisiblity/
├── defense_los/
│   ├── app.py                # Streamlit frontend app
│   ├── compute_viewshed.py   # Standalone viewshed computation script
│   ├── ...                   # Other backend files
├── data/                     # DEMs and output files
├── README.md                 # Project documentation

Setup

  1. Install dependencies:
    • Python 3.8+
    • Install required packages:
      pip install streamlit folium streamlit-folium requests rasterio numpy scipy fastapi uvicorn
  2. Prepare DEM data:
    • Place your GeoTIFF DEM file in the data/ folder.

Running the App

  1. Start the backend (FastAPI):
    • (Assuming you have a FastAPI backend exposing /viewshed and /los endpoints)
    • Example:
      uvicorn backend:app --reload --port 8000
  2. Start the frontend (Streamlit):
    streamlit run defense_los/app.py
  3. Open your browser:

Standalone Viewshed Script

  • Run viewshed analysis directly from CLI:
    python defense_los/compute_viewshed.py --lon <lon> --lat <lat> --height <h> --maxdist <m> --dem data/demo_aoi.tif
  • Output is a GeoJSON file with visible polygons.

Notes

  • For best results, use high-resolution DEMs.
  • The app caches results for faster repeated queries.
  • Morphological smoothing in viewshed script requires scipy.

About

A geospatial web application for defense planning, allowing users to simulate viewshed (visibility) and line-of-sight (LOS) analysis over terrain using digital elevation models (DEMs).

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors