Rasterio reads and writes geospatial raster datasets

Overview

Rasterio

Rasterio reads and writes geospatial raster data.

https://travis-ci.com/mapbox/rasterio.png?branch=master https://coveralls.io/repos/github/mapbox/rasterio/badge.svg?branch=master

Geographic information systems use GeoTIFF and other formats to organize and store gridded, or raster, datasets. Rasterio reads and writes these formats and provides a Python API based on N-D arrays.

Rasterio 1.2 works with Python versions 3.6 through 3.9, Numpy versions 1.15 and newer, and GDAL versions 2.3 through 3.2. Official binary packages for Linux and Mac OS X are available on PyPI. Unofficial binary packages for Windows are available through other channels.

Read the documentation for more details: https://rasterio.readthedocs.io/.

Example

Here's an example of some basic features that Rasterio provides. Three bands are read from an image and averaged to produce something like a panchromatic band. This new band is then written to a new single band TIFF.

import numpy as np
import rasterio

# Read raster bands directly to Numpy arrays.
#
with rasterio.open('tests/data/RGB.byte.tif') as src:
    r, g, b = src.read()

# Combine arrays in place. Expecting that the sum will
# temporarily exceed the 8-bit integer range, initialize it as
# a 64-bit float (the numpy default) array. Adding other
# arrays to it in-place converts those arrays "up" and
# preserves the type of the total array.
total = np.zeros(r.shape)
for band in r, g, b:
    total += band
total /= 3

# Write the product as a raster band to a new 8-bit file. For
# the new file's profile, we start with the meta attributes of
# the source file, but then change the band count to 1, set the
# dtype to uint8, and specify LZW compression.
profile = src.profile
profile.update(dtype=rasterio.uint8, count=1, compress='lzw')

with rasterio.open('example-total.tif', 'w', **profile) as dst:
    dst.write(total.astype(rasterio.uint8), 1)

The output:

http://farm6.staticflickr.com/5501/11393054644_74f54484d9_z_d.jpg

API Overview

Rasterio gives access to properties of a geospatial raster file.

with rasterio.open('tests/data/RGB.byte.tif') as src:
    print(src.width, src.height)
    print(src.crs)
    print(src.transform)
    print(src.count)
    print(src.indexes)

# Printed:
# (791, 718)
# {u'units': u'm', u'no_defs': True, u'ellps': u'WGS84', u'proj': u'utm', u'zone': 18}
# Affine(300.0379266750948, 0.0, 101985.0,
#        0.0, -300.041782729805, 2826915.0)
# 3
# [1, 2, 3]

A rasterio dataset also provides methods for getting extended array slices given georeferenced coordinates.

with rasterio.open('tests/data/RGB.byte.tif') as src:
    print src.window(**src.window_bounds(((100, 200), (100, 200))))

# Printed:
# ((100, 200), (100, 200))

Rasterio CLI

Rasterio's command line interface, named "rio", is documented at cli.rst. Its rio insp command opens the hood of any raster dataset so you can poke around using Python.

$ rio insp tests/data/RGB.byte.tif
Rasterio 0.10 Interactive Inspector (Python 3.4.1)
Type "src.meta", "src.read(1)", or "help(src)" for more information.
>>> src.name
'tests/data/RGB.byte.tif'
>>> src.closed
False
>>> src.shape
(718, 791)
>>> src.crs
{'init': 'epsg:32618'}
>>> b, g, r = src.read()
>>> b
masked_array(data =
 [[-- -- -- ..., -- -- --]
 [-- -- -- ..., -- -- --]
 [-- -- -- ..., -- -- --]
 ...,
 [-- -- -- ..., -- -- --]
 [-- -- -- ..., -- -- --]
 [-- -- -- ..., -- -- --]],
             mask =
 [[ True  True  True ...,  True  True  True]
 [ True  True  True ...,  True  True  True]
 [ True  True  True ...,  True  True  True]
 ...,
 [ True  True  True ...,  True  True  True]
 [ True  True  True ...,  True  True  True]
 [ True  True  True ...,  True  True  True]],
       fill_value = 0)

