Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dataset/crop/bugfix/up-updated-extent-for-cropped-raster #75

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/dataset.rst
Original file line number Diff line number Diff line change
Expand Up @@ -742,9 +742,9 @@ Parameters
method: [String]
resampling technique default is "Nearest"
https://gisgeography.com/raster-resampling/
"nearest neigbour" for nearest neighbour,"cubic" for cubic convolution,
"nearest neighbour" for nearest neighbour,"cubic" for cubic convolution,
"bilinear" for bilinear
maintain_alighment : [bool]
maintain_alignment : [bool]
True to maintain the number of rows and columns of the raster the same after re-projection. Default is False.

Returns
Expand Down
8 changes: 4 additions & 4 deletions examples/MatchTwoRasters.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

match two rasters
"""
#%links
# %links
import os

rpath = r"C:\MyComputer\01Algorithms\gis\pyramids"
Expand All @@ -17,11 +17,11 @@
from pyramids.dataset import Dataset

# import matplotlib.pyplot as plt
#%% inputs
# %% inputs
RasterAPath = f"{rpath}/examples/data/DEM5km_Rhine_burned_acc.tif"
RasterBPath = f"{rpath}/examples/data/MSWEP_1979010100_reprojected.tif"
SaveTo = f"{rpath}/examples/data/MSWEP_1979010100_Matched.tif"
#%% Read the Input rasters
# %% Read the Input rasters
# the source raster is of the ASCII format
src = gdal.Open(RasterAPath)
src_Array = src.ReadAsArray()
Expand All @@ -45,7 +45,7 @@

# %% Match the NODataValue
# TODO : fix bug in nearestneighbor
NewRasterB_ND = Dataset._crop_alligned(src, NewRasterB)
NewRasterB_ND = Dataset._crop_aligned(src, NewRasterB)

NoDataValue = NewRasterB_ND.GetRasterBand(1).GetNoDataValue()

Expand Down
2 changes: 1 addition & 1 deletion pyramids/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
)

INTERPOLATION_METHODS = {
"nearest neigbour": gdal.GRA_NearestNeighbour,
"nearest neighbour": gdal.GRA_NearestNeighbour,
"cubic": gdal.GRA_Cubic,
"bilinear": gdal.GRA_Bilinear,
}
Expand Down
Loading
Loading