windkit.spatial.reproject
- windkit.spatial.reproject(obj, to_crs, copy=True)[source]
Reprojects WindKit object a new CRS without changing the data.
If the input is a xarray.Dataset or xarray.DataArray with a ‘cuboid’ spatial structure, the spatial structure will be changed to ‘stacked_point’, since the coordiates of the new dataset will no longer be regularly spaced.
- Parameters:
obj (geopandas.GeoDataFrame, xarray.DataArray, xarray.Dataset, or BBox) – WindKit object that will be reprojected.
crs (int, dict, str or pyproj.crs.CRS) – Value to initialize
pyproj.crs.CRS
copy (bool) – If true, the object is copied. Defaults to True.
- Returns:
WindKit object with new projection
- Return type:
geopandas.GeoDataFrame, xarray.DataArray,xarray.Dataset, or BBox
See also
Notes
This script reprojects the coordinates of the data, and reshapes the data from
cuboid
orraster
tostacked_point
. This is done so that none of the data is interpolated, but rather the coordinates are just changed to match those of the new projection. If you want to keep your data incuboid
orraster
format, use the functionwarp
instead, which however does do interpolation of the data.