【QGIS】QGIS 3.12.3 Windows平臺二次開發(一)

環境

系統:win10 x64

QGIS版本:V3.12.3

VS版本:VS2015

 

安裝osgeo4w

1、osgeo4w地址
32位:http://download.osgeo.org/osgeo4w/osgeo4w-setup-x86.exe 
64位:http://download.osgeo.org/osgeo4w/osgeo4w-setup-x86_64.exe

 

2、選擇 Advanced Install,點擊 NEXT。

 

3、選擇 Install from Internet,點擊 NEXT。

 

 

4、安裝路徑選擇。這裏選擇 C:\OSGEO4W (默認)。

 

 

5、 下載安裝包保存路徑。建議新建QGIS文件保存,路徑自定義。

 

6、網絡連接方式,選擇 Direct Connection,點擊 NEXT。

 

7、下載地址選擇,這裏選擇 http://www.nobit.de,點擊 NEXT。這裏可以隨便選,下載那個快選哪個。注意:下載速度時快時慢,一般早晨最快。(我的位置在福州)

 

 

 8、選擇安裝包頁面,查找 qgis,彈出下列目錄。點開 Libs 節點,選擇 下列 安裝包。(已用紅框圈出) 

 

9、這個對話框比較隱蔽,大家很容易忽視。Unmet Dependencies Found(發現未滿足的依賴關係)。

安裝程序檢測安裝依賴關係,增加了許多基礎安裝包,如下表所示。

avce00	(2.0.0-1)
	The AVCE00 commandline utilities for Arc/Info E00 conversion
	Required by: grass, msys-grass

boost	(1.56.0-2)
	The Boost library.
	Required by: libkml

cairo	(1.12.14-1)
	Cairo library
	Required by: grass

curl	(7.67.0-1)
	The CURL HTTP/FTP library and commandline utility.
	Required by: gdal, netcdf, gdal111dll, gdal18dll

curl-ca-bundle	(20191119-1)
	CURL CA certificates
	Required by: curl

exiv2	(0.26-1)
	Image metadata library
	Required by: qgis, qgis-ltr

expat	(2.0.1-1)
	The Expat XML Parser library
	Required by: gdal, ogdi, libkml, gpsbabel, exiv2, gdal111dll, gdal18dll

fftw	(3.2-1)
	Fast Fourier transformation library
	Required by: grass, msys-grass

freetype-mingw	(2.3.7-1)
	FreeType library (MinGW built).
	Required by: msys-grass

freexl	(1.0.2-1)
	The FreeXL library for accessing Excel (.xls) spreadsheet.
	Required by: gdal, spatialite, gdal111dll

gdal	(3.0.4-2)
	The GDAL/OGR library and commandline tools
	Required by: qgis-common, grass, python3-gdal, gpsbabel, msys-grass, liblas, qgis-ltr-common

gdal111dll	(1.11.3-1)
	The GDAL/OGR 1.11 DLL (backward compability package)
	Required by: grass6

gdal18dll	(1.8.1-0)
	The GDAL/OGR 1.8 DLL (backward compability package)
	Required by: liblas

geos	(3.8.1-1)
	The GEOS geometry library
	Required by: qgis-common, gdal, spatialite, liblwgeom, gdal111dll, qgis-ltr-common, gdal18dll

gpsbabel	(1.4.4-1)
	GPS file conversion plus transfer to/from GPS units
	Required by: qgis, grass, qgis-ltr, msys-grass

grass	(7.8.3-1)
	GRASS GIS
	Required by: qgis-grass-plugin7, qgis-ltr-grass-plugin7

grass6	(6.4.4-1)
	GRASS GIS - old stable release
	Required by: qgis-grass-plugin

gs	(9.07-3)
	Ghostscript
	Required by: grass, msys-grass

gsl-libs	(1.12-1)
	GNU Scientific Library (GSL)
	Required by: qgis-common, qgis-ltr-common

hdf4	(4.2.14-1)
	The HDF4 library for reading and writing HDF4 format
	Required by: gdal, gdal111dll, gdal18dll

