A command-line interface for managing imagery collections and running Mapflow AI image processing. This tool allows you to create collections (mosaics), upload images, and run AI model through the Mapflow-API.
IMPORTANT
python 3.11+is required!
- Create and activate virtual environment
python -m venv .venvsource .venv/bin/activate # On Windows: .venv\Scripts\activate- Install the project dependencies from
requirements.txt
pip install -r requirements.txt- Use the
.env.templatefile as an example to create the.envin the same directory with BASE_URL and Whitemaps API USER_TOKEN
python -m scripts.mosaic COMMAND {create,upload,images} [-h] [-n NAME] [-t TAGS] [-p PATH] [--mosaic-id MOSAIC_ID]
COMMAND:
create- Creates a mosaic with the specified name-nand tags-tupload- Uploads the specified-pimage or all images from the directory to the specified mosaic--mosaic-idmosaics- Displays a list of all the mosaics available to userimages- Displays a list of all the images in the mosaic--mosaic-id
Arguments:
-h- Help-n- Mosaic name-t- Mosaic tags-p- Path to the uploaded image or directory with .tif images--mosaic-id- Mosaic id
Mosaic creation
python -m scripts.mosaic create -n "mosaic_name" -t "tag1, tag2, ..."Single image uploading
python -m scripts.mosaic upload -p "image.tif" --mosaic-id "UUID"Bulk uploading of images from the specified directory
python -m scripts.mosaic upload -p "/images" --mosaic-id "UUID"Get list of all mosaics
python -m scripts.mosaic mosaicsGet list of all images in mosaic
python -m scripts.mosaic images --mosaic-id "UUID"python -m scripts.project COMMAND {create,projects,processings} [-h] [-n NAME] [-d DESCRIPTION] [--project-id PROJECT_ID]
COMMAND:
create- Creates a project with the specified name-nand description-dprojects- Displays a list of all the projects available to userprocessings- Displays a list of all the processings in the project--project-id
Arguments:
-h- Help-n- Project name-d- Project description--project-id- Project id
Project creation
python -m scripts.project create -n "project_name" -d "project_description"Get list of all projects
python -m scripts.project projectsGet list of all processings in project
python -m scripts.project processings --project-id "UUID"python -m scripts.processing COMMAND {models,start,status,download} [-h] [--mosaic-id MOSAIC_ID | --image-id IMAGE_ID] [-n NAME] [--wd-id WD_ID] [--project-id PROJECT_ID] [-o OPTIONS] [-g GEOMETRY] [--processing-id PROCESSING_ID] [-p PATH]
COMMAND:
models- Displays a list of all the models available for userstart- Starts a processing with the specified:- name
-n, image/mosaic--image/mosaic-id(only one of these can be passed), - AI model id
--wd-id, - case-sensitive, comma-separated options
-ofor the selected model (None if not passed), - project
--project-idwhere the processing will be stored (Default will be used automatically if other is not passed), - Path to the geometry
-g(AOI). If not provided - the footprint of the 'image' or 'mosaic' will be used automatically.
- name
status- Shows the status and completion percentage for a given processing--processing-iddownload- Downloads .geojson processing--processing-idresults to the specified-ppath
Arguments:
-h- Help-n- Processing name--image-id- Image id--mosaic-id- Mosaic id--wd-id- AI model id-o- Model options--project-id- Project id-g- Path to .geojson processing geometry (AOI)-p- Path for downloading the processing results
Instead of "wd-id" you can use "wd-name" argument with the texting name of the model
Get list of models
python -m scripts.processing modelsFull arguments processing start
python -m scripts.processing start -n "processing_name" --image-id "UUID" --wd-id "UUID" --project-id "UUID" -o "Classification, Simplification, ..." -g "aoi.geojson"Quick processing start
python -m scripts.processing start -n "processing_name" --mosaic-id "UUID" --wd-id "UUID"Download the processing results
python -m scripts.processing download -p "results.geojson" --processing-id "UUID"Get processing status
python -m scripts.processing status --processing-id "UUID"