Python qgis二次开发

3 篇文章 0 订阅
2 篇文章 0 订阅

    环境配置 eclipse+pydev+python27 + pyqt4.8.6 + qgis2.6

        eclipse安装。略

       pydev安装。略

       python27安装。略。

       pyqt4.8.6 + qgis2.6安装。我用的是OSGeo4W安装包,OSGeo4W本身自带qgis2.6开发组件 和 pyqt4.8.6开发组件, python27也会自带,  python27最好自行安装个。注意用OSGeo4W安装后,不要在单独安装pyqt了,

       注意事项:

       qgis.core dll not found:  是环境变量设置造成的,但是此处不能直接在 PATH  中增加环境变量,增加后你会发现其实是无作用的。正确的做法是C:\OSGeo4W\bin  增加一个bat 文件文件 通过bat 文件设置你的环境变量,并且启动eclipse.exe

         pydevqgis.bat:

@echo off
call "%~dp0\o4w_env.bat"
@echo off
path %OSGEO4W_ROOT%\apps\qgis\bin;%PATH%
set QGIS_PREFIX_PATH=%OSGEO4W_ROOT:\=/%/apps/qgis
rem Set VSI cache to be used as buffer, see #6448
set VSI_CACHE=TRUE
set VSI_CACHE_SIZE=1000000
set QT_PLUGIN_PATH=%OSGEO4W_ROOT%\apps\qgis\qtplugins;%OSGEO4W_ROOT%\apps\qt4\plugins
D:\andr_dev\eclipse\eclipse.exe

bat文件的 最后一行是eclipse 的路径,换成你自己的即可,其余的不用改变。

       启动eclipse的时候,直接双击pydevqgis.bat,然后就可以顺顺的coding了。因为 qgis.core dll not found 花了我很长时间在google上搜索,差点要放弃pyqt qgis的开发方式。问题的解决方法还是有的,除非你没有发现相关的成功案例。

 

 

 

     

  

QGIS Python Programming Cookbook - Second Edition by Joel Lawhead English | 14 Mar. 2017 | ASIN: B01MRP7T3B | 464 Pages | AZW3 | 9.26 MB Master over 170 recipes that will help you turn QGIS from a desktop GIS tool into a powerful automated geospatial framework About This Book Delve into the undocumented features of the QGIS API Get a set of user-friendly recipes that can automate entire geospatial workflows by connecting Python GIS building blocks into comprehensive processes This book has a complete code upgrade to QGIS 2.18 and 30 new, valuable recipes Who This Book Is For This book is for geospatial analysts who want to learn more about automating everyday GIS tasks as well as programmers responsible for building GIS applications. The short, reusable recipes make concepts easy to understand and combine so you can build larger applications that are easy to maintain. What You Will Learn Use Python and QGIS to produce captivating GIS visualizations and build complex map layouts Find out how to effectively use the poorly-documented and undocumented features of the QGIS Python API Automate entire geospatial workflows by connecting Python GIS building blocks into comprehensive processes Create, import, and edit geospatial data on disk or in-memory Change QGIS settings programmatically to control default behavior Automatically generate PDF map books Build dynamic forms for field input In Detail QGIS is a desktop geographic information system that facilitates data viewing, editing, and analysis. Paired with the most efficient scripting language—Python, we can write effective scripts that extend the core functionality of QGIS. Based on version QGIS 2.18, this book will teach you how to write Python code that works with spatial data to automate geoprocessing tasks in QGIS. It will cover topics such as querying and editing vector data and using raster data. You will also learn to create, edit, and optimize a vector layer for faster queries, reproject a vector layer, reduce the number of vertices in a vector layer without losing critical data, and convert a raster to a vector. Following this, you will work through recipes that will help you compose static maps, create heavily customized maps, and add specialized labels and annotations. As well as this, we'll also share a few tips and tricks based on different aspects of QGIS. Style and approach This book follows a recipe-based problem-solution approach to address and dispel challenges faced when implementing and using QGIS on a regular basis.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值