>>> np.nanmin(b), np.nanmax(b), np.nanmean(b)
(0, 255, 29.94772668847656)

Rio Plugins

Rio provides the ability to create subcommands using plugins. See cli.rst for more information on building plugins.

See the plugin registry for a list of available plugins.

Installation

Please install Rasterio in a virtual environment so that its requirements don't tamper with your system's Python.

SSL certs

The Linux wheels on PyPI are built on CentOS and libcurl expects certs to be in /etc/pki/tls/certs/ca-bundle.crt. Ubuntu's certs, for example, are in a different location. You may need to use the CURL_CA_BUNDLE environment variable to specify the location of SSL certs on your computer. On an Ubuntu system set the variable as shown below.

$ export CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt

Dependencies

Rasterio has a C library dependency: GDAL >= 2.3. GDAL itself depends on some other libraries provided by most major operating systems and also depends on the non standard GEOS and PROJ4 libraries. How to meet these requirement will be explained below.

Rasterio's Python dependencies are listed in its requirements.txt file.

Development also requires (see requirements-dev.txt) Cython and other packages.

Binary Distributions

Use a binary distributions that directly or indirectly provide GDAL if possible.

Linux

Rasterio distributions are available from UbuntuGIS and Anaconda's conda-forge channel.

Manylinux1 wheels are available on PyPI.

OS X

Binary distributions with GDAL, GEOS, and PROJ4 libraries included are available for OS X versions 10.9+. To install, run pip install rasterio. These binary wheels are preferred by newer versions of pip.

If you don't want these wheels and want to install from a source distribution, run pip install rasterio --no-binary rasterio instead.

The included GDAL library is fairly minimal, providing only the format drivers that ship with GDAL and are enabled by default. To get access to more formats, you must build from a source distribution (see below).

Windows

Binary wheels for rasterio and GDAL are created by Christoph Gohlke and are available from his website.

To install rasterio, simply download both binaries for your system (rasterio and GDAL) and run something like this from the downloads folder, adjusting for your Python version.

$ pip install -U pip
$ pip install GDAL-3.1.4-cp39-cp39‑win_amd64.whl
$ pip install rasterio‑1.1.8-cp39-cp39-win_amd64.whl

You can also install rasterio with conda using Anaconda's conda-forge channel.

$ conda install -c conda-forge rasterio

Source Distributions

Rasterio is a Python C extension and to build you'll need a working compiler (XCode on OS X etc). You'll also need Numpy preinstalled; the Numpy headers are required to run the rasterio setup script. Numpy has to be installed (via the indicated requirements file) before rasterio can be installed. See rasterio's Travis configuration for more guidance.

Linux

The following commands are adapted from Rasterio's Travis-CI configuration.

$ sudo add-apt-repository ppa:ubuntugis/ppa
$ sudo apt-get update
$ sudo apt-get install gdal-bin libgdal-dev
$ pip install -U pip
$ pip install rasterio

Adapt them as necessary for your Linux system.

OS X

For a Homebrew based Python environment, do the following.

$ brew update
$ brew install gdal
$ pip install -U pip
$ pip install --no-binary rasterio

Windows

You can download a binary distribution of GDAL from here. You will also need to download the compiled libraries and headers (include files).

When building from source on Windows, it is important to know that setup.py cannot rely on gdal-config, which is only present on UNIX systems, to discover the locations of header files and libraries that rasterio needs to compile its C extensions. On Windows, these paths need to be provided by the user. You will need to find the include files and the library files for gdal and use setup.py as follows. You will also need to specify the installed gdal version through the GDAL_VERSION environment variable.

$ python setup.py build_ext -I<path to gdal include files> -lgdal_i -L<path to gdal library> install

With pip

$ pip install --no-use-pep517 --global-option -I<path to gdal include files> -lgdal_i -L<path to gdal library> .

Note: --no-use-pep517 is required as pip currently hasn't implemented a way for optional arguments to be passed to the build backend when using PEP 517. See here for more details.

Alternatively environment variables (e.g. INCLUDE and LINK) used by MSVC compiler can be used to point to include directories and library files.

We have had success compiling code using the same version of Microsoft's Visual Studio used to compile the targeted version of Python (more info on versions used here.).

Note: The GDAL DLL and gdal-data directory need to be in your Windows PATH otherwise rasterio will fail to work.

Support

The primary forum for questions about installation and usage of Rasterio is https://rasterio.groups.io/g/main. The authors and other users will answer questions when they have expertise to share and time to explain. Please take the time to craft a clear question and be patient about responses.

Please do not bring these questions to Rasterio's issue tracker, which we want to reserve for bug reports and other actionable issues.

While Rasterio's repo is in the Mapbox GitHub organization, Mapbox's Support team is focused on customer support for its commercial platform and Rasterio support requests may be perfunctorily closed with or without a link to https://rasterio.groups.io/g/main. It's better to bring questions directly to the main Rasterio group at groups.io.

Development and Testing

See CONTRIBUTING.rst.

Documentation

See docs/.

License

See LICENSE.txt.

Authors

See AUTHORS.txt.

Changes

See CHANGES.txt.

Who is Using Rasterio?

See here.

