MIERUNE / qgis-plugx-plugin

QGIS to Illustrator with PlugX
GNU General Public License v2.0
3 stars 0 forks source link

ラスターデータの変換:XYZタイル #1

Closed Kanahiro closed 1 year ago

Kanahiro commented 1 year ago

期限: Schedule

詳細・解決方針: Details

関連するファイル: Related Files

Kanahiro commented 1 year ago

QgsRasterFileWriter

# rlayerがQgsRasterLayerとしてあるとして

output_file = '/path/to/output.tif'
file_writer = QgsRasterFileWriter(output_file)
pipe = QgsRasterPipe()
pipe.set(rlayer.dataProvider().clone())
file_writer.writeRaster(pipe, width, height, extent, crs)

extent = QgsRectangle, defined in raster layer's crs. can use input by user width and height is calculatable from extent and DPI