Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# name: Build and Test

# on:
# push:
# branches: [ main, develop ]
# pull_request:
# branches: [ main ]
# release:
# types: [published]

# jobs:
# build:
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# os: [ubuntu-latest, windows-latest, macos-latest]
# python-version: [3.8, 3.9, "3.10", "3.11"]

# steps:
# - uses: actions/checkout@v3
# with:
# submodules: true # Important for pybind11 submodule

# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}

# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install build twine pytest

# - name: Build package
# run: python -m build

# - name: Check package
# run: twine check dist/*

# - name: Test package installation
# run: |
# pip install dist/*.whl
# python -c "import gloss; print(gloss.printHelloWorld()); print('Version:', gloss.getVersion())"

# - name: Run tests
# run: pytest tests/ -v

# - name: Upload to TestPyPI (on release)
# if: github.event_name == 'release' && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10'
# env:
# TWINE_USERNAME: __token__
# TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
# run: |
# twine upload --repository testpypi dist/*
110 changes: 110 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,113 @@

# debug information files
*.dwo


# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# CMake build
CMakeFiles/
CMakeCache.txt
cmake_install.cmake
Makefile
build/
*.o
*.obj
*.a
*.dll
*.exe
*.out

# VS Code
.vscode/

# MacOS
.DS_Store

# # Python bindings artifacts
# *.pyd
# *.c
# *.cpp

# Local environment
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

#pypi files
.pypirc

# data files
data/
*.tiff
*.tif

los_datasets/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "pybind11"]
path = pybind11
url = https://github.com/pybind/pybind11.git
13 changes: 13 additions & 0 deletions .pypirc.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[distutils]
index-servers =
pypi
testpypi

[pypi]
username = __token__
# password = your-pypi-api-token-here

[testpypi]
repository = https://test.pypi.org/legacy/
username = __token__
# password = your-testpypi-api-token-here
52 changes: 52 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
cmake_minimum_required(VERSION 3.4...3.18)
project(gloss)

# Help CMake find GDAL and other libraries in conda environment
if(DEFINED ENV{CONDA_PREFIX})
message(STATUS "Using Conda environment: $ENV{CONDA_PREFIX}")
set(CMAKE_PREFIX_PATH "$ENV{CONDA_PREFIX}" ${CMAKE_PREFIX_PATH})
include_directories("$ENV{CONDA_PREFIX}/include")
link_directories("$ENV{CONDA_PREFIX}/lib")

# Set PROJ_LIB for GDAL
set(ENV{PROJ_LIB} "$ENV{CONDA_PREFIX}/share/proj")
endif()

find_package(GDAL REQUIRED)
find_package(fmt REQUIRED)

# Use pybind11 subdirectory
add_subdirectory(pybind11)

pybind11_add_module(gloss ./src/bindings.cpp)

add_library(worker1 STATIC ./src/utils.cpp)
set_target_properties(worker1 PROPERTIES POSITION_INDEPENDENT_CODE ON)

# Add include directory (assumes /include/ is at the root of your repo)
target_include_directories(gloss PRIVATE
${CMAKE_SOURCE_DIR}/include
${GDAL_INCLUDE_DIRS}
)
target_include_directories(worker1 PRIVATE
${CMAKE_SOURCE_DIR}/include
${GDAL_INCLUDE_DIRS}
)

# Define version info passed from setup.py
target_compile_definitions(gloss PRIVATE VERSION_INFO=${GLOSS_VERSION_INFO})

# Link the worker1 static library into the gloss module
target_link_libraries(gloss PRIVATE worker1 ${GDAL_LIBRARIES} fmt::fmt)
target_link_libraries(worker1 PRIVATE ${GDAL_LIBRARIES})

# Optional: Create standalone executable
add_executable(gloss_standalone ./src/gloss.cpp ./src/utils.cpp)
target_include_directories(gloss_standalone PRIVATE
${CMAKE_SOURCE_DIR}/include
${GDAL_INCLUDE_DIRS}
)
target_link_libraries(gloss_standalone PRIVATE
${GDAL_LIBRARIES}
fmt::fmt
)
20 changes: 20 additions & 0 deletions DEV_README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# GLoSSRt


## Building to publish

```
pip install ninja

pip install --upgrade setuptools wheel twine

python setup.py sdist bdist_wheel

pip install twine build
python -m build

twine upload --config-file .pypirc --repository testpypi dist/*.tar.gz
twine upload --verbose --config-file ./.pypirc --repository testpypi dist/*.tar.gz


```
10 changes: 10 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
include CMakeLists.txt
include README.md
include LICENSE
include requirements_linux.txt
include pyproject.toml
recursive-include src *
recursive-include include *
recursive-include pybind11 *
global-include *.cmake
global-include CMakeLists.txt
5 changes: 5 additions & 0 deletions Manifest.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
include README.md LICENSE pybind11/LICENSE
graft pybind11/include
graft pybind11/tools
graft src
global-include CMakeLists.txt *.cmake
76 changes: 75 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,75 @@
# GLoSS-o
# GLoSS-RT

A geospatial line of sight evaluation system for antenna LoS evaluations in small to large scale network simulations.

## Installation

### Step 1: Install System Dependencies

**IMPORTANT:** You must install GDAL system libraries **before** installing glossrt.

#### Ubuntu/Debian:
```bash
sudo apt-get update
sudo apt-get install libgdal-dev gdal-bin
```

#### macOS:
```bash
brew install gdal
```

#### Conda (Recommended):
```bash
conda create -n gloss-env python=3.11
conda activate gloss-env
conda install -c conda-forge gdal
```

### Step 2: Install glossrt

```bash
pip install glossrt
```

Or from TestPyPI:
```bash
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ glossrt
```

## Quick Start

```python
import gloss

# Initialize
gloss.initialize("antennas.csv", "elevation.tif", "ground_elevation.tif")

# Compute
results = gloss.compute()

# Save results
gloss.saveResults(results)
```

## Development

### Build from source

```bash
git clone https://github.com/yourusername/GLoSS.git
cd GLoSS
pip install -e .
```

## Requirements

- Python >= 3.7
- GDAL >= 3.0.0 (system library)
- fmt library
- CMake >= 3.4
- C++17 compatible compiler

## License

MIT License
Loading