Comments
  • 1.3.0 release

    1.3.0 release

    We've got some new features done and only two outstanding features. Are there any objections to an alpha release tomorrow?

    For the wheels, getting this patch https://github.com/OSGeo/gdal/pull/4646 could resolve #2233 .

    opened by sgillies 48
  • Add Python file-like VSI Plugin

    Add Python file-like VSI Plugin

    The Goal

    See https://github.com/corteva/rioxarray/issues/246 for details on the origins of this feature.

    The goal is to make it as efficient as possible for rasterio to open a Python file-like object. The biggest benefit of a feature like this comes when a library like fsspec is combined with rasterio. fsspec provides a unified interface for accessing files including remote file systems like S3 or GCS and has the ability to cache files locally. It can provide these files as python file-like objects. An example of using fsspec and providing its file to rasterio looks like:

    import rasterio
    import fsspec
    
    with fsspec.open('https://sentinel-cogs.s3.us-west-2.amazonaws.com/sentinel-s2-l2a-cogs/13/S/DV/2020/4/S2B_13SDV_20200428_0_L2A/TCI.tif') as fobj:
        with rasterio.open(fobj) as src:
            print(src.profile)
    

    The Current Issue

    Currently, rasterio uses a MemoryFile, a GDAL supported feature that reads all the necessary data into memory and accesses the data from there instead of disk. This is great, except that it requires reading all of the data from the file before we need it. This means a lot of time (especially for remote resources) and a lot of memory. With the above example and using the rasterio master branch it takes about ~21s on my laptop to do the above.

    The Solution - Attempt 2

    The current version of this pull request uses GDAL's plugin interfaces to add all necessary hooks (callbacks) for GDAL to communicate with rasterio and the file-like objects that you provide to it. This comes as two parts: the virtual filesystem and the individual file handling. Right now the filesystem is all kept in a single python dictionary (virtual filename -> file wrapper object). The file handling is fairly basic and doesn't need to be too complicated as the basic FILE* operations map to file-like objects (ex read, seek, tell, etc).

    I haven't done anything for writing or for multi-range reads.

    TODO

    • [x] Switch to GDAL Plugin system. I didn't know about this when I started and it could mean moving all the .cpp stuff into Cython which would be great for maintainability. This will be "Attempt 2".
    • [ ] Figure out multi-threading behavior and multi-process behavior. This is mostly related to how the file system treats a file when rasterio is using it. Also, determines if/when we need locking. This includes the GIL. For example, if GDAL is making its own threads (outside of python), then we may need to explicitly create the thread-local GIL.
    • [x] Add tests
    • [x] Add documentation
    • [x] Add docstrings
    • [x] Answer below questions

    Questions

    1. Will this replace all rasterio handling of non-string inputs (objects)? Probably not, but in that case when is MemoryFile used instead? Do users get a kwarg to choose? Answer: It will replace reading of file-like objects.
    2. Should this be limited to fsspec objects or any file-like object (handling any missing methods gracefully)? Limiting to fsspec objects may let us assume some things. Answer: All file-like objects.
    3. Are users allowed to provide a filename for the open file object to help GDAL know how to refer to it? If so, what happens if a user provides two different objects with the same name? Answer: Yes, but only to match the existing interface of MemoryFile. Conflicts have an undefined behavior.
    4. Can we support multi-range reads in a semi-standard way? Answer: No. Ignore it for now.
    opened by djhoese 42
  • Appveyor builds

    Appveyor builds

    I've been away from Windows for over a decade. Anyone have experience making Windows binaries with Appveyor as described in https://packaging.python.org/en/latest/appveyor.html?

    /cc @brendan-ward

    packaging intermediate 
    opened by sgillies 41
  • rio-calc, take 1

    rio-calc, take 1

    Towards closing #175.

    Usage, for now, like this:

    $ rio calc "0.10*{1} + 125" tests/data/shade.tif out.tif

    Results in a new hillshade with shade values of 125 instead of 0.

    enhancement cli 
    opened by sgillies 30
  • Weird interaction with scipy nightly builds

    Weird interaction with scipy nightly builds

    Expected behavior and actual behavior.

    The Satpy project has a CI environment that installs various dependencies from their "unstable" sources (nightly builds, git repositories, etc). Recently (in the last week probably), I've started getting this exception:

     /usr/share/miniconda3/envs/test-environment/lib/python3.9/site-packages/trollimage/xrimage.py:58: in <module>
        from rasterio.windows import Window
    /usr/share/miniconda3/envs/test-environment/lib/python3.9/site-packages/rasterio/__init__.py:11: in <module>
        with rasterio._loading.add_gdal_dll_directories():
    E   AttributeError: partially initialized module 'rasterio' has no attribute '_loading' (most likely due to a circular import)
    

    Steps to reproduce the problem.

    I'm still trying to reproduce it locally. Theoretically just doing the import above should cause it.

    Failing job: https://github.com/pytroll/satpy/actions/runs/3055333856/jobs/4956174627

    Environment Information

    • Output from: rio --show-versions or python -c "import rasterio; rasterio.show_versions()"
    • rasterio version (python -c "import rasterio; print(rasterio.__version__)")

        Created wheel for rasterio: filename=rasterio-1.4.dev0-cp39-cp39-linux_x86_64.whl size=1474741 sha256=ebce139195b79b11d1baa440541745a20a689ef45d6fbcd3af0794544d17e758
      
    • GDAL version (python -c "import rasterio; print(rasterio.__gdal_version__)"): 3.5.2

    • Python version (python -c "import sys; print(sys.version.replace('\n', ' '))"): 3.9

    • Operation System Information (python -c "import platform; print(platform.platform())"): Ubuntu (ubuntu-latest github action)

    Installation Method

    Conda-forge base packages but pip install various packages with pip from git/nightly builds.

    opened by djhoese 29
  • Merge with method=max, min have aliased result on overlap

    Merge with method=max, min have aliased result on overlap

    Hello,

    When working on Linux (Windows is fine), I have an aliased result on overlapping areas when merging datasets with max and min methods. first method is OK.

    The working area: 2021-07-16_09h38_47

    Here is the correct screenshot (first method): 2021-07-16_09h34_35

    And here the broken one (both min and max are a like, I didn't test other methods): 2021-07-16_09h34_40

    When zooming to the pixel, this is what we got: 2021-07-16_09h35_36

    My code is:

    # From the zip uploaded hereafter
    paths = ["14_20200228T143729_S2_T18HXC_L1C_175923_CLIP.tif", "14_20200228T143729_S2_T18HXD_L1C_175923_CLIP.tif"]
    method = "max"  # min or first
    
    # Open datasets for merging
    datasets = []
    try:
        for path in paths:
            datasets.append(rasterio.open(str(path)))
    
        # Merge all datasets
        merged_array, merged_transform = merge.merge(datasets, method=method)
        merged_meta = datasets[0].meta.copy()
        merged_meta.update(
            {
                "driver": "GTiff",
                "height": merged_array.shape[1],
                "width": merged_array.shape[2],
                "transform": merged_transform,
            }
        )
    finally:
        # Close all datasets
        for dataset in datasets:
            dataset.close()
    
    # Write on disk
    with rasterio.open("test_min2.tif", "w", **merged_meta) as dst:
        dst.write(merged_array)
    

    It does not seem to happen all the time, but here are my datasets: MOSAIC.zip

    And my results: results.zip

    Operating system

    Linux (through docker), not reproducible on windows !

    Rasterio version and provenance

    Rasterio 1.2.6 via pip (both on windows and linux)

    opened by remi-braun 28
  • Wrap ndarry, transform, and CRS into an object

    Wrap ndarry, transform, and CRS into an object

    There are a number of places where a rasterio operation takes as input a raster or raster band, OR a numpy ndarray, transform, and sometimes CRS. This complicates the function signatures a bit, as it means having parameters that are meaningful in some cases but not others, and it lacks a bit of cohesion between related entities that may be helpful in many cases.

    Perhaps it is time to create a lightweight object (tuple or class) that wraps these together, so that we can pass just one thing around and have it be more equivalent to passing a raster / raster band?

    Something like the Raster object in @perrygeo 's python-rasterstats package, but not wrapping rasters / bands; only ndarrays.

    This surfaced in #578, among others.

    opened by brendan-ward 28
  • Remove deprecated features

    Remove deprecated features

    Closes https://github.com/mapbox/rasterio/issues/516 Closes https://github.com/mapbox/rasterio/issues/794

    Remove deprecated features and API's. See docs/migrating-to-v1.rst for a general description.

    opened by geowurster 27
  • Rasterio 1.2.0

    Rasterio 1.2.0

    Let's do this before the end of October.

    New features include:

    • VSI cache clearing #1078
    • API for driver metadata (like https://github.com/Toblerity/Fiona/pull/950)
    • RPC support #1922
    • More: https://github.com/mapbox/rasterio/milestone/95?closed=1
    Epic 
    opened by sgillies 26
  • Support or supplant vsi* networking virtual file system functionality in GDAL (e.g. vsicurl, vsis3)

    Support or supplant vsi* networking virtual file system functionality in GDAL (e.g. vsicurl, vsis3)

    Between 0.29.0 and 0.30.0, functionality was introduced to specifically support the virtual file system functinality vsigzip, vsizip, and vsitar. As can be seen in this code, along with explicit support for some virtual file systems, some functionality for other virtual file system support that was previously and unintentionally exposed was explicitly disallowed, and calls that had taken advantage of that GDAL functionality began throwing a "VFS scheme {0} unknown" exception upon upgrade of rasterio.

    Part of the GDAL functionality that became inaccessible through rasterio was accessing rasters over HTTP with vsicurl. That feature in particular was useful to myself and others, since we were relying on it to do windowed reads of large rasters over the network, without pulling down the whole file. In this way we can have multiple processes pulling byte ranges of a GeoTiff off of S3 (which supports the byte range HTTP request header), as a mechanism of doing tiling work using rasterio and PySpark (see the OpenAerialMap tiler code here...this "chunking" step had some problems dealing with very large rasters so if you're interested in using these techniques make sure to look to the master branch's version and any unmerged PR's).

    I started a discussion on a merged pull request, which is the place I found the most definitive language about why vsicurl was no longer supported. It was smartly recommended that we start a separate ticket instead of talking on a merged PR, and this ticket can serve this purpose. Please read the prior discussion as if they were the first comments on this issue.

    /cc @sgillies @perrygeo @mojodna

    enhancement 
    opened by lossyrob 26
  • Occasional

    Occasional "not recognized as a supported file format" errors when reading from S3

    Lately, we have encountered a strange bug in Terracotta. It basically always leads to errors like these:

    (from https://github.com/DHI-GRAS/terracotta/issues/139)

    Traceback (most recent call last):
      File "rasterio/_base.pyx", line 213, in rasterio._base.DatasetBase.__init__
      File "rasterio/_shim.pyx", line 64, in rasterio._shim.open_dataset
      File "rasterio/_err.pyx", line 205, in rasterio._err.exc_wrap_pointer
    rasterio._err.CPLE_OpenFailedError: '/vsis3/italy-composite/rasters/italy_2018_red.tif' not recognized as a supported file format.
    

    or

    (from https://github.com/DHI-GRAS/terracotta/issues/10#issuecomment-489826885)

    Traceback (most recent call last):
      File "rasterio/_io.pyx", line 698, in rasterio._io.DatasetReaderBase._read
      File "rasterio/shim_rasterioex.pxi", line 133, in rasterio._shim.io_multi_band
      File "rasterio/_err.pyx", line 182, in rasterio._err.exc_wrap_int
    rasterio._err.CPLE_AppDefinedError: IReadBlock failed at X offset 0, Y offset 0: '/vsis3/bucket/prefix/tile330.tif' does not exist in the file system, and is not recognized as a supported dataset name.
    

    The errors occur on different versions of rasterio, although anecdotally it wasn't a problem pre-1.0.15. It also seems to occur both during rasterio.open, and when actually reading tiles via WarpedVRT.read.

    The problem is that we have only observed it with huge raster files, and we haven't been able to reproduce this reliably, or in a way where I could share it with you.

    I am opening this issue to see if you have some intuition why the problem might occur. If you think it just adds noise, please feel free to close it.

    opened by dionhaefner 22
  • Using more intermediate VRTs in higher-level tools

    Using more intermediate VRTs in higher-level tools

    For example, gdal_translate uses a VRT under the hood to gather changes and options and then relies on GDALCreateCopy to materialize those changes and produce an output file: https://github.com/OSGeo/gdal/blob/master/apps/gdal_translate_lib.cpp#L2511.

    Rasterio's merge tool could similarly take advantage of an internal VRT. Our existing merge tool produces very large numpy arrays as its only possible output. An example of the direction we might take is shown in #2699.

    Rasterio stack CLI program could also use a VRT. Stacking by itself wouldn't need to use a lot of resources, it would only be when materializing hefty stacks to a file that the deferred work would be done.

    And of course, Rasterio's convert CLI program could use a VRT in the same way gdal_translate does.

    There's no immediate action here. I want to show that #2699 isn't entirely out of the blue and is part of a theme I've been thinking about for a while: Rasterio making virtual datasets using Python XML libs and GDAL reading those datasets.

    cli notebooks tool vrt 
    opened by sgillies 0
  • VRT form of merging

    VRT form of merging

    There's a lot of overlap between rasterio's merge and GDAL's GDALBuildVRT utility. I believe having two different ways to do the same kind of thing is a step backwards for this project. As an alternative to #2573, which wraps GDALBuildVRT, I've reimplemented the GDAL utility in Python, building on existing code in _boundless_vrt_doc.

    Advantages over using GDALBuildVRT:

    • It's compatible with Rasterio dataset objects. GDALBuildVRT only understands GDAL filenames.
    • It returns an XML string, making temporary files on the filesystem unnecessary.
    • It's Python. Easy to read and modify. GDALBuildVRT is C++. Harder to read and modify.
    • It shares code with _boundless_vrt_doc. We can continue to refactor and develop a better virtual dataset story throughout Rasterio.
    • It shares code with merge. The functions could be refactored so that merge uses virtual_merge, which also has the potential to resolve other issues in our tracker (like #507 and #2221).

    The name of this function and the module it lives in are undecided.

    This can totally replace gdal.BuildVRT for OSMnx (in #2573) and doesn't require wrapping GDALBuildVRT. Just because a Rasterio user wants something that GDAL.X does doesn't mean we need to literally expose GDAL.X from Rasterio. GDAL's API design can be improved upon and Rasterio is the project to do those improvements.

    Resolves #2573

    vrt 
    opened by sgillies 2
  • ENH: Add support for merging tiffs with different CRS

    ENH: Add support for merging tiffs with different CRS

    (Following https://github.com/rasterio/rasterio/issues/2696)

    I have been looking into the implementation of rasterio.merge.merge to "prefetch" common bounds from a group of rasters. Once working on my implementation (since the function isn't currently too modular) I realized that I was getting errors when calculating common bounds of tiffs.

    After some investigation, it turns out this was because the CRS of each tif was different, resulting in bounds given in different units. Before implementing my own solution, I looked at the merge implementation again but found no consideration for this. In the end, I implemented a solution based on rasterio.warp.transform_bounds.

    I currently implemented this solution with a separate function since it may be a backward breaking change and I'm not sure whether that is something that would be appreciated. I replicated all existing tests for the new merge function (with support for multiple CRSs) but still need to add tests to check the feature specifically (i.e. actively try to merge tiffs with different CRSs).

    opened by VehpuS 0
  • (How) is the rasterio.merge function taking into account different crs for the rasters

    (How) is the rasterio.merge function taking into account different crs for the rasters

    Discussed in https://github.com/rasterio/rasterio/discussions/2682

    Originally posted by VehpuS December 15, 2022 I have been looking into the implementation of rasterio.merge.merge to "prefetch" common bounds from a group of rasters. Once working on my implementation (since the function isn't currently too modular) I realized that I was getting errors when calculating common bounds of tiffs.

    After some investigation, it turns out this was because the CRS of each tif was different, resulting in bounds given in different units. Before implementing my own solution, I looked at the merge implementation again but found no consideration for this. In the end, I implemented a solution based on rasterio.warp.transform_bounds.

    I'm writing here to check if I missed something. If not, I would be happy to make changes to the merge function to either fix this or specify the assumption that all tiffs (and the target bounds parameters) are assumed to share the same CRS before running merge. I have a good approach for a solution if necessary, but I wanted to confirm my suspicions before implementing a PR.

    opened by VehpuS 3
Releases(1.3.4)
Owner
Mapbox
Mapbox is the location data platform for mobile and web applications. We're changing the way people move around cities and explore our world.
Mapbox
Calculate the area inside of any GeoJSON geometry. This is a port of Mapbox's geojson-area for Python

geojson-area Calculate the area inside of any GeoJSON geometry. This is a port of Mapbox's geojson-area for Python. Installation $ pip install area U

Alireza 87 Dec 14, 2022
Python library to visualize circular plasmid maps

Plasmidviewer Plasmidviewer is a Python library to visualize plasmid maps from GenBank. This library provides only the function to visualize circular

Mori Hideto 9 Dec 04, 2022
WebGL2 powered geospatial visualization layers

deck.gl | Website WebGL2-powered, highly performant large-scale data visualization deck.gl is designed to simplify high-performance, WebGL-based visua

Vis.gl 10.5k Jan 08, 2023
glTF to 3d Tiles Converter. Convert glTF model to Glb, b3dm or 3d tiles format.

gltf-to-3d-tiles glTF to 3d Tiles Converter. Convert glTF model to Glb, b3dm or 3d tiles format. Usage λ python main.py --help Usage: main.py [OPTION

58 Dec 27, 2022
Tile Map Service and OGC Tiles API for QGIS Server

Tiles API Add tiles API to QGIS Server Tiles Map Service API OGC Tiles API Tile Map Service API - TMS The TMS API provides these URLs: /tms/? to get i

3Liz 6 Dec 01, 2021
Zora is a python program that searches for GeoLocation info for given CIDR networks , with options to search with API or without API

Zora Zora is a python program that searches for GeoLocation info for given CIDR networks , with options to search with API or without API Installing a

z3r0day 1 Oct 26, 2021
Simple, concise geographical visualization in Python

Geographic visualizations for HoloViews. Build Status Coverage Latest dev release Latest release Docs What is it? GeoViews is a Python library that ma

HoloViz 445 Jan 02, 2023
peartree: A library for converting transit data into a directed graph for sketch network analysis.

peartree 🍐 🌳 peartree is a library for converting GTFS feed schedules into a representative directed network graph. The tool uses Partridge to conve

Kuan Butts 183 Dec 29, 2022
Implemented a Google Maps prototype that provides the shortest route in terms of distance

Implemented a Google Maps prototype that provides the shortest route in terms of distance, the fastest route, the route with the fewest turns, and a scenic route that avoids roads when provided a sou

1 Dec 26, 2021
A set of utility functions for working with GeoJSON annotations in Kaibu

kaibu-utils A set of utility functions for working with Kaibu. Create a new repository Create a new repository and select imjoy-team/imjoy-python-temp

ImJoy Team 0 Dec 12, 2021
Python library to decrypt Airtag reports, as well as a InfluxDB/Grafana self-hosted dashboard example

Openhaystack-python This python daemon will allow you to gather your Openhaystack-based airtag reports and display them on a Grafana dashboard. You ca

Bezmenov Denys 19 Jan 03, 2023
Read images to numpy arrays

mahotas-imread: Read Image Files IO with images and numpy arrays. Mahotas-imread is a simple module with a small number of functions: imread Reads an

Luis Pedro Coelho 67 Jan 07, 2023
geemap - A Python package for interactive mapping with Google Earth Engine, ipyleaflet, and ipywidgets.

A Python package for interactive mapping with Google Earth Engine, ipyleaflet, and folium

Qiusheng Wu 2.4k Dec 30, 2022
A Python tool to display geolocation information in the traceroute.

IP2Trace Python IP2Trace Python is a Python tool allowing user to get IP address information such as country, region, city, latitude, longitude, zip c

IP2Location 22 Jan 08, 2023
This is the antenna performance plotted from tinyGS reception data.

tinyGS-antenna-map This is the antenna performance plotted from tinyGS reception data. See their repository. The code produces a plot that provides Az

Martin J. Levy 14 Aug 21, 2022
Extract GoPro highlights and GPMF data.

Python script that parses the gpmd stream for GOPRO moov track (MP4) and extract the GPS info into a GPX (and kml) file.

Chris Auron 2 May 13, 2022
Stitch image tiles into larger composite TIFs

untiler Utility to take a directory of {z}/{x}/{y}.(jpg|png) tiles, and stitch into a scenetiff (tif w/ exact merc tile bounds). Future versions will

Mapbox 38 Dec 16, 2022
Geographic add-ons for Django REST Framework. Maintained by the OpenWISP Project.

django-rest-framework-gis Geographic add-ons for Django Rest Framework - Mailing List. Install last stable version from pypi pip install djangorestfra

OpenWISP 981 Jan 03, 2023
A Jupyter - Leaflet.js bridge

ipyleaflet A Jupyter / Leaflet bridge enabling interactive maps in the Jupyter notebook. Usage Selecting a basemap for a leaflet map: Loading a geojso

Jupyter Widgets 1.3k Dec 27, 2022
Client library for interfacing with USGS datasets

USGS API USGS is a python module for interfacing with the US Geological Survey's API. It provides submodules to interact with various endpoints, and c

Amit Kapadia 104 Dec 30, 2022