DEMTOOLS
A collection of Python tools for working with DEM (Digital Elevation Model) raster files.
GDAL Installation: GDAL is required for this package. For conda environments, use
conda install gdalto install GDAL. For non-conda environments, download the appropriate wheel file from https://github.com/cgohlke/geospatial-wheels/releases to install GDAL.
Installation
pip install -e .
Features
- chgnodata: Convert (replace) the nodata value of GeoTIFF files, updating pixel data accordingly
- defnodata: Assign a nodata value to GeoTIFF files without modifying pixel data (metadata only)
- csv2tif: Convert a plain-numeric CSV raster grid to a GeoTIFF file
Usage
Command-line
# List all available commands
demtools-info
# Convert nodata values for all TIF files in the current directory
chgnodata -a
# Convert nodata of a single file to -9999
chgnodata -i dem.tif -v -9999
# Set nodata metadata for all TIF files (no pixel data change)
defnodata -a -v -9999
# Convert a CSV grid to GeoTIFF
csv2tif -i grid.csv -o dem.tif --xll 250000 --yll 2500000 --cellsize 5 --epsg 32648
Python API
from demtools import chgnodata, defnodata, csv2tif
# Convert nodata value in a raster file
chgnodata.convert_nodata_value("dem.tif", output_nodata=-9999)
# Assign nodata metadata without touching pixel values
defnodata.define_nodata_value("dem.tif", nodata_value=-9999)
# Convert CSV grid to GeoTIFF
csv2tif.csv_to_tif(
input_csv="grid.csv",
output_tif="dem.tif",
xll=250000,
yll=2500000,
cellsize=5,
nodata=-999,
epsg=32648,
)
Notes
chgnodataanddefnodataautomatically create aRAS_BAK/directory with backup copies before modifying files.csv2tifexpects a plain numeric CSV (no headers), with rows ordered from north to south.- GDAL must be installed separately via conda or a pre-built wheel; it is not listed in
requirements.txtas it cannot be reliably installed via pip on all platforms.
Metadata
Release files for demtools 0.10.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| demtools-0.10.5.tar.gz | 10.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| demtools-0.10.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 27.0 kB
Release files / demtools-0.10.5.tar.gz
| Download URL | demtools-0.10.5.tar.gz |
|---|---|
| Size | 10.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
81ad1b54169eb28b10de6206a4c46e6fa709c2f8063bd8bba2ed18c11d3d85cb
|
|
BLAKE2b-256 checksum How to use checksums |
ccf3a9831015c231422ff97726a6b83847277965cce1eadcd0ec1765544b73e3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 23, 2026.
Transparency logRelease files / demtools-0.10.5-py3-none-any.whl
| Download URL | demtools-0.10.5-py3-none-any.whl |
|---|---|
| Size | 16.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7cbf1f869d21be451e228adc91e717169a4e90b4327b8562b405c0c25861f67c
|
|
BLAKE2b-256 checksum How to use checksums |
91220fb5e1e6e19092555e8810d79a701a7a67eb5b6837cf4eecbd78af1025bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 23, 2026.
Transparency log