hdf5	(1.10.4-1)
	The HDF5 library for reading and writing HDF5 format
	Required by: netcdf, gdal111dll, gdal18dll

iconv	(1.9.1-1)
	Codepage translation Library
	Required by: qgis-common, spatialite, grass, freexl, msys-grass, gdal111dll, cairo, qgis-ltr-common

iconv-vc14	(1.15-1)
	Codepage translation Library
	Required by: gdal

icu-libs	(56.1-3)
	ICU (library)
	Required by: qtwebkit-qt5-libs

laszip	(2.2.0-1)
	The LASzip compression library
	Required by: liblas

libcairo	(1.10.2-1)
	Cairo library and dependencies
	Required by: msys-grass

libgeotiff	(1.4.2-1)
	The Libgeotiff library, commandline tools and supporting tables.
	Required by: gdal111dll, liblas, gdal18dll

libintl	(0.14.4-2)
	libintl
	Required by: grass6, msys-grass

libjpeg	(6b-5)
	A library for manipulating JPEG image format files (runtime)
	Required by: gdal111dll, libtiff, gdal18dll

libjpeg12	(6b-3)
	A library for manipulating 12bit JPEG image format files
	Required by: libtiff

libkml	(1.3.0-1)
	LibKML
	Required by: gdal

liblas	(1.7.0-1)
	The libLAS commandline utilities
	Required by: grass

liblwgeom	(3.0.0-2)
	liblwgeom
	Required by: spatialite

libmysql	(6.1.9-1)
	MySQL Client Library.
	Required by: gdal, gdal111dll, gdal18dll

libpng	(1.2.34-1)
	the official PNG reference library
	Required by: grass, msys-grass

libpng-vc14	(1.6.29-1)
	the official PNG reference library
	Required by: gdal, openjpeg

libpq	(11.5-1)
	The libpq library for accessing PostgreSQL + psql commandline client
	Required by: qgis-common, gdal, gdal111dll, qgis-ltr-common, gdal18dll

libspatialindex	(1.9.0-1)
	The libspatialindex library
	Required by: qgis-common, qgis-ltr-common

libtiff	(4.0.8-1)
	A library for manipulating TIFF format image files (runtime)
	Required by: grass, openjpeg, msys-grass, gdal111dll, liblas, libgeotiff, gdal18dll

libxml2	(2.9.1-1)
	An XML read/write library
	Required by: spatialite, cairo

libzip-libs	(1.2.0-2)
	libzip (runtime library)
	Required by: qgis-common, qgis-ltr-common

msvc2015	(1.0.0-1)
	msvc2015
	Required by: spatialite

msvcrt	(1.0.3-1)
	Microsoft Visual C/C++ Runtimes
	Required by: qgis-common, qgis-grass-plugin, qgis-grass-plugin7, opencl, grass, msvcrt2015, shell, openjpeg, libkml, msys, msys-grass, setup, boost, laszip

msvcrt2008	(1.0-1)
	Microsoft Visual C/C++ 2008 Runtimes
	Required by: msvcrt, xerces-c-vc9, python-core

msvcrt2010	(1.0-1)
	Microsoft Visual C/C++ 2010 Runtimes
	Required by: msvcrt

msvcrt2013	(1.0-1)
	Microsoft Visual C/C++ 2013 Runtimes
	Required by: grass

msvcrt2015	(1.0-1)
	Microsoft Visual C/C++ 2015 Runtimes
	Required by: qgis-ltr-grass-plugin7, qt5-libs, libpq, proj, geos, gdal, libspatialindex, libzip-libs, grass, openssl, sqlite3, libpng-vc14, curl, libmysql, xerces-c, hdf4, ogdi, iconv-vc14, xz, zstd, python3-core, liblwgeom, msvc2015, exiv2, libtiff, qgis-ltr-common, hdf5, szip

msys	(1.0.18-7)
	Minimal SYStem
	Required by: grass6

msys-grass	(1-8)
	MSYS - GRASS GIS dependencies
	Required by: grass6

