Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get_tile should return a raster which is projected to web_mercator #108

Open
guydou opened this issue Aug 7, 2018 · 5 comments
Open

Get_tile should return a raster which is projected to web_mercator #108

guydou opened this issue Aug 7, 2018 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@guydou
Copy link
Contributor

guydou commented Aug 7, 2018

No description provided.

@guydou guydou self-assigned this Aug 7, 2018
@astrojuanlu astrojuanlu added the bug Something isn't working label Aug 8, 2018
@astrojuanlu
Copy link
Contributor

While investigating this issue I noticed another thing:

screenshot_2018-08-08 _issue_get-tile-mercator

I get the same result regardless of the masked and resampling. Is this to be expected?

@astrojuanlu
Copy link
Contributor

Also, GeoRaster2.get_tile (internally GeoRaster2.get_window) fails for in-memory rasters:

from rasterio.enums import Resampling

import telluric as tl
from telluric.constants import *

rs1 = tl.GeoRaster2.open("../tests/data/raster/overlap1.tif", lazy_load=False)
rs2 = tl.GeoRaster2.open("../tests/data/raster/overlap2.tif", lazy_load=False) 

rs2_alt = (
    rs2
    .reproject(dst_crs=WGS84_CRS, resampling=Resampling.nearest)
    .reproject(dst_crs=WEB_MERCATOR_CRS, resampling=Resampling.nearest)
)

rs2.get_tile(4377, 3038, 13)  # Works
rs2_alt.get_tile(4377, 3038, 13)  # Fails

@astrojuanlu
Copy link
Contributor

Confirmed original issue:

rs2_4326.save("/tmp/rs2_4326.tif")

tl.GeoRaster2.open("/tmp/rs2_4326.tif").get_tile(4377, 3038, 13)  # Empty image

@guydou
Copy link
Contributor Author

guydou commented Aug 9, 2018

I think you should open on each of the issues here an issue of its own,

about the mask, the mask will not have an effect on a raster that nodata value set, the paramter tells rasterio not to read the mask from the raster, we are doing it, because when you have no-data value set up rasterio is not using the overview masks

@astrojuanlu
Copy link
Contributor

I think you should open on each of the issues here an issue of its own

Done: #118 and #119

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants