DigitalGlobe / gbdxtools

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

This could be a bug about worldview 4 data #398

Closed cookerman2011 closed 6 years ago

cookerman2011 commented 6 years ago
When I used worldview 4 data, there was a strange problem.as follows:

from gbdxtools import WV04 img = CatalogImage('5da5d2d8-463f-4626-881f-c675588c0b29-inv') print(img.shape, img.bounds) The result is:((4, 13201, 13455), (73.89409068, 38.09904223615163, 74.05158138247934, 38.25355987)) Then the problem is coming,the result (73.89409068, 38.09904223615163, 74.05158138247934, 38.25355987)is not the scope of this wv4,but another scene of wv4 When I use another code from gbdxtools import WV04 img_acomp = CatalogImage('5da5d2d8-463f-4626-881f-c675588c0b29-inv', acomp=True) aoi = img_acomp.randwindow((500, 500)) aoi.plot() The results of picture obtained is not the data of this scene. However, if you enter a CatalogID of wv4 which is in the RDA data, there is no such problem and will get the correct result. So now the problem is coming again. I asked how to order wv4 before. I got the answer that I don't need to order. All the data is in the catalog image. Now the problem is that if this wv4 data is not in RDA, it will not be used correctly. How can I use this data? Previously, you only had to order before you can add data to the RDA database.

chelm commented 6 years ago

Ok i may know whats going on here. Will run your code above and see if its what i suspect. The WV04 catalogIDs are indexed in a strange way and i think i can make gbdxtools protect against itself against what you are seeing.

But, yes, if WV04 data are in the catalog they should all be available via RDA, but its a new pattern and im 100% confident that its completely true yet.

chelm commented 6 years ago

@cookerman2011 where did you find the catalogID 5da5d2d8-463f-4626-881f-c675588c0b29-inv?

I cannot find it in the Catalog or Vector Services.

cookerman2011 commented 6 years ago

I use this URL to search for the Image ID: https://discover.digitalglobe.com/ The Image ID: 5da5d2d8-463f-4626-881f-c675588c0b29-inv is not in the RDA database

cookerman2011 commented 6 years ago

The following code can be searched but the result is wrong

from gbdxtools import WV04
img = CatalogImage('5da5d2d8-463f-4626-881f-c675588c0b29-inv')
print(img.shape, img.bounds)
cookerman2011 commented 6 years ago

If this is a worldview 2/3 data which is not in the RDA, I can add it to the RDA through the order command, but the worldview 4 data seems to be unable to use the order command, most of the Catalog Searches are not available but some can. This is very strange

cookerman2011 commented 6 years ago

The most important question now is how do I add a worldview 4 data to the RDA, and even if the worldview 4 data in the RDA, the S3 address is wrong and cannot be saved by the save to s3 command.

cookerman2011 commented 6 years ago

The following is the data address in the API command: https://api.discover.digitalglobe.com/show?id=5da5d2d8-463f-4626-881f-c675588c0b29-inv

chelm commented 6 years ago

So there's a bug in gbdxtools with wv04 that we have fixed and are preparing to release. When the next version releases (today) the above will complain that the ID you are using is not available. I believe the issue is that there's a discrepancy between what you find in discover and whats available in RDA.

RDA only has access to newer WV04, but exactly how new is not clear, working on figuring that out. For now i'd not use discover to find available WV04 images and instead search the Catalog or Vector Services via gbdxtools.

chelm commented 6 years ago

From what i'm being told, for the near term future there is no way for a user to make a WV04 image available in RDA, so what you see in Vector Services is what RDA can access.

chelm commented 6 years ago

Code for finding things via vector services:

from shapely.geometry import box
from gbdxtools import Interface
gbdx = Interface()

bbox = [-180, -90, 180, 90] 

query = 'item_type:WV04'
aoi = box(*bbox).wkt
recs = gbdx.vectors.query(aoi, query, count=10)
print(len(recs))
chelm commented 6 years ago

Closing this.

cookerman2011 commented 6 years ago

Thank you very much for your reply. Currently, through my personal use, Catalog or Vector Services is not compatible with wv04 data, and most of the time I can't get the correct results. Even if it is new wv04 data, is it automatically added to RDA or added by a certain command like order? If it is old wv04 data, how can I add it to RDA?

chelm commented 6 years ago

Im told there is currently no way to add old wv04 data to RDA.

cookerman2011 commented 6 years ago

So for new wv4 data, can it be saved to the s3 directory?

cookerman2011 commented 6 years ago
from gbdxtools import Interface
from gbdxtools import CatalogImage, WV04
gbdx = Interface()
s3path = gbdx.catalog.get_data_location(catalog_id='0c90d683-7577-462e-91b0-26256797f8c3-inv')
s3path

u'not_delivered'