netcdf	(4.7.3-1)
	The NetCDF library and commands for reading and writing NetCDF format
	Required by: gdal, gdal111dll, gdal18dll

ogdi	(4.1.0-1)
	OGDI data access library (mainly for VPF reading)
	Required by: gdal, gdal111dll, gdal18dll

opencl	(2.0.10-5)
	KhronosGroup OpenCL runtime
	Required by: qgis-common, qgis-ltr-common

openjpeg	(2.3.0-1)
	OpenJPEG
	Required by: gdal, gdal111dll

openssl	(1.1.1d-2)
	OpenSSL Cryptography (Runtime)
	Required by: qt5-libs, libpq, curl, python3-core

openssl10	(1.0.2j-1)
	OpenSSL 1.0 Cryptography (Runtime)
	Required by: libzip-libs, openssl

pdcurses	(3.3-1)
	PDCurses
	Required by: grass, msys-grass

proj	(6.3.2-1)
	The PROJ library and commands for coordinate system transformations.
	Required by: qgis-common, gdal, spatialite, grass, liblwgeom, python3-pyproj, msys-grass, gdal111dll, liblas, qgis-ltr-common, gdal18dll

proj-datumgrid	(1.8-1)
	Assorted PROJ datum grid shift files
	Required by: proj, liblas

proj-hpgn	(1.0-1)
	PROJ.4 HPGN (HARN) grid shift files
	Required by: proj, liblas

pyopengl	(3.0.1-1)
	The Python OpenGL廬 Binding
	Required by: msys-grass

pyqt5	(5.11.3-2)
	Python bindings for Qt5.
	Required by: qgis, qgis-ltr, python3-qscintilla

python	(2.7.4-2)
	Python meta package, includes core interpreter & runtime, help, tcl/tk & idle, tools and test suite
	Required by: python-wx, pyopengl, python-win32

python-core	(2.7.14-1)
	Python core interpreter and runtime
	Required by: python-numpy, python, python-pillow, python-help, python-tcltk, python-tools, python-olefile, python-test

python-help	(2.7.14-1)
	Python documentation in a Windows compiled help file
	Required by: python

python-numpy	(2.7-1.7.0-1)
	NumPy is the fundamental package for array computing with Python.
	Required by: msys-grass

python-olefile	(0.44-1)
	Python package to parse, read and write Microsoft OLE2 files (Structured Storage or Compound Document, Microsoft Office) - Improved version of the OleFileIO module from PIL, the Python Image Library.
	Required by: python-pillow

python-pil	(1.1.7-2)
	Python Imaging Library (PIL; transitional for pillow)
	Required by: msys-grass

python-pillow	(5.3.0-1)
	Python Imaging Library (Fork)
	Required by: python-pil

python-tcltk	(2.7.14-1)
	Python Tkinter and IDLE
	Required by: python

python-test	(2.7.14-1)
	Python self tests
	Required by: python-testsuite

python-testsuite	(2.7.14-1)
	Python Lib/test: bsddb, ctypes, distutils, email, json, lib-tk, lib2to3, sqlite3, test, unittest (transitional package)
	Required by: python

python-tools	(2.7.14-1)
	Python Tools
	Required by: python

python-win32	(2.16-1)
	Python for Windows extension
	Required by: python-wx

python-wx	(2.8.12.1-1)
	wxPython - Python bindings for wxWidgets
	Required by: msys-grass

python3-certifi	(2019.11.28-1)
	Python package for providing Mozilla's CA Bundle.
	Required by: python3-requests

python3-chardet	(3.0.4-2)
	Universal encoding detector for Python 2 and 3
	Required by: python3-requests

