Русские видео

Сейчас в тренде

Иностранные видео


Скачать с ютуб Reproject, resample and clip raster data with GDAL in Python в хорошем качестве

Reproject, resample and clip raster data with GDAL in Python 4 года назад


Если кнопки скачивания не загрузились НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием, пожалуйста напишите в поддержку по адресу внизу страницы.
Спасибо за использование сервиса savevideohd.ru



Reproject, resample and clip raster data with GDAL in Python

In this tutorial, I explain how to use gdalwarp in Python to reproject raster data to a different coordinate reference system, change the resolution (resample) and clip it to a shapefile. GDAL/OGR Python API: https://gdal.org/python/ Code: from osgeo import gdal import numpy as np import matplotlib.pyplot as plt ds = gdal.Open("dem.tif") reproject dsReprj = gdal.Warp("demReprj.tif", ds, dstSRS = "EPSG:4326") resample dsRes = gdal.Warp("demRes.tif", ds, xRes = 150, yRes = 150, resampleAlg = "bilinear") clip make sure your raster data and shapefile have the same projection! dsClip = gdal.Warp("demClip.tif", ds, cutlineDSName = "star.shp", cropToCutline = True, dstNodata = np.nan) visualize array = dsClip.GetRasterBand(1).ReadAsArray() plt.figure() plt.imshow(array) plt.colorbar() plt.show() close your datasets! ds = dsClip = dsRes = dsReprj = None

Comments