question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[FEATURE]: Enable no resampling by raster tiler

See original GitHub issue

Thank you for helping us improve solaris!

Summary of the bug

I ran the rio tiler tutorial example on a Landsat Analysis Ready Data Scene to tile it into 512x512 chips. But new negative values are added that weren’t there before in the original dataset (which only had -9999).

Steps to reproduce the bug

Please either paste sample code used to generate the buggy behavior below, or provide step-by-step instructions to reproduce the problem.

import solaris as sol
import os

raster_tiler = sol.tile.raster_tile.RasterTiler(dest_dir='test_solaris',  # the directory to save images to
                                                src_tile_size=(512, 512),  # the size of the output chips
                                                verbose=True,
                                               nodata=-9999)
raster_tiler.tile('/mnt/cropmaskperm/test-landsat/scene/LT05_L1TP_029031_20050316_20160912_01_T1_sr.tif')
bigarr = skio.imread('/mnt/cropmaskperm/test-landsat/scene/LT05_L1TP_029031_20050316_20160912_01_T1_sr.tif')
arr = skio.imread("test_solaris/LT05_L1TP_029031_20050316_20160912_01_T1_sr_696765_4625505.tif")
np.unique(arr[...,2])
np.unique(bigarr)
8578 in np.unique(bigarr)
array([-9999, -9998, -9997, ...,  8467,  8578, 19423], dtype=int16) #chip arr
array([-9999,  -898,  -897, ...,  8923,  8960, 20000], dtype=int16) # src arr
False # negative and positive values are changed, the src arr value should be in the chip arr

Steps to reproduce the behavior: Run the rio tiler on a Landsat scene and check if the chip array values are in the source scene. If not it means values have been mutated in the tiling step.

Expected behavior

The tiling step shouldn’t mutate the values

Environment information

  • OS: ubuntu 16
  • solaris version: 0.1.3
  • python version: 3.6

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
nrweircommented, Nov 26, 2019

Hi @rbavery,

Great point on the EPSG code issue. Let me chat with the team here regarding defaulting to re-project or leaving it alone. This topic came up a lot as we were writing the initial implementation and we eventually settled on the solution that’s implemented, but given this context might be willing to switch.

0reactions
nrweircommented, Dec 12, 2019

Resolved with #294!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Introduction to tiler
The tiler package provides a map tile-generator function for creating map tile sets for use with packages such as leaflet . In addition...
Read more >
RasterTiler
The RasterTiler accepts raster features, and divides them into smaller tiles according ... Supports number of horizontal/vertical tiles attribute, No, Yes ...
Read more >
Manage hosted tile layers—ArcGIS Online Help | Documentation
Because tiles are created automatically when they are needed, no resampling occurs when users pan or zoom around the tile layer; tiles are...
Read more >
MapTiler, GDAL2Tiles, and Raster Resampling
So I've been using MapTiler to create some quick raster tilesets from a ... Crucially, I could see no way to specify the...
Read more >
Release Notes - rio-tiler
add asset_as_band option in MultiBaseReader tile, part, preview, feature and point ... update rio-tiler.reader.read/part to avoid using WarpedVRT when no ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found