This is a Rust implementation for the database server used with Airborne Optical Sectioning.
Install Rust by running rustup
from https://rustup.org. Rust stable version 1.48 has been tested.
Required Linux packages: libx11-dev cmake build-essentials python-is-python3. On Windows only the Rust package and python3 is required
Open a command window or terminal and proceed to the current directory AOS/SERV and run
cargo build --release
Open a command window or terminal and proceed to the current directory AOS/SERV and start the server with
cargo run --release --bin server
To enable logging set the environment variable RUST_LOG
. e.g.
export RUST_LOG=info
cargo run --bin sar-server
The server API follows the Representational state transfer (REST) principle.
Uploaded resources are stored with timestamped ids. The format is YYYYMMDDTHHmmssSSS_rrrr
Additional files of a resource always have the same id but has an additional suffix.
Server stores AOS flight information in various folders:-
/locations
:
Contains AOS flight location information (center and corner coordinates of the location) as a json file.
Other additional files such as polygon data, vertex data, GEO-TIFF images required for visualization and AOS are also stored with same location id.
/drones
:
Details about the flying drone is stored as a json file.
/images
:
Single images captured during AOS flights are stored. Relative pose information of individual images are stored as json.
/integrals
:
Integral images computed with AOS are stored here. Relative pose information of integral images and ids of individual images used for integration are stored as json.
/labels
:
Labels representing the classification results performed on the integral images. GPS location of labels along with classification confidence are stored within the json file.
import asyncio
import aiohttp
async with aiohttp.ClientSession() as session:
# upload data in a form a dictionary to a json file at upload location (for e.g. '\drones') in serveraddress
async with session.request(
"put", serveraddress + uploadlocation,
data=json.dumps(data_dictionary),
headers={"content-type": "application/json"}
) as resp:
#download information of all json files present at downloadlocation (for e.g. '\drones') in serveraddress
async with session.request(
"get", serveraddress + downloadlocation
) as resp:
info = await resp.json()
For a more detailed example on the performing experiments with the SERVER look at the serverupload and utils program in DRONE.