简体   繁体   中英

How to start using Qgis python console

I'm new with python and I'm new with GDAL, so this is a dual problem.

I would like to start using the QGIS python console, in order to carry out some recurring operation. I tried with this easy script

import gdal
gdalwarp -ot Float32 -s_srs EPSG:32630 -t_srs EPSG:3035 -r near -of GTiff /home/giacomo/Scrivania/provas/cccp.dat /home/giacomo/Scrivania/provas/cccp_qgs2.tif

But what I get is this syntax error:

File "", line 1

SyntaxError: invalid syntax

Do you have any ideas?

Thanks

You can try this.

import os
os.system('gdalwarp -ot Float32 -s_srs EPSG:32630 -t_srs EPSG:3035 -r near -of GTiff /home/giacomo/Scrivania/provas/cccp.dat /home/giacomo/Scrivania/provas/cccp_qgs2.tif')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM