DataFrame APIs are accessed via the following sliderule function and always produce a GeoDataFrame:
gdf = sliderule.run(api, parms, aoi=None, resources=None)where:
apiis a string that specifies which SlideRule API is being calledparmsis the request parameter dictionaryaoiis the polygon defining the area of interest (provided for convenience only; if not supplied, the area of interest is taken directly from parms)resourcesis the list of granules to process (provided for convenience only; if not supplied, the resources are taken directly from parms)
The columns in the returned GeoDataFrame depend on the contents of the parms structure passed to the api. Typically, there are a base set of columns defined for each api. If algorithms are specified in the parms, then the columns may be completely different depending upon the output of the algorithms. If ancillary fields or raster samplers are specified, then there may be additional columns.
Metadata returned with the results of the API is placed in the attrs attribute of the GeoDataFrame. There are three groups of metadata:
meta: the metadata provided in the server-side dataframe; typically includes theendpoint, and thesrctblwhich correlates thesrcidcolumn values to source granulessliderule: the server-side parameters used in processing the request along with versioning informationrecordinfo: identifies special columns in the dataframe for generalized processing (e.g. time, x, y, z)
Here is an example for accessing the source granule of an entry in the dataframe with a given srcid.
gdf = sliderule.run(api, parms)
gdf.attrs['meta']['srctbl'][f'{srcid}']