qgis

Drag window to the edge to resize

牧云@^-^@ 提交于 2021-01-05 11:28:13
问题 I'm working on a plugin for QGIS and i'm using QtCreator. I wanted to implement a function that allows the user to drag the window to the edge of the screen to resize it (such as ordinary windows). My setup being a multiple screen desktop, I came up with this code: from PyQt5 import QtCore, QtGui tracking = False class Window(QtGui.QWidget): def __init__(self): super(Window, self).__init__() self.timer = QtCore.QTimer(self) self.timer.setInterval(50) self.timer.timeout.connect(self.Resize)

How to build Internal Overviews with Python gdal BuildOverviews()?

混江龙づ霸主 提交于 2020-04-18 00:50:43
问题 Trying to mimic the result of running gdaladdo -r average "D:\image.tif" using python gdal bindings. When I run the code below, I get an external .ovr file. How can I generate an internal overview? Am I using the correct function to mimic gdaladdo? from osgeo import gdal InputImage = r"D:\image.tif" Image = gdal.Open(InputImage,1) Image.BuildOverviews("AVERAGE", [2,4,8,16,32,64]) I've also tried Image = gdal.Open(InputImage, gdal.GA_Update) 回答1: This worked for me: Image = gdal.Open('example

How to build Internal Overviews with Python gdal BuildOverviews()?

坚强是说给别人听的谎言 提交于 2020-04-18 00:50:25
问题 Trying to mimic the result of running gdaladdo -r average "D:\image.tif" using python gdal bindings. When I run the code below, I get an external .ovr file. How can I generate an internal overview? Am I using the correct function to mimic gdaladdo? from osgeo import gdal InputImage = r"D:\image.tif" Image = gdal.Open(InputImage,1) Image.BuildOverviews("AVERAGE", [2,4,8,16,32,64]) I've also tried Image = gdal.Open(InputImage, gdal.GA_Update) 回答1: This worked for me: Image = gdal.Open('example

QGIS初识-Qt编译环境配置

萝らか妹 提交于 2020-03-09 09:00:14
1、QT Tools for Visual Studio2019下载地址(其他的版本也有): https://marketplace.visualstudio.com/items?itemName=TheQtCompany.QtVisualStudioTools2019;需要在vs的插件管理里指定QT5 的安装目录才能使用该模板。 2、添加库头引用:OSGEO4W/include,QGIS/include; 3、添加宏指令: CORE_EXPORT=__declspec(dllimport) GUI_EXPORT=__declspec(dllimport) PYTHON_EXPORT=__declspec(dllimport) ANALYSIS_EXPORT=__declspec(dllimport) APP_EXPORT=__declspec(dllimport) CUSTOMWIDGETS_EXPORT=__declspec(dllimport) 4、添加库lib目录和lib文件: OSGEO4W/lib,QGIS/lib 这里要特别注意,在vs下,会默认添加debug版的qt lib文件 (有d后缀),如果发现,一定要替换为release(无d后缀)版的。 qgis_core.lib qgis_gui.lib qgis_analysis.lib qtcore.lib

QGIS开发Python插件入门教程

主宰稳场 提交于 2020-02-29 17:48:03
使用‘Plugin Builder’建立第一个插件 I打开 Plugin Builder . 1. 在QGIS菜单条单击Plugin Builder图标启动插件创建的plugin: 2. 主Plugin Builder对话框显示如下。我们填入一些基本的配置信息,插件生成器将基于这些信息创建一系列模版文件.。然后我们修改这些模版文件来创建自己的plugin。所有对话框中的域都要求填上,然后点击Ok按钮: 3. 一个文件对话框将会打开。我们创建一个 workspace 目录在 /home/qgis/ 目录下。选择目录,保存plugin工程。 4. If everything went well, Plugin Builder will display a final dialog that shows us the next steps to customize our plugin project. Don’t worry about folowing these because we will be detailing the exact same steps. 5. Now change into the workspace directory of your project /home/qgis/workspace/vector_selectbypoint and list

QGIS & PostGIS (map points(lat and long with raduis on USA map)

隐身守侯 提交于 2020-02-05 00:17:39
问题 I installed QGIS and PostGIS. I have 200 points that I want to display with a radius of 100 miles on a graph of the US. I have imported my latitude and longitude in the PostGIS database. So I have three fields: [address], [lat], [lng]. 1) Do I need to convert the lat and lng fields into a point or geom field? If so how? (st_buffer?) 2) What command/SQL do I use to display the points with radius? I can query my points like so.. SELECT * FROM postgis_test I just don't understand how to display

QGIS & PostGIS (map points(lat and long with raduis on USA map)

我怕爱的太早我们不能终老 提交于 2020-02-05 00:17:06
问题 I installed QGIS and PostGIS. I have 200 points that I want to display with a radius of 100 miles on a graph of the US. I have imported my latitude and longitude in the PostGIS database. So I have three fields: [address], [lat], [lng]. 1) Do I need to convert the lat and lng fields into a point or geom field? If so how? (st_buffer?) 2) What command/SQL do I use to display the points with radius? I can query my points like so.. SELECT * FROM postgis_test I just don't understand how to display