我是 python 新手,也是 GDAL 新手,所以这是一个双重问题。
我想开始使用 QGIS python 控制台,以便执行一些重复操作。我尝试使用这个简单的脚本
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
Run Code Online (Sandbox Code Playgroud)
但我得到的是这个语法错误:
文件“”,第 1 行
语法错误:语法无效
你有什么想法?
谢谢
I'm using qgis 3 and generate a lot of layers types, but in any case I don't find the lat lon values of the points. I have tried to use the attributes table calculator (added fields $x and $y but it showed me big value, I guess in meters and not the lat lon).
我正在使用 QGIS 2.8.1,我想选择名为“tempshpfile”的形状文件并缩放到该多边形形状文件上的图层。
我的代码是:
import ogr,os
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from qgis.core import *
import qgis.utils
import glob
import processing
from processing.core.Processing import Processing
from PyQt4.QtCore import QTimer
Processing.initialize()
Processing.updateAlgsList()
# Add array of address below
allFiles = ["C:/Shapefiles/Map_0077421.shp"]
filesLen = len(allFiles)
TexLayer = "C:/Texas_NAD27/Texas_NAD27.shp"
for lop in range(filesLen):
wb = QgsVectorLayer(allFiles[lop], 'tempshpfile', 'ogr')
wbTex = QgsVectorLayer(TexLayer, 'TexasGrid', 'ogr')
QgsMapLayerRegistry.instance().addMapLayer(wb)
QgsMapLayerRegistry.instance().addMapLayer(wbTex)
Run Code Online (Sandbox Code Playgroud) 我知道QGIS插件可以用C++或python开发。
但我特别想知道为什么你不能说其他语言。
首先,我没有编程知识。
据我了解,QGIS是用C++开发的,所以不能用其他语言开发。但也可以用python开发。
我目前正在学习c#,我想使用c#开发一个基于QGIS的应用程序或插件。
请详细说明无法开发的结构原因,或者给我文档链接。
如果没有单一的方法用c#开发QGIS插件?