GeoBigData / sensortools

2 stars 0 forks source link

CATID Fix #24

Closed duckontheweb closed 5 years ago

duckontheweb commented 5 years ago

This fixes that issue I was talking to you about yesterday where depending on how the Catalog Search is conducted, the identifier in the entry might not actually be the CATID. This adds an additional image_identifier field to the dataframe, which holds the identifier from the catalog entry, and it populates the catalog_id column with the catalogID property from the entry.

You can test with:

from gbdxtools import Interface
from sensortools import sensortools
from datetime import datetime, timedelta

gbdx = Interface()
st = sensortools()

aoi = "POLYGON ((-157.86749900000000935 21.29066178118170072, -157.86749900000000935 21.31490499999999955, -157.85125104361799231 21.31490499999999955, -157.85125104361799231 21.29066178118170072, -157.86749900000000935 21.29066178118170072))"

start_date='2018-01-16T00:00:00.000Z'
end_date='2019-01-16T00:00:00.000Z'

filters = ["(sensorPlatformName = 'WORLDVIEW03_VNIR' OR sensorPlatformName = 'WORLDVIEW04')"]

results = gbdx.catalog.search(
    searchAreaWkt=aoi, 
    startDate=start_date, 
    endDate=end_date, 
    filters=filters, 
    types=['WV03_VNIR']
)
st_results = st.formatSearchResults(results, aoi)

st_results[st_results.image_identifier != st_results.catalog_id].head()
alopez04 commented 5 years ago

sweet!