- Current version:
v3.0.1
- Relevant tags:
raster
,spatial data
,geoserver
Package developed to facilitate the upload of spatial data to the Geoserver platform in ImageMosaic format.
List of necessary tools to run the project:
- Python 3.10
- Geoserver
- gsconfig-py3 package installed
In you enviroment install as follows:
git clone https://github.com/dimitri-justeau/gsconfig-py3.git
cd gsconfig-py3/
python setup.py install
pip install git+https://github.com/CIAT-DAPA/aclimate_v3_spatial_importer
To install a specific version:
pip install git+https://github.com/CIAT-DAPA/aclimate_v3_spatial_importer@v3.0.1
Set environmental variables as follows:
- Windows:
set GEOSERVER_URL=http://your_geoserver/geoserver/rest/
set GEOSERVER_USER=your_user
set GEOSERVER_PASSWORD=your_password
- Linux:
export GEOSERVER_URL=http://your_geoserver/geoserver/rest/
export GEOSERVER_USER=your_user
export GEOSERVER_PASSWORD=your_password
- Upload raster files or delete store
from aclimate_v3_spatial_importer import upload_image_mosaic
# Define required parameters
workspace = "test"
store = "test_store"
date_format = "yyyyMM"
data_dir = "./data/"
# Function to upload the image mosaic
upload_image_mosaic(workspace, store, data_dir, date_format)
#Functions to delete a store
delete_store(workspace, store)
Note
You must change the paths to where your files are located.
Required variables:
- GEOSERVER_URL: Base URL of GeoServer (e.g., http://localhost:8080/geoserver/rest/)
- GEOSERVER_USER: Username
- GEOSERVER_PASSWORD: Password
aclimate_v3_spatial_importer/
│
├── .github/
│ └── workflows/ # CI/CD pipeline configurations
├── src/
│ └── aclimate_v3_spatial_importer/
│ ├── conf/ # Date format for layers
│ ├── __init__.py # Public interface
│ ├── importer.py # Import to Geoserver function
│ └── tools.py # gsconfig-py package functions
├── setup.py
└── requirements.txt # Package dependencies