python3-core	(3.7.0-4)
	Python3 core interpreter and runtime
	Required by: sip-qt5, qgis, qgis-ltr, pyqt5, python3-gdal, python3-qscintilla, python3-jinja2, python3-markupsafe, python3-pygments, python3-python-dateutil, python3-pytz, python3-future, python3-requests, python3-pyproj, python3-pyyaml, python3-plotly, python3-owslib, python3-httplib2, python3-nose2, python3-mock, python3-matplotlib, python3-wx, python3-numpy, python3-pillow, python3-pip, python3-ply, python3-pyopengl, python3-six, python3-pywin32, python3-psycopg2-binary, python3-idna, python3-chardet, python3-certifi, python3-urllib3, python3-retrying, python3-decorator, python3-nbformat, python3-coverage, python3-pbr, python3-cycler, python3-pyparsing, python3-kiwisolver, python3-ipython-genutils, python3-jsonschema, python3-jupyter-core, python3-traitlets, python3-setuptools

python3-coverage	(4.5.1-1)
	Code coverage measurement for Python
	Required by: python3-nose2

python3-cycler	(0.10.0-2)
	Composable style cycles
	Required by: python3-matplotlib

python3-decorator	(4.4.1-1)
	Decorators for Humans
	Required by: python3-plotly, python3-traitlets

python3-future	(0.16.0-2)
	Clean single-source support for Python 3 and 2
	Required by: qgis, qgis-ltr

python3-gdal	(3.0.4-2)
	The GDAL/OGR Python3 Bindings and Scripts
	Required by: qgis, grass, qgis-ltr

python3-httplib2	(0.11.3-1)
	A comprehensive HTTP client library.
	Required by: qgis, qgis-ltr

python3-idna	(2.8-1)
	Internationalized Domain Names in Applications (IDNA)
	Required by: python3-requests

python3-ipython-genutils	(0.2.0-2)
	Vestigial utilities from IPython
	Required by: python3-nbformat, python3-traitlets

python3-jinja2	(2.11.1-1)
	A small but fast and easy to use stand-alone template engine written in pure python.
	Required by: qgis, qgis-ltr

python3-jsonschema	(2.6.0-2)
	An implementation of JSON Schema validation for Python
	Required by: python3-nbformat

python3-jupyter-core	(4.6.2-1)
	Jupyter core package. A base package on which Jupyter projects rely.
	Required by: python3-nbformat

python3-kiwisolver	(1.1.0-1)
	A fast implementation of the Cassowary constraint solver
	Required by: python3-matplotlib

python3-markupsafe	(1.1.1-1)
	Safely add untrusted strings to HTML/XML markup.
	Required by: qgis, qgis-ltr, python3-jinja2

python3-matplotlib	(3.1.3-1)
	Python plotting package
	Required by: grass

python3-mock	(2.0.0-2)
	Rolling backport of unittest.mock for all Pythons
	Required by: qgis, qgis-ltr

python3-nbformat	(5.0.4-1)
	The Jupyter Notebook format
	Required by: python3-plotly

python3-nose2	(0.8.0-1)
	nose2 is the next generation of nicer testing for Python
	Required by: qgis, qgis-ltr

python3-numpy	(1.18.3-1)
	NumPy is the fundamental package for array computing with Python.
	Required by: grass, python3-gdal, python3-matplotlib

python3-owslib	(0.17.0-1)
	OGC Web Service utility library
	Required by: qgis, qgis-ltr

python3-pbr	(4.3.0-1)
	Python Build Reasonableness
	Required by: python3-mock

python3-pillow	(5.3.0-1)
	Python Imaging Library (Fork)
	Required by: grass

python3-pip	(20.0.2-1)
	The PyPA recommended tool for installing Python packages.
	Required by: grass

python3-plotly	(3.3.0-1)
	Python plotting library for collaborative, interactive, publication-quality graphs.
	Required by: qgis, qgis-ltr

python3-ply	(3.11-2)
	Python Lex & Yacc
	Required by: grass

python3-psycopg2	(2.8.4-1)
	psycopg2 - Python-PostgreSQL Database Adapter (transitional)
	Required by: qgis, grass, qgis-ltr

python3-psycopg2-binary	(2.8.4-1)
	psycopg2 - Python-PostgreSQL Database Adapter
	Required by: python3-psycopg2

python3-pygments	(2.5.2-1)
	Pygments is a syntax highlighting package written in Python.
	Required by: qgis, qgis-ltr

