bmi-geotiff

Access data (and metadata) from a GeoTIFF file through a BMI

https://github.com/csdms/bmi-geotiff

Science Score: 85.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
    1 of 1 committers (100.0%) from academic institutions
  • Institutional organization owner
    Organization csdms has institutional domain (csdms.colorado.edu)
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (17.2%) to scientific vocabulary

Keywords

bmi csdms geotiff python
Last synced: 6 months ago · JSON representation ·

Repository

Access data (and metadata) from a GeoTIFF file through a BMI

Basic Info
Statistics
  • Stars: 8
  • Watchers: 6
  • Forks: 1
  • Open Issues: 2
  • Releases: 4
Topics
bmi csdms geotiff python
Created almost 5 years ago · Last pushed about 1 year ago
Metadata Files
Readme Changelog Contributing License Code of conduct Citation

README.md

DOI PyPI Conda Version Test Documentation Status

bmi-geotiff

Access data (and metadata) from a GeoTIFF file through an API or a BMI.

The bmi-geotiff library accepts a filepath or an URL to a GeoTIFF file. Data are loaded into an xarray DataArray using the rioxarray open_rasterio method. The API is wrapped with a Basic Model Interface (BMI), which provides a standard set of functions for coupling with data or models that also expose a BMI. More information on the BMI can found in its documentation.

Installation

Install the latest stable release of bmi-geotiff with pip: pip install bmi-geotiff or with conda: conda install -c conda-forge bmi-geotiff

Alternately, the bmi-geotiff library can be built and installed from source. The library uses several other open source libraries, so a convenient way of building and installing it is within a conda environment. After cloning or downloading the bmi-geotiff repository, change into the repository directory and set up a conda environment with the included environment file: conda env create --file environment.yml Then build and install bmi-geotiff from source with pip install -e .

Examples

A brief example of using the bmi-geotiff API is given in the following steps. The example is derived from a similar example in the xarray documentation.

Start a Python session and import the GeoTiff class: ```python

from bmi_geotiff import GeoTiff ```

For convenience, let's use a test image from the rasterio project: ```python

url = "https://github.com/rasterio/rasterio/raw/main/tests/data/RGB.byte.tif" ```

Make an instance of GeoTiff with this URL: ```python

g = GeoTiff(url) ``` This step might take a few moments as the data are pulled from GitHub.

The data have been loaded into an xarray DataArray, which can be accessed through the da property: ```python

g.da [1703814 values with dtype=uint8] Coordinates: * band (band) int64 1 2 3 * x (x) float64 1.021e+05 1.024e+05 ... 3.389e+05 3.392e+05 * y (y) float64 2.827e+06 2.826e+06 ... 2.612e+06 2.612e+06 spatialref int64 0 Attributes: STATISTICSMAXIMUM: 255 STATISTICSMEAN: 29.947726688477 STATISTICSMINIMUM: 0 STATISTICSSTDDEV: 52.340921626611 _FillValue: 0.0 scalefactor: 1.0 add_offset: 0.0 units: metre ```

Note that coordinate reference system information is stored in the spatial_ref non-dimensional coordinate: ```python

