DigitalGlobe / gbdxtools

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

Authentication error when using the idaho.get_chip service #138

Closed loominator1970 closed 7 years ago

loominator1970 commented 7 years ago

Hello,

I am receiving two different results when attempting to get a Bounding box chip with the idaho.get_chip service. Both images are in IDAHO format on the platform

Image #1: Succeeds to download chip 10300100532CAA00 ULX,ULY,LRX,LRY : -3.7074,40.4211,-3.7054,40.4191

Image #2: Fails with error "Cannot download chip: Full authentication is required to access this resource 10300100485B1900 ULX,ULY,LRX,LRY : -0.759,37.7583,-0.757,37.7563

Please advise.

Dave

chelm commented 7 years ago

@loominator1970 Can you paste in the actual code you're using to call get_chip?

loominator1970 commented 7 years ago

Here you go @chelm ....

from gbdxtools import Interface gbdx = Interface()

set the file path

file_path = "/Users/dloomis/Desktop/junk/"

catids = [ [18.4968,-39.8913,'103001001B512D00'] ]

loop through the list

for c in catids :

create the coordinate list list (west,south,east,north)

coords = [c[0] - 0.001,c[1] - 0.001,c[0] + 0.001,c[1] + 0.001]
# uncomment to output metadata from the image parts
images = gbdx.idaho.get_images_by_catid(c[2])

for k,v in images.iteritems():
    if k == "results" :
        print("Catid : " + c[2])
        print("  Acq Date : " + v[0]['properties']['acquisitionDate'])
        print("  Off Nadir Angle : " + str(v[0]['properties']['offNadirAngle']))
        print("  ULX,ULY,LRX,LRY : " + str(c[0] - 0.001) + "," + str(c[1] + 0.001) + "," + str(c[0] + 0.001) + "," + str(c[1] - 0.001))
        print
        print("  saving chip " + c[2] + "_chip.tif" + "...")
        print("-------------------------------")

# create the chip and save to local drive
chip = gbdx.idaho.get_chip(coords, c[2], chip_type='PS', chip_format='TIF', filename=file_path + c[2] + '_chip.tif')
chelm commented 7 years ago

Hmm im not sure why we see the auth issue but @loominator1970 one thing I notice is that you're coords dont seem right:

I dont think 18.4968, -39.8913 fall within the bounds of the image 103001001B512D00.

The bounds for that CatalogID seem to be 18.31478622, -34.046212661588214, 18.527839947991374, -33.7689284 with doesnt contain the point you're trying to fetch.

chelm commented 7 years ago

going to close this as i think it was related to AOIs and cat ids in the wrong place