python3-pyopengl	(3.1.0-1)
	Standard OpenGL bindings for Python
	Required by: grass

python3-pyparsing	(2.4.6-1)
	Python parsing module
	Required by: python3-matplotlib

python3-pyproj	(2.5.0-1)
	Python interface to PROJ (cartographic projections and coordinate transformations library)
	Required by: qgis, qgis-ltr, python3-owslib

python3-python-dateutil	(2.8.1-1)
	Extensions to the standard Python datetime module
	Required by: qgis, qgis-ltr, python3-owslib, python3-matplotlib

python3-pytz	(2019.3-1)
	World timezone definitions, modern and historical
	Required by: qgis, qgis-ltr, python3-plotly, python3-owslib

python3-pywin32	(227-1)
	Python for Window Extensions
	Required by: grass, python3-jupyter-core

python3-pyyaml	(5.3-1)
	YAML parser and emitter for Python
	Required by: qgis, qgis-ltr

python3-qscintilla	(2.10.8-1)
	Python3 bindings for Qt5 QScintilla
	Required by: qgis, qgis-ltr

python3-requests	(2.22.0-1)
	Python HTTP for Humans.
	Required by: qgis, qgis-ltr, python3-plotly, python3-owslib

python3-retrying	(1.3.3-1)
	Retrying
	Required by: python3-plotly

python3-setuptools	(45.2.0-1)
	Easily download, build, install, upgrade, and uninstall Python packages
	Required by: python3-kiwisolver

python3-six	(1.14.0-1)
	Python 2 and 3 compatibility utilities
	Required by: grass, python3-python-dateutil, python3-plotly, python3-nose2, python3-mock, python3-wx, python3-retrying, python3-cycler, python3-traitlets

python3-traitlets	(4.3.3-1)
	Traitlets Python config system
	Required by: python3-nbformat, python3-jupyter-core

python3-urllib3	(1.25.8-1)
	HTTP library with thread-safe connection pooling, file post, and more.
	Required by: python3-requests

python3-wx	(4.0.7-1)
	wxPython - Python3 bindings for wxWidgets
	Required by: grass

qca-qt5-libs	(2.1.3-1)
	Qt5 Cryptographic Architecture runtime libraries
	Required by: qgis-common, qgis-ltr-common

qgis	(3.12.3-1)
	QGIS Desktop
	Required by: qgis-grass-plugin, qgis-grass-plugin7

qgis-ltr	(3.10.6-1)
	QGIS Desktop (long term release)
	Required by: qgis-ltr-grass-plugin7

qgis-ltr-common	(3.10.6-1)
	QGIS (common; long term release)
	Required by: qgis-ltr

qgis-ltr-grass-plugin-common	(3.10.6-1)
	GRASS plugin for QGIS (common; long term release)
	Required by: qgis-ltr-grass-plugin7

qscintilla-qt5	(2.10.8-1)
	Qt5 source code editing component.
	Required by: qgis-common, python3-qscintilla, qgis-ltr-common

qt5-libs	(5.11.2-2)
	Qt5 runtime libraries
	Required by: qgis-common, qwt-libs-qt5, qca-qt5-libs, qtkeychain-qt5-libs, qtwebkit-qt5-libs, qscintilla-qt5, icu-libs, pyqt5, qt5-qml, qt5-tools, qgis-ltr-common, qtwebengine-qt5-libs

qt5-qml	(5.11.2-1)
	Qt5 QML
	Required by: qgis, qgis-ltr

qt5-tools	(5.11.2-1)
	Qt5 designer & linguist (Development)
	Required by: qgis, qgis-ltr

qtkeychain-qt5-libs	(0.9-1)
	Platform-independent Qt API for storing passwords securely.
	Required by: qgis-common, qgis-ltr-common

qtwebengine-qt5-libs	(5.10.1-1)
	WebEngine for Qt5
	Required by: pyqt5

qtwebkit-qt5-libs	(5.212-1)
	WebKit for Qt5
	Required by: qgis-common, pyqt5, qgis-ltr-common

