DigitalGlobe / gbdxtools

(Deprecated) Python SDK for using GBDX
MIT License
74 stars 57 forks source link

Notebooks doesn't plot image in proper projection [ ref:_00D61HtDy._50061VtqOG:ref ] #679

Closed GBDX-Support closed 5 years ago

GBDX-Support commented 5 years ago

GBDXTools New Issue

When plotting cat id 1030010081A8A800 in notebooks in EPSG:32634 (UTM zone 34 N where the image located) it returns null imagery. However, when you plot it to other projects it return imagery. It seems to be just an issue with that cat id. See the below notebook for more information.

GBDX Username

matthew.gregor@digitalglobe.com

GBDX Account Tier

GBDXTools Version

Run pip show gbdxtools in a terminal or !pip show gbdxtools in a Jupyter notebook cell

[ 0.16.5 ]

Python Version

Environment

[ If local, please provide more information about your local Python environment. For example, which Python executable - system or Anaconda? ]

Description

When plotting and downloading (geotiff) this cat ID in EPSG:32634:

Expected behavior:

Imagery is returned

Actual behavior:

Blank values are returned.

Example

see https://notebooks.geobigdata.io/juno/notebook/notebooks/Untitled_2019-03-19T19:30:21.067Z.ipynb

drwelby commented 5 years ago

@GBDX-Support can you provide the published link to that notebook (the one with hub in the URL).

drwelby commented 5 years ago

Are you providing a bounding box also in UTM? This requires the following syntax:

from gbdxtools import CatalogImage
c = CatalogImage('1030010081A8A800', proj='EPSG:32634')
bbox=[748438.1424217589, 4252250.579417545, 749443.6424217589, 4253256.079417545]
img = c.aoi(bbox=bbox, from_proj='EPSG:32634')
img.plot()
drwelby commented 5 years ago

This problem is due to RDA approximating the collar location in reprojection, causing pixels at the edge of the image to disappear under the collar.

The workaround is to generate the image in EPSG:4326, export as geotiff, and reproject with GDAL or another tool.