GeoWombat DataArray accessor#

GeoWombat extends xarray.DataArray through a registered .gw accessor. Once an array is opened with geowombat.open(), every GeoWombat method and property is reached through this accessor (for example src.gw.transform or src.gw.ndvi()), which keeps the DataArray namespace clean while making the functionality discoverable via tab-completion.

The properties below describe the geospatial attributes of the image. For the complete list of accessor methods and properties, see the GeoWombatAccessor entry in the API reference.

DataArray GeoWombat attributes#

In [1]: import geowombat as gw

In [2]: from geowombat.data import rgbn

In [3]: with gw.open(rgbn) as src:
   ...:     print(src.gw.transform)
   ...:     print(src.gw.geodataframe)
   ...:     print(src.gw.meta)
   ...:     print(src.gw.ndims)
   ...:     print(src.gw.nbands)
   ...:     print(src.gw.nrows)
   ...:     print(src.gw.ncols)
   ...:     print(src.gw.row_chunks)
   ...:     print(src.gw.col_chunks)
   ...:     print(src.gw.left)
   ...:     print(src.gw.right)
   ...:     print(src.gw.top)
   ...:     print(src.gw.bottom)
   ...:     print(src.gw.bounds)
   ...: 
(5.0, 0.0, 792988.0, 0.0, -5.0, 2050382.0)
   grid                                           geometry
0     1  POLYGON ((795563 2048367, 795563 2050382, 7929...
Metadata(left=792988.0, bottom=2048367.0, right=795563.0, top=2050382.0, bounds=(792988.0, 2048367.0, 795563.0, 2050382.0), affine=Affine(5.0, 0.0, 792988.0,
       0.0, -5.0, 2050382.0), geometry=<POLYGON ((795563 2048367, 795563 2050382, 792988 2050382, 792988 2048367, 7...>)
3
4
403
515
64
64
792988.0
795563.0
2050382.0
2048367.0
(792988.0, 2048367.0, 795563.0, 2050382.0)