qwt-libs-qt5	(6.1.3-5)
	Qt5 widgets library for technical applications (runtime)
	Required by: qgis-common, qgis-ltr-common

rbatch	(149-4)
	Windows batchfiles for use with R
	Required by: grass

setup	(1.0.7-16)
	OSGeo4W Installer/Updater
	Required by: shell

shell	(1.0.2-4)
	OSGeo4W Command Shell
	Required by: gsl-libs, zlib, qwt-libs-qt5, iconv, qscintilla-qt5, expat, libxml2, openssl10, gpsbabel, python3-qscintilla, qt5-tools, libintl, tcltk, gdal111dll, liblas, avce00, pdcurses, fftw, libpng, cairo, setup, freetype-mingw, python-wx, pyopengl, libcairo, libjpeg, libgeotiff, gdal18dll, libjpeg12, python, python-win32

sip-qt5	(4.19.14-1)
	Python3/C++ bindings generator (Development)
	Required by: qgis-common, pyqt5, qgis-ltr-common

spatialite	(4.3.0a-6)
	The SpatiaLite library for adding spatial capabilities to SQLite3 DBMS.
	Required by: qgis-common, gdal, gdal111dll, qgis-ltr-common

sqlite3	(3.29.0-1)
	The SQLite3 library for accessing SQLite3 database files.
	Required by: qt5-libs, gdal, spatialite, python3-core, gdal111dll, gdal18dll, python-core

szip	(2.1.1-1)
	SZIP compression library
	Required by: hdf4, hdf5

tcltk	(8.5.6-1)
	Tcl/Tk
	Required by: grass6

xerces-c	(3.2.0-1)
	The Xerces-C 3 library for parsing XML files (runtime)
	Required by: gdal

xerces-c-vc9	(3.1.1-2)
	The Xerces-C 3 VC9 library for parsing XML files
	Required by: gdal111dll, gdal18dll

xz	(5.2.3-1)
	XZ-format compression library
	Required by: gdal, libtiff

zlib	(1.2.3-1)
	The zlib compression and decompression library (runtime)
	Required by: qgis-common, qt5-libs, grass, ogdi, openjpeg, libkml, gpsbabel, exiv2, msys-grass, libtiff, cairo, qgis-ltr-common

zstd	(1.4.4-1)
	Zstandard Long Range Match Finder (runtime)
	Required by: gdal, grass, zstd-bin

zstd-bin	(1.4.4-1)
	Zstandard Long Range Match Finder (binary)
	Required by: grass

 

10、一溜許可證頁面,需要點擊 同意,一路 NEXT。(圖就不都貼出來了)

 

11、這個頁面 是 安裝進度。(這個下載速度有點慢哦,建議 換下載站點或者起個大早。)

 

12、qgis安裝完畢。

 

13、通過osgeo4w軟件,除了安裝 qgis,還需要安裝以下依賴庫: 

expat
fcgi
gdal
grass
gsl-devel
iconv
libspatialindex-devel
pyqt5
python3-devel
python3-qscintilla
python3-nose2
python3-future
python3-pyyaml
python3-mock
qca-qt5-devel
qca-qt5-libs
qscintilla-qt5
qt5-devel
qt5-libs-debug
qtwebkit-qt5-devel
qtwebkit-qt5-libs-debug
qwt-devel-qt5
sip-qt5
spatialite
qjson

注意點:

a、操作步驟與安裝 qgis 類似。
b、遵從“寧可多下,絕不少下”的原則。
c、僅下載Library的內容。


 

安裝cgywin

下載地址:

32位:http://cygwin.com/setup-x86.exe 
64位:http://cygwin.com/setup-x86_64.exe 

安裝步驟,可以參考:【Cygwin】解決Cygwin安裝時download mirror sites無效問題

cygwin主要是安裝”flex”和”bison”兩個工具。

 

安裝cmake

下載地址:https://cmake.org/files/v3.7/

各個平臺安裝都有,這裏選擇一個win-x86的。安裝步驟就不贅述了,標準的windows安裝包。

 

未完待續

【QGIS】QGIS 3.12.3 Windows平臺二次開發(二)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章