g.da.spatialref <xarray.DataArray 'spatialref' ()> array(0) Coordinates: spatialref int64 0 Attributes: crswkt: PROJCS["WGS 84 / UTM zone 18N",GEOGCS[... semimajoraxis: 6378137.0 semiminoraxis: 6356752.314245179 inverseflattening: 298.257223563 referenceellipsoidname: WGS 84 longitudeofprimemeridian: 0.0 primemeridianname: Greenwich geographiccrsname: WGS 84 horizontaldatumname: World Geodetic System 1984 projectedcrsname: WGS 84 / UTM zone 18N gridmappingname: transversemercator latitudeofprojectionorigin: 0.0 longitudeofcentralmeridian: -75.0 falseeasting: 500000.0 falsenorthing: 0.0 scalefactoratcentralmeridian: 0.9996 spatialref: PROJCS["WGS 84 / UTM zone 18N",GEOGCS[... GeoTransform: 101985.0 300.0379266750948 0.0 2826915... ```

Display the image with the xarray.plot.imshow method. ```python

import matplotlib.pyplot as plt g.da.plot.imshow() plt.show() ```

Example GeoTiff display through *xarray*.

For examples with more detail, see the Jupyter Notebooks and Python scripts included in the examples directory of the bmi-geotiff repository.

Documentation for bmi-geotiff is available at https://bmi-geotiff.csdms.io.

Owner

  • Name: Community Surface Dynamics Modeling System
  • Login: csdms
  • Kind: organization
  • Email: csdms@colorado.edu

Cyberinfrastructure for the quantitative modeling of earth and planetary surface processes

Citation (CITATION.cff)

cff-version: 1.2.0
message: >-
  If you use this software, please cite it as below.
type: software
title: "CSDMS GeoTIFF data component"
authors:
  - family-names: Piper
    given-names: Mark
    orcid: https://orcid.org/0000-0001-6418-277X
url: 'https://github.com/csdms/bmi-geotiff'
abstract: >-
  Access data and metadata from a GeoTIFF file through a BMI.
keywords:
  - python
  - geotiff
  - bmi
  - csdms
license: MIT
version: 0.3.4
doi: 10.5281/zenodo.4721474
date-released: 2025-02-07

GitHub Events

Total
  • Release event: 1
  • Watch event: 1
  • Delete event: 4
  • Issue comment event: 2
  • Push event: 10
  • Pull request event: 6
  • Create event: 4
Last Year
  • Release event: 1
  • Watch event: 1
  • Delete event: 4
  • Issue comment event: 2
  • Push event: 10
  • Pull request event: 6
  • Create event: 4

Committers

Last synced: about 2 years ago

All Time
  • Total Commits: 71
  • Total Committers: 1
  • Avg Commits per committer: 71.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 18
  • Committers: 1
  • Avg Commits per committer: 18.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Mark Piper m****r@c****u 71
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 10
  • Total pull requests: 26
  • Average time to close issues: 5 months
  • Average time to close pull requests: about 4 hours
  • Total issue authors: 2
  • Total pull request authors: 1
  • Average comments per issue: 2.4
  • Average comments per pull request: 0.58
  • Merged pull requests: 26
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 7
  • Average time to close issues: N/A
  • Average time to close pull requests: 18 minutes
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.71
  • Merged pull requests: 7
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • mdpiper (10)
  • mcflugen (1)
Pull Request Authors
  • mdpiper (31)
Top Labels
Issue Labels
enhancement (2)
Pull Request Labels

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 56 last-month
  • Total dependent packages: 1
    (may contain duplicates)
  • Total dependent repositories: 2
    (may contain duplicates)
  • Total versions: 14
  • Total maintainers: 1
pypi.org: bmi-geotiff

Access data and metadata in a GeoTIFF file through an API or a BMI

  • Versions: 10
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 56 Last month
Rankings
Dependent packages count: 10.1%
Stargazers count: 19.4%
Average: 20.6%
Dependent repos count: 21.6%
Downloads: 22.1%
Forks count: 29.8%
Maintainers (1)
Last synced: 7 months ago
conda-forge.org: bmi-geotiff

bmi-geotiff is a Python library that allows a user Basic Model Interface (BMI) access to data and metadata in GeoTIFF files through *rioxarray* and *rasterio*.

  • Versions: 4
  • Dependent Packages: 1
  • Dependent Repositories: 1
Rankings
Dependent repos count: 24.4%
Dependent packages count: 29.0%
Average: 44.5%
Stargazers count: 58.4%
Forks count: 66.1%
Last synced: 6 months ago

Dependencies

.github/workflows/docs.yml actions
  • actions/checkout v3 composite
  • conda-incubator/setup-miniconda v2 composite
pyproject.toml pypi
  • bmipy *
  • numpy *
  • pyyaml *
  • rasterio *
  • rioxarray *
  • xarray *
docs/requirements.txt pypi
  • pandoc *
  • recommonmark *
  • sphinx *
.github/workflows/lint.yml actions
  • actions/checkout v4 composite
  • conda-incubator/setup-miniconda v3 composite
.github/workflows/test-notebooks.yml actions
  • actions/checkout v4 composite
  • conda-incubator/setup-miniconda v3 composite
.github/workflows/test.yml actions
  • AndreMiras/coveralls-python-action develop composite
  • actions/checkout v4 composite
  • conda-incubator/setup-miniconda v3 composite
environment.yml conda
  • bmi-tester
  • bmipy
  • cartopy
  • coveralls
  • matplotlib
  • notebook
  • nox
  • pandoc
  • pip
  • pytest
  • pytest-cov
  • pytest-datadir
  • python >=3.10
  • python-build
  • pyyaml
  • rasterio >=1.0
  • recommonmark
  • rioxarray
  • sphinx >=8
  • twine
  • zest.releaser