Solafune internal geodata management tools
Project description
solafune_tools: Internal Geodata Creation and Management Tools
This package contains tools to download STAC catalogs and Sentinel-2 imagery from Planetary Computer and assembling it into a cloudless mosaic. Other tools will be added in the future.
Quickstart
Install the package using pip
, recommend using python 3.10:
pip install solafune_tools
Before using the library, you can set the directory where you want to store data by calling
solafune_tools.set_data_directory(dir_path="your_data_dir_here")
The above command sets the environment variable 'solafune_tools_data_dir' from where all sub-modules draw their file paths. If you do not explicitly set this, it will default to creating a data
folder within your current working directory.
A typical workflow to assemble a cloudless mosaic is as follows:
- Get the Sentinel-2 catalog items for your area of interest (pass in a geojson) and a date range.
plc_stac_catalog = solafune_tools.planetary_computer_stac_query(
start_date="2023-05-01",
end_date="2023-08-01",
aoi_geometry_file= "data/geojson/xyz_bounds.geojson"),
)
- Download files for the bands you want for these catalog items.
solafune_tools.planetary_computer_fetch_images(
dataframe_path=plc_stac_catalog,
bands=["B02", "B03", "B04"],
dest_dir=os.path.join(data_dir, "tif/"),
)
- Assemble a STAC catalog of local files (this is necessary for mosaicking)
local_stac = solafune_tools.make_catalog(
input_filename=plc_stac_catalog,
bands=["B04", "B03", "B02"],
tif_files_dir=os.path.join(data_dir, "tif/"),
outdir=os.path.join(data_dir, "stac/"),
)
- Make a cloudless mosaic
mosaic_file_loc = solafune_tools.make_mosaic(
stac_catalog = local_stac,
outfile_loc = os.path.join(
data_dir,
"mosaics",
"outval.tif"
),
epsg = None,
resolution = 100,
):
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file solafune-tools-0.1.8.tar.gz
.
File metadata
- Download URL: solafune-tools-0.1.8.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 724f7b0f013b1c83eb5c85da2d5a4dc76c4147f404738ddf9e961fe634d928d3 |
|
MD5 | ff60cb121111c0c71aa2fd94eb7e29b6 |
|
BLAKE2b-256 | 5fdf7697b4aca0f2425e568fb7f190e5cb089502963b26d2fbab8e943eff9b19 |
File details
Details for the file solafune_tools-0.1.8-py3-none-any.whl
.
File metadata
- Download URL: solafune_tools-0.1.8-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 903b2ffddf0b71d618b1e5d3f093c70868aa92cfb3fae3770745c9fa4fdce147 |
|
MD5 | 8f65fffa682d2bc6eda899c8dac8e7e2 |
|
BLAKE2b-256 | 16f19015a94ad5c82f15fd8493768c0dbdc51754a13c6f568fc1435a78eb13b2 |