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
fix thumbnails and outline geometry #205
Conversation
Currently struggling to improve this any further. It works really well for most of the data in #221 but still has a slight issue with the larger rasters like for Landsat: or this continental-scale one: |
Based on your continental image example, it looks like you aren't reprojecting the image when you make the thumbnail. I think you have to either reproject the image into web mercator (to match the map) OR draw the map in the projection of the image. For single thumbnails, changing the map projection might be easiest (e.g., https://opengeoscience.github.io/geojs/examples/reprojection/). I'll note that the smaller the footprint, the more closely a bounding quadrangle with approximate the local reprojection of the image, which is why this looks better on small images. |
I can reproject the raster to Web Mercator when extracting the thumbnail and get something a little better, but the geometry of the quad which the image is overlain is still incorrect. I tried transforming the geometry to ESPG:3857, but GeoJS throws an error with that geometry. i.e.: self.object.footprint.transform(3857, clone=True) for
I also tried setting the projection of the GeoJS map to what we use in the database but it doesn't seem to work: let map = geo.map({
node: '#map',
clampBoundsX: true
})
basemapLayer = map.createLayer('osm', {
source: 'osm',
gcs: 'EPSG:4326'
}); |
@manthey, do you think I should cache a few thumbnails on DKC and add a regression test to verify these stay consistent moving forward? |
@@ -35,6 +45,9 @@ | |||
|
|||
logger = get_task_logger(__name__) | |||
|
|||
GDAL_DATA = os.path.join(os.path.dirname(rasterio.__file__), 'gdal_data') | |||
os.environ['GDAL_DATA'] = GDAL_DATA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might need to also set a PROJ env variable for NTIF format issue in _reproject_raster
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will look into this later.
Resolve #176
For future reference, use the following example rasters to verify that the thumbnails are working.
LC08_L1TP_033032_20200422_20200508_01_T1_pixel_qa.tif
landcover_sample_2000.tif
vegdri_emodis_week34_082320.tif
Summary of change:
save
to trigger save event and recreate the thumbnail or spatial reference)