mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-17 00:04:02 -04:00
Merge branch 'master' of github.com:qgis/QGIS
This commit is contained in:
commit
ac6c598f32
@ -58,7 +58,6 @@ cmake \
|
||||
-DENABLE_MODELTEST=ON \
|
||||
-DENABLE_PGTEST=OFF \
|
||||
-DWITH_QWTPOLAR=OFF \
|
||||
-DWITH_PYSPATIALITE=ON \
|
||||
-DCMAKE_CXX_FLAGS="-Wno-deprecated-declarations" \
|
||||
..
|
||||
|
||||
|
@ -735,18 +735,22 @@ ENDIF (WITH_CORE)
|
||||
|
||||
####################################################
|
||||
# clang-tidy
|
||||
SET (WITH_CLANG_TIDY FALSE CACHE BOOL "Use Clang tidy")
|
||||
MARK_AS_ADVANCED(WITH_CORE)
|
||||
IF (WITH_CORE)
|
||||
FIND_PROGRAM(
|
||||
CLANG_TIDY_EXE
|
||||
NAMES "clang-tidy"
|
||||
DOC "Path to clang-tidy executable"
|
||||
)
|
||||
IF(NOT CLANG_TIDY_EXE)
|
||||
MESSAGE(STATUS "clang-tidy not found.")
|
||||
ELSE(NOT CLANG_TIDY_EXE)
|
||||
MESSAGE(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}")
|
||||
SET(DO_CLANG_TIDY "${CLANG_TIDY_EXE}" "-checks=*,-clang-analyzer-alpha.*,-cppcoreguidelines*,-readability-implicit-bool-cast,-llvm-include-order,-cert-err58-cpp,-modernize-pass-by-value,-google-readability-braces-around-statements,-modernize-use-auto,-modernize-loop-convert,-readability-else-after-return,-readability-braces-around-statements,-google-runtime-references,-readability-named-parameter,-google-default-arguments,-google-readability-todo,-readability-inconsistent-declaration-parameter-name,-cert-flp30-c,-google-readability-casting,-clang-analyzer-security.FloatLoopCounter,-google-runtime-int,-modernize-use-using,-google-explicit-constructor,-google-build-using-namespace,-cert-err34-c,-clang-analyzer-core.CallAndMessage,-google-readability-function-size,-modernize-make-shared,-modernize-use-nullptr,-clang-analyzer-cplusplus.NewDeleteLeaks,-clang-analyzer-core.NonNullParamChecker,performance-unnecessary-copy-initialization,-readability-simplify-boolean-expr,-modernize-raw-string-literal,-performance-unnecessary-copy-initialization")
|
||||
ENDIF(NOT CLANG_TIDY_EXE)
|
||||
IF(WITH_CLANG_TIDY)
|
||||
FIND_PROGRAM(
|
||||
CLANG_TIDY_EXE
|
||||
NAMES "clang-tidy"
|
||||
DOC "Path to clang-tidy executable"
|
||||
)
|
||||
IF(NOT CLANG_TIDY_EXE)
|
||||
MESSAGE(STATUS "clang-tidy not found.")
|
||||
ELSE(NOT CLANG_TIDY_EXE)
|
||||
MESSAGE(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}")
|
||||
SET(DO_CLANG_TIDY "${CLANG_TIDY_EXE}" "-checks=*,-clang-analyzer-alpha.*,-cppcoreguidelines*,-readability-implicit-bool-cast,-llvm-include-order,-cert-err58-cpp,-modernize-pass-by-value,-google-readability-braces-around-statements,-modernize-use-auto,-modernize-loop-convert,-readability-else-after-return,-readability-braces-around-statements,-google-runtime-references,-readability-named-parameter,-google-default-arguments,-google-readability-todo,-readability-inconsistent-declaration-parameter-name,-cert-flp30-c,-google-readability-casting,-clang-analyzer-security.FloatLoopCounter,-google-runtime-int,-modernize-use-using,-google-explicit-constructor,-google-build-using-namespace,-cert-err34-c,-clang-analyzer-core.CallAndMessage,-google-readability-function-size,-modernize-make-shared,-modernize-use-nullptr,-clang-analyzer-cplusplus.NewDeleteLeaks,-clang-analyzer-core.NonNullParamChecker,performance-unnecessary-copy-initialization,-readability-simplify-boolean-expr,-modernize-raw-string-literal,-performance-unnecessary-copy-initialization")
|
||||
ENDIF(NOT CLANG_TIDY_EXE)
|
||||
ENDIF(WITH_CLANG_TIDY)
|
||||
ENDIF (WITH_CORE)
|
||||
|
||||
#############################################################
|
||||
|
56
INSTALL
56
INSTALL
@ -1,10 +1,10 @@
|
||||
QGIS
|
||||
Building QGIS from source - step by step
|
||||
Saturday September 23, 2017
|
||||
Wednesday November 01, 2017
|
||||
|
||||
|
||||
Last Updated: Saturday September 23, 2017
|
||||
Last Change : Saturday September 23, 2017
|
||||
Last Updated: Wednesday November 01, 2017
|
||||
Last Change : Wednesday November 01, 2017
|
||||
|
||||
|
||||
1. Introduction
|
||||
@ -66,7 +66,7 @@ regularly updated to match the corresponding release. Instructions for the curre
|
||||
master branch are available at
|
||||
http://htmlpreview.github.io/?https://raw.github.com/qgis/QGIS/master/doc/INSTALL.html.
|
||||
If you wish to build another version of QGIS, ensure to checkout the appropriate
|
||||
release branch.
|
||||
release branch. The QGIS source code can be found in the repository (https://github.com/qgis/QGIS).
|
||||
|
||||
Please visit http://qgis.org for information on joining our mailing lists
|
||||
and getting involved in the project further.
|
||||
@ -179,12 +179,12 @@ Now update your local sources database:
|
||||
===============================
|
||||
|
||||
|| Distribution | install command for packages |
|
||||
| stretch | ``apt-get install bison ca-certificates cmake dh-python doxygen flex gdal-bin git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libpq-dev libproj-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqt5opengl5-dev libqt5scintilla2-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libzip-dev lighttpd locales ninja-build pkg-config poppler-utils pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-dev python3-future python3-gdal python3-mock python3-nose2 python3-psycopg2 python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-sip python3-sip-dev python3-termcolor python3-yaml qt5keychain-dev qtbase5-dev qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools spawn-fcgi txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb cmake-curses-gui expect`` |
|
||||
| xenial | ``apt-get install bison ca-certificates cmake dh-python doxygen flex gdal-bin git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libpq-dev libproj-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqt5opengl5-dev libqt5scintilla2-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libzip-dev lighttpd locales ninja-build pkg-config poppler-utils pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-dev python3-future python3-gdal python3-mock python3-nose2 python3-psycopg2 python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-sip python3-sip-dev python3-termcolor python3-yaml qt5keychain-dev qtbase5-dev qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools spawn-fcgi txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb cmake-curses-gui expect`` |
|
||||
| yakkety | ``apt-get install bison ca-certificates cmake dh-python doxygen flex gdal-bin git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libpq-dev libproj-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqt5opengl5-dev libqt5scintilla2-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libzip-dev lighttpd locales ninja-build pkg-config poppler-utils pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-dev python3-future python3-gdal python3-mock python3-nose2 python3-psycopg2 python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-sip python3-sip-dev python3-termcolor python3-yaml qt5keychain-dev qtbase5-dev qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools spawn-fcgi txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb cmake-curses-gui expect`` |
|
||||
| zesty | ``apt-get install bison ca-certificates cmake dh-python doxygen flex gdal-bin git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libpq-dev libproj-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqt5opengl5-dev libqt5scintilla2-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libzip-dev lighttpd locales ninja-build pkg-config poppler-utils pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-dev python3-future python3-gdal python3-mock python3-nose2 python3-psycopg2 python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-sip python3-sip-dev python3-termcolor python3-yaml qt5keychain-dev qtbase5-dev qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools spawn-fcgi txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb cmake-curses-gui expect`` |
|
||||
| artful | ``apt-get install bison ca-certificates cmake dh-python doxygen flex gdal-bin git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libpq-dev libproj-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqt5opengl5-dev libqt5scintilla2-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libzip-dev lighttpd locales ninja-build pkg-config poppler-utils pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-dev python3-future python3-gdal python3-mock python3-nose2 python3-psycopg2 python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-sip python3-sip-dev python3-termcolor python3-yaml qt5keychain-dev qtbase5-dev qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools spawn-fcgi txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb cmake-curses-gui expect`` |
|
||||
| sid | ``apt-get install bison ca-certificates cmake dh-python doxygen flex gdal-bin git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libosgearth-dev libpq-dev libproj-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqt5opengl5-dev libqt5scintilla2-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libzip-dev lighttpd locales ninja-build pkg-config poppler-utils pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-dev python3-future python3-gdal python3-mock python3-nose2 python3-psycopg2 python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-sip python3-sip-dev python3-termcolor python3-yaml qt5keychain-dev qtbase5-dev qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools spawn-fcgi txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb cmake-curses-gui expect`` |
|
||||
| stretch | ``apt-get install bison ca-certificates cmake dh-python doxygen flex gdal-bin git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libpq-dev libproj-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqt5opengl5-dev libqt5scintilla2-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libzip-dev lighttpd locales ninja-build pkg-config poppler-utils pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-dev python3-future python3-gdal python3-mock python3-nose2 python3-psycopg2 python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-sip python3-sip-dev python3-termcolor python3-yaml qt5keychain-dev qtbase5-dev qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools spawn-fcgi txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb cmake-curses-gui expect qt5-default`` |
|
||||
| xenial | ``apt-get install bison ca-certificates cmake dh-python doxygen flex gdal-bin git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libpq-dev libproj-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqt5opengl5-dev libqt5scintilla2-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libzip-dev lighttpd locales ninja-build pkg-config poppler-utils pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-dev python3-future python3-gdal python3-mock python3-nose2 python3-psycopg2 python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-sip python3-sip-dev python3-termcolor python3-yaml qt5keychain-dev qtbase5-dev qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools spawn-fcgi txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb cmake-curses-gui expect qt5-default`` |
|
||||
| yakkety | ``apt-get install bison ca-certificates cmake dh-python doxygen flex gdal-bin git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libpq-dev libproj-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqt5opengl5-dev libqt5scintilla2-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libzip-dev lighttpd locales ninja-build pkg-config poppler-utils pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-dev python3-future python3-gdal python3-mock python3-nose2 python3-psycopg2 python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-sip python3-sip-dev python3-termcolor python3-yaml qt5keychain-dev qtbase5-dev qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools spawn-fcgi txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb cmake-curses-gui expect qt5-default`` |
|
||||
| zesty | ``apt-get install bison ca-certificates cmake dh-python doxygen flex gdal-bin git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libpq-dev libproj-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqt5opengl5-dev libqt5scintilla2-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libzip-dev lighttpd locales ninja-build pkg-config poppler-utils pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-dev python3-future python3-gdal python3-mock python3-nose2 python3-psycopg2 python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-sip python3-sip-dev python3-termcolor python3-yaml qt5keychain-dev qtbase5-dev qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools spawn-fcgi txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb cmake-curses-gui expect qt5-default`` |
|
||||
| artful | ``apt-get install bison ca-certificates cmake dh-python doxygen flex gdal-bin git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libosgearth-dev libpq-dev libproj-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqt5opengl5-dev libqt5scintilla2-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libzip-dev lighttpd locales ninja-build pkg-config poppler-utils pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-dev python3-future python3-gdal python3-mock python3-nose2 python3-psycopg2 python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-sip python3-sip-dev python3-termcolor python3-yaml qt3d-assimpsceneimport-plugin qt3d-defaultgeometryloader-plugin qt3d-gltfsceneio-plugin qt3d-scene2d-plugin qt3d5-dev qt5keychain-dev qtbase5-dev qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools spawn-fcgi txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb cmake-curses-gui expect qt5-default`` |
|
||||
| sid | ``apt-get install bison ca-certificates cmake dh-python doxygen flex gdal-bin git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libosgearth-dev libpq-dev libproj-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqt5opengl5-dev libqt5scintilla2-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libzip-dev lighttpd locales ninja-build pkg-config poppler-utils pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-dev python3-future python3-gdal python3-mock python3-nose2 python3-psycopg2 python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-sip python3-sip-dev python3-termcolor python3-yaml qt3d-assimpsceneimport-plugin qt3d-defaultgeometryloader-plugin qt3d-gltfsceneio-plugin qt3d-scene2d-plugin qt3d5-dev qt5keychain-dev qtbase5-dev qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools spawn-fcgi txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb cmake-curses-gui expect qt5-default`` |
|
||||
|
||||
(extracted from the control.in file in debian/)
|
||||
|
||||
@ -365,7 +365,7 @@ new subdirectory called `build` or `build-qt5` in it.
|
||||
3.9.1. Install build dependencies
|
||||
=================================
|
||||
|
||||
dnf install qt5-qtwebkit-devel qt5-qtlocation-devel qt5-qttools-static qt5-qtscript-devel qca-qt5-devel python3-qt5-devel python3-qscintilla-qt5-devel qscintilla-qt5-devel python3-qscintilla-devel python3-qscintilla-qt5 clang flex bison geos-devel gdal-devel sqlite-devel libspatialite-devel qt5-qtsvg-devel qt5-qtxmlpatterns-devel spatialindex-devel expat-devel proj-devel qwt-qt5-devel gsl-devel postgresql-devel cmake python3-future gdal-python3 python3-psycopg2 python3-PyYAML python3-pygments python3-jinja2 python3-OWSLib qca-qt5-ossl qwt-qt5-devel qtkeychain-qt5-devel qwt-devel sip-devel libzip-devel
|
||||
dnf install qt5-qtwebkit-devel qt5-qtlocation-devel qt5-qttools-static qt5-qtscript-devel qca-qt5-devel qca-qt5-ossl qt5-qt3d-devel python3-qt5-devel python3-qscintilla-qt5-devel qscintilla-qt5-devel python3-qscintilla-devel python3-qscintilla-qt5 clang flex bison geos-devel gdal-devel sqlite-devel libspatialite-devel qt5-qtsvg-devel qt5-qtxmlpatterns-devel spatialindex-devel expat-devel proj-devel qwt-qt5-devel gsl-devel postgresql-devel cmake python3-future gdal-python3 python3-psycopg2 python3-PyYAML python3-pygments python3-jinja2 python3-OWSLib qca-qt5-ossl qwt-qt5-devel qtkeychain-qt5-devel qwt-devel sip-devel libzip-devel
|
||||
|
||||
To build QGIS server additional dependencies are required:
|
||||
|
||||
@ -469,6 +469,7 @@ and from OSGeo4W (select Advanced Installation):
|
||||
- python3-future
|
||||
- python3-pyyaml
|
||||
- python3-mock
|
||||
- python3-six
|
||||
- qca-qt5-devel
|
||||
- qca-qt5-libs
|
||||
- qscintilla-qt5
|
||||
@ -669,23 +670,23 @@ it, just point the installer to c:\msys\mingw
|
||||
|
||||
When Qt installation is complete:
|
||||
|
||||
Edit C:\Qt\4.8.0\bin\qtvars.bat and add the following lines:
|
||||
Edit C:\Qt\5.9.1\bin\qtvars.bat and add the following lines:
|
||||
|
||||
set PATH=%PATH%;C:\msys\local\bin;c:\msys\local\lib
|
||||
set PATH=%PATH%;"C:\Program Files\Subversion\bin"
|
||||
|
||||
I suggest you also add C:\Qt\4.8.0\bin\ to your Environment Variables Path in
|
||||
I suggest you also add C:\Qt\5.9.1\bin\ to your Environment Variables Path in
|
||||
the windows system preferences.
|
||||
|
||||
If you plan to do some debugging, you'll need to compile debug version of Qt:
|
||||
C:\Qt\4.8.0\bin\qtvars.bat compile_debug
|
||||
C:\Qt\5.9.1\bin\qtvars.bat compile_debug
|
||||
|
||||
Note: there is a problem when compiling debug version of Qt 4.7, the script ends with
|
||||
this message "mingw32-make: *** No rule to make target `debug'. Stop.". To
|
||||
compile the debug version you have to go out of src directory and execute the
|
||||
following command:
|
||||
|
||||
c:\Qt\4.8.0 make
|
||||
c:\Qt\5.9.1 make
|
||||
|
||||
|
||||
4.2.3. Flex and Bison
|
||||
@ -696,13 +697,16 @@ http://sourceforge.net/project/showfiles.php?group_id=23617&package_id=16424
|
||||
(the zip bin) and extract it into c:\msys\mingw\bin
|
||||
|
||||
|
||||
4.2.4. Python stuff (optional)
|
||||
==============================
|
||||
4.2.4. Python
|
||||
=============
|
||||
|
||||
Follow this section in case you would like to use Python bindings for QGIS. To
|
||||
be able to compile bindings, you need to compile SIP and PyQt4 from sources as
|
||||
be able to compile bindings, you need to compile SIP and PyQt5 from sources as
|
||||
their installer doesn't include some development files which are necessary.
|
||||
|
||||
Note that even if you compile without the Python bindings, Python3 is still
|
||||
a necessary dependency for building QGIS.
|
||||
|
||||
|
||||
4.2.4.1. Download and install Python - use Windows installer
|
||||
============================================================
|
||||
@ -712,7 +716,7 @@ their installer doesn't include some development files which are necessary.
|
||||
http://python.org/download/
|
||||
|
||||
|
||||
4.2.4.2. Download SIP and PyQt4 sources
|
||||
4.2.4.2. Download SIP and PyQt5 sources
|
||||
=======================================
|
||||
|
||||
http://www.riverbankcomputing.com/software/sip/download
|
||||
@ -725,7 +729,7 @@ to get versions that match your current Qt installed version.
|
||||
4.2.4.3. Compile SIP
|
||||
====================
|
||||
|
||||
c:\Qt\4.8.0\bin\qtvars.bat
|
||||
c:\Qt\5.9.1\bin\qtvars.bat
|
||||
python configure.py -p win32-g++
|
||||
make
|
||||
make install
|
||||
@ -734,7 +738,7 @@ to get versions that match your current Qt installed version.
|
||||
4.2.4.4. Compile PyQt
|
||||
=====================
|
||||
|
||||
c:\Qt\4.8.0\bin\qtvars.bat
|
||||
c:\Qt\5.9.1\bin\qtvars.bat
|
||||
python configure.py
|
||||
make
|
||||
make install
|
||||
@ -743,7 +747,7 @@ to get versions that match your current Qt installed version.
|
||||
4.2.4.5. Final python notes
|
||||
===========================
|
||||
|
||||
/!\ You can delete the directories with unpacked SIP and PyQt4 sources after a
|
||||
/!\ You can delete the directories with unpacked SIP and PyQt5 sources after a
|
||||
successful install, they're not needed anymore.
|
||||
|
||||
|
||||
@ -761,7 +765,7 @@ https://git-scm.com/download/win
|
||||
|
||||
CMake is build system used by QGIS. Download it from here:
|
||||
|
||||
http://www.cmake.org/files/v2.8/cmake-2.8.2-win32-x86.exe
|
||||
https://cmake.org/files/v3.9/cmake-3.9.3-win64-x64.msi
|
||||
|
||||
|
||||
4.2.7. QGIS
|
||||
@ -787,9 +791,9 @@ this document.
|
||||
Start a cmd.exe window ( Start -> Run -> cmd.exe ) if you don't have one
|
||||
already. Add paths to compiler and our MSYS environment:
|
||||
|
||||
c:\Qt\4.8.0\bin\qtvars.bat
|
||||
c:\Qt\5.9.1\bin\qtvars.bat
|
||||
|
||||
For ease of use add c:\Qt\4.8.0\bin\ to your system path in system
|
||||
For ease of use add c:\Qt\5.9.1\bin\ to your system path in system
|
||||
properties so you can just type qtvars.bat when you open the cmd console.
|
||||
Create build directory and set it as current directory:
|
||||
|
||||
@ -1849,7 +1853,7 @@ script and add arch flags to the configuration:
|
||||
|
||||
cmake -D CMAKE_INSTALL_PREFIX=~/Applications \
|
||||
-D CMAKE_BUILD_TYPE=MINSIZEREL -D ENABLE_TESTS=FALSE \
|
||||
-D WITH_INTERNAL_SPATIALITE=FALSE -D WITH_PYSPATIALITE=FALSE \
|
||||
-D WITH_INTERNAL_SPATIALITE=FALSE \
|
||||
-D SPATIALINDEX_LIBRARY=/usr/local/lib/libspatialindex.dylib \
|
||||
-D SPATIALINDEX_INCLUDE_DIR=/usr/local/include/spatialindex \
|
||||
-D QWT_LIBRARY=/usr/local/qwt-5.2.2/lib/libqwt.dylib \
|
||||
|
@ -5,7 +5,7 @@
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
|
||||
<TITLE>QGIS</TITLE>
|
||||
|
||||
<!-- Included doc/style.css -->
|
||||
<!-- Included /home/fischer/src/qgis/doc/style.css -->
|
||||
<STYLE TYPE="text/css">
|
||||
body{ background: white;
|
||||
color: black;
|
||||
@ -77,13 +77,13 @@ label{ background-color: #FFFFCC;
|
||||
<DIV CLASS="header" ID="header">
|
||||
<H1>QGIS</H1>
|
||||
<H2>Building QGIS from source - step by step</H2>
|
||||
<H3>Saturday October 14, 2017</H3>
|
||||
<H3>Wednesday November 01, 2017</H3>
|
||||
</DIV>
|
||||
|
||||
<DIV CLASS="body" ID="body">
|
||||
<P>
|
||||
Last Updated: Saturday October 14, 2017
|
||||
Last Change : Saturday October 14, 2017
|
||||
Last Updated: Wednesday November 01, 2017
|
||||
Last Change : Wednesday November 01, 2017
|
||||
</P>
|
||||
<DIV CLASS="toc">
|
||||
|
||||
@ -214,6 +214,7 @@ Required build dependencies:
|
||||
<LI>QScintilla2
|
||||
<LI>QCA
|
||||
<LI>qtkeychain (>= 0.5)
|
||||
<LI>libzip
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
@ -309,27 +310,27 @@ sudo apt-get update
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>stretch</TD>
|
||||
<TD><CODE>apt-get install bison ca-certificates cmake dh-python doxygen flex gdal-bin git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libpq-dev libproj-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqt5opengl5-dev libqt5scintilla2-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libzip-dev lighttpd locales ninja-build pkg-config poppler-utils pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-dev python3-future python3-gdal python3-mock python3-nose2 python3-psycopg2 python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-sip python3-sip-dev python3-termcolor python3-yaml qt5keychain-dev qtbase5-dev qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools spawn-fcgi txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb cmake-curses-gui expect</CODE></TD>
|
||||
<TD><CODE>apt-get install bison ca-certificates cmake dh-python doxygen flex gdal-bin git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libpq-dev libproj-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqt5opengl5-dev libqt5scintilla2-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libzip-dev lighttpd locales ninja-build pkg-config poppler-utils pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-dev python3-future python3-gdal python3-mock python3-nose2 python3-psycopg2 python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-sip python3-sip-dev python3-termcolor python3-yaml qt5keychain-dev qtbase5-dev qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools spawn-fcgi txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb cmake-curses-gui expect qt5-default</CODE></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>xenial</TD>
|
||||
<TD><CODE>apt-get install bison ca-certificates cmake dh-python doxygen flex gdal-bin git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libpq-dev libproj-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqt5opengl5-dev libqt5scintilla2-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libzip-dev lighttpd locales ninja-build pkg-config poppler-utils pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-dev python3-future python3-gdal python3-mock python3-nose2 python3-psycopg2 python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-sip python3-sip-dev python3-termcolor python3-yaml qt5keychain-dev qtbase5-dev qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools spawn-fcgi txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb cmake-curses-gui expect</CODE></TD>
|
||||
<TD><CODE>apt-get install bison ca-certificates cmake dh-python doxygen flex gdal-bin git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libpq-dev libproj-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqt5opengl5-dev libqt5scintilla2-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libzip-dev lighttpd locales ninja-build pkg-config poppler-utils pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-dev python3-future python3-gdal python3-mock python3-nose2 python3-psycopg2 python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-sip python3-sip-dev python3-termcolor python3-yaml qt5keychain-dev qtbase5-dev qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools spawn-fcgi txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb cmake-curses-gui expect qt5-default</CODE></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>yakkety</TD>
|
||||
<TD><CODE>apt-get install bison ca-certificates cmake dh-python doxygen flex gdal-bin git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libpq-dev libproj-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqt5opengl5-dev libqt5scintilla2-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libzip-dev lighttpd locales ninja-build pkg-config poppler-utils pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-dev python3-future python3-gdal python3-mock python3-nose2 python3-psycopg2 python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-sip python3-sip-dev python3-termcolor python3-yaml qt5keychain-dev qtbase5-dev qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools spawn-fcgi txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb cmake-curses-gui expect</CODE></TD>
|
||||
<TD><CODE>apt-get install bison ca-certificates cmake dh-python doxygen flex gdal-bin git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libpq-dev libproj-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqt5opengl5-dev libqt5scintilla2-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libzip-dev lighttpd locales ninja-build pkg-config poppler-utils pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-dev python3-future python3-gdal python3-mock python3-nose2 python3-psycopg2 python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-sip python3-sip-dev python3-termcolor python3-yaml qt5keychain-dev qtbase5-dev qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools spawn-fcgi txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb cmake-curses-gui expect qt5-default</CODE></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>zesty</TD>
|
||||
<TD><CODE>apt-get install bison ca-certificates cmake dh-python doxygen flex gdal-bin git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libpq-dev libproj-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqt5opengl5-dev libqt5scintilla2-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libzip-dev lighttpd locales ninja-build pkg-config poppler-utils pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-dev python3-future python3-gdal python3-mock python3-nose2 python3-psycopg2 python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-sip python3-sip-dev python3-termcolor python3-yaml qt5keychain-dev qtbase5-dev qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools spawn-fcgi txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb cmake-curses-gui expect</CODE></TD>
|
||||
<TD><CODE>apt-get install bison ca-certificates cmake dh-python doxygen flex gdal-bin git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libpq-dev libproj-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqt5opengl5-dev libqt5scintilla2-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libzip-dev lighttpd locales ninja-build pkg-config poppler-utils pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-dev python3-future python3-gdal python3-mock python3-nose2 python3-psycopg2 python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-sip python3-sip-dev python3-termcolor python3-yaml qt5keychain-dev qtbase5-dev qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools spawn-fcgi txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb cmake-curses-gui expect qt5-default</CODE></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>artful</TD>
|
||||
<TD><CODE>apt-get install bison ca-certificates cmake dh-python doxygen flex gdal-bin git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libpq-dev libproj-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqt5opengl5-dev libqt5scintilla2-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libzip-dev lighttpd locales ninja-build pkg-config poppler-utils pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-dev python3-future python3-gdal python3-mock python3-nose2 python3-psycopg2 python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-sip python3-sip-dev python3-termcolor python3-yaml qt5keychain-dev qtbase5-dev qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools spawn-fcgi txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb cmake-curses-gui expect</CODE></TD>
|
||||
<TD><CODE>apt-get install bison ca-certificates cmake dh-python doxygen flex gdal-bin git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libosgearth-dev libpq-dev libproj-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqt5opengl5-dev libqt5scintilla2-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libzip-dev lighttpd locales ninja-build pkg-config poppler-utils pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-dev python3-future python3-gdal python3-mock python3-nose2 python3-psycopg2 python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-sip python3-sip-dev python3-termcolor python3-yaml qt3d-assimpsceneimport-plugin qt3d-defaultgeometryloader-plugin qt3d-gltfsceneio-plugin qt3d-scene2d-plugin qt3d5-dev qt5keychain-dev qtbase5-dev qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools spawn-fcgi txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb cmake-curses-gui expect qt5-default</CODE></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>sid</TD>
|
||||
<TD><CODE>apt-get install bison ca-certificates cmake dh-python doxygen flex gdal-bin git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libosgearth-dev libpq-dev libproj-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqt5opengl5-dev libqt5scintilla2-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libzip-dev lighttpd locales ninja-build pkg-config poppler-utils pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-dev python3-future python3-gdal python3-mock python3-nose2 python3-psycopg2 python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-sip python3-sip-dev python3-termcolor python3-yaml qt5keychain-dev qtbase5-dev qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools spawn-fcgi txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb cmake-curses-gui expect</CODE></TD>
|
||||
<TD><CODE>apt-get install bison ca-certificates cmake dh-python doxygen flex gdal-bin git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libosgearth-dev libpq-dev libproj-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqt5opengl5-dev libqt5scintilla2-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libzip-dev lighttpd locales ninja-build pkg-config poppler-utils pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-dev python3-future python3-gdal python3-mock python3-nose2 python3-psycopg2 python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-sip python3-sip-dev python3-termcolor python3-yaml qt3d-assimpsceneimport-plugin qt3d-defaultgeometryloader-plugin qt3d-gltfsceneio-plugin qt3d-scene2d-plugin qt3d5-dev qt5keychain-dev qtbase5-dev qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools spawn-fcgi txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb cmake-curses-gui expect qt5-default</CODE></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
@ -2577,7 +2578,7 @@ sudo chmod +x /usr/local/bin/python32
|
||||
|
||||
cmake -D CMAKE_INSTALL_PREFIX=~/Applications \
|
||||
-D CMAKE_BUILD_TYPE=MINSIZEREL -D ENABLE_TESTS=FALSE \
|
||||
-D WITH_INTERNAL_SPATIALITE=FALSE -D WITH_PYSPATIALITE=FALSE \
|
||||
-D WITH_INTERNAL_SPATIALITE=FALSE \
|
||||
-D SPATIALINDEX_LIBRARY=/usr/local/lib/libspatialindex.dylib \
|
||||
-D SPATIALINDEX_INCLUDE_DIR=/usr/local/include/spatialindex \
|
||||
-D QWT_LIBRARY=/usr/local/qwt-5.2.2/lib/libqwt.dylib \
|
||||
@ -3060,5 +3061,5 @@ The following people have contributed to this document:
|
||||
|
||||
</DIV>
|
||||
<!-- html code generated by txt2tags 2.6 (http://txt2tags.org) -->
|
||||
<!-- cmdline: txt2tags -\-encoding=utf-8 -o doc/INSTALL.html -t html doc/INSTALL.t2t -->
|
||||
<!-- cmdline: txt2tags -\-encoding=utf-8 -o/home/fischer/src/qgis/debian/build-master-qt5/doc/INSTALL.html -t html /home/fischer/src/qgis/doc/INSTALL.t2t -->
|
||||
</BODY></HTML>
|
||||
|
@ -64,8 +64,9 @@ Renamed Classes {#qgis_api_break_3_0_renamed_classes}
|
||||
<caption id="renamed_classes">Renamed classes</caption>
|
||||
<tr><th>API 2.x<th>API 3.X
|
||||
<tr><td>QgisGui<td>QgsGuiUtils
|
||||
<tr><td>QgsAttributeAction<td>QgsActionManager
|
||||
<tr><td>QgsAbstractGeometryV2<td>QgsAbstractGeometry
|
||||
<tr><td>QgsArcProperter<td>QgsStrategy
|
||||
<tr><td>QgsAttributeAction<td>QgsActionManager
|
||||
<tr><td>QgsCategorizedSymbolRendererV2<td>QgsCategorizedSymbolRenderer
|
||||
<tr><td>QgsCategorizedSymbolRendererV2Model<td>QgsCategorizedSymbolRendererModel
|
||||
<tr><td>QgsCategorizedSymbolRendererV2ViewStyle<td>QgsCategorizedSymbolRendererViewStyle
|
||||
@ -86,6 +87,7 @@ Renamed Classes {#qgis_api_break_3_0_renamed_classes}
|
||||
<tr><td>QgsCurveV2<td>QgsCurve
|
||||
<tr><td>QgsDbFilterProxyModel<td>QgsDatabaseFilterProxyModel
|
||||
<tr><td>QgsDiagramRendererV2<td>QgsDiagramRenderer
|
||||
<tr><td>QgsDistanceArcProperter<td>QgsDistanceStrategy
|
||||
<tr><td>QgsDoubleBoxBarStyle<td>QgsDoubleBoxScaleBarRenderer
|
||||
<tr><td>QgsEditorWidgetV2<td>QgsEditorWidget
|
||||
<tr><td>QgsEllipseSymbolLayerV2<td>QgsEllipseSymbolLayer
|
||||
@ -104,6 +106,7 @@ Renamed Classes {#qgis_api_break_3_0_renamed_classes}
|
||||
<tr><td>QgsGraduatedSymbolRendererV2Model<td>QgsGraduatedSymbolRendererModel
|
||||
<tr><td>QgsGraduatedSymbolRendererV2ViewStyle<td>QgsGraduatedSymbolRendererViewStyle
|
||||
<tr><td>QgsGraduatedSymbolRendererV2Widget<td>QgsGraduatedSymbolRendererWidget
|
||||
<tr><td>QgsGraphArc<td>QgsGraphEdge
|
||||
<tr><td>QgsJSONExporter<td>QgsJsonExporter
|
||||
<tr><td>QgsJSONUtils<td>QgsJsonUtils
|
||||
<tr><td>QgsLabelingEngineV2<td>QgsLabelingEngine
|
||||
@ -118,11 +121,21 @@ Renamed Classes {#qgis_api_break_3_0_renamed_classes}
|
||||
<tr><td>QgsMarkerSymbolV2<td>QgsMarkerSymbol
|
||||
<tr><td>QgsMultiCurveV2<td>QgsMultiCurve
|
||||
<tr><td>QgsMultiLineStringV2<td>QgsMultiLineString
|
||||
<tr><td>QgsMultiPoint<td>QgsMultiPointXY
|
||||
<tr><td>QgsMultiPointV2<td>QgsMultiPoint
|
||||
<tr><td>QgsMultiPolygon<td>QgsPolygonXY
|
||||
<tr><td>QgsMultiPolygonV2<td>QgsPolygon
|
||||
<tr><td>QgsMultiPolyline<td>QgsPolylineXY
|
||||
<tr><td>QgsMultiPolylineV2<td>QgsPolyline
|
||||
<tr><td>QgsMultiSurfaceV2<td>QgsMultiSurface
|
||||
<tr><td>QgsNumericScaleBarStyle<td>QgsNumericScaleBarRenderer
|
||||
<tr><td>QgsPointV2<td>QgsPoint
|
||||
<tr><td>QgsPoint<td>QgsPointXY
|
||||
<tr><td>QgsPointSequenceV2<td>QgsPointSequence
|
||||
<tr><td>QgsPointV2<td>QgsPoint
|
||||
<tr><td>QgsPolygon<td>QgsPolygonXY
|
||||
<tr><td>QgsPolygonV2<td>QgsPolygon
|
||||
<tr><td>QgsPolyline<td>QgsPolylineXY
|
||||
<tr><td>QgsPolylineV2<td>QgsPolyline
|
||||
<tr><td>QgsProperty<td>QgsProjectProperty
|
||||
<tr><td>QgsPropertyKey<td>QgsProjectPropertyKey
|
||||
<tr><td>QgsPropertyValue<td>QgsProjectPropertyValue
|
||||
@ -175,6 +188,7 @@ Renamed Classes {#qgis_api_break_3_0_renamed_classes}
|
||||
<tr><td>QgsSymbolLayerV2Utils<td>QgsSymbolLayerUtils
|
||||
<tr><td>QgsSymbolLayerV2Widget<td>QgsSymbolLayerWidget
|
||||
<tr><td>QgsSymbolLevelsV2Dialog<td>QgsSymbolLevelsDialog
|
||||
<tr><td>QgsSymbolV2<td>QgsSymbol
|
||||
<tr><td>QgsSymbolV2LegendNode<td>QgsSymbolLegendNode
|
||||
<tr><td>QgsSymbolV2LevelItem<td>QgsSymbolLevelItem
|
||||
<tr><td>QgsSymbolV2RenderContext<td>QgsSymbolRenderContext
|
||||
@ -196,10 +210,6 @@ Renamed Classes {#qgis_api_break_3_0_renamed_classes}
|
||||
<tr><td>QgsVectorRandomColorRampV2<td>QgsLimitedRandomColorRamp
|
||||
<tr><td>QgsVectorRandomColorRampV2Dialog<td>QgsLimitedRandomColorRampDialog
|
||||
<tr><td>QgsVectorRandomColorRampV2DialogBase<td>QgsLimitedRandomColorRampDialogBase
|
||||
<tr><td>QgsSymbolV2<td>QgsSymbol
|
||||
<tr><td>QgsArcProperter<td>QgsStrategy
|
||||
<tr><td>QgsDistanceArcProperter<td>QgsDistanceStrategy
|
||||
<tr><td>QgsGraphArc<td>QgsGraphEdge
|
||||
</table>
|
||||
|
||||
<table>
|
||||
@ -309,6 +319,7 @@ should now call QgsCoordinateReferenceSystem::invalidateCache() and QgsCoordinat
|
||||
- QgsEditorWidgetConfig was removed. Use QVariantMap instead.
|
||||
- QgsScaleExpression. Use QgsProperty with a QgsSizeScalePropertyTransformer instead.
|
||||
- QgsSvgAnnotationItem. Use QgsSvgAnnotation instead.
|
||||
- QgsSvgCacheEntry. This is an internal class and is no longer exposed to public API.
|
||||
- QgsSymbologyV2Conversion was removed. Reading of renderers from pre-1.0 versions is not supported anymore.
|
||||
- QgsTextAnnotationItem. Use QgsTextAnnotation instead.
|
||||
- QgsTransectSample. This class was unused and unmaintained.
|
||||
@ -1301,8 +1312,8 @@ method if the geometry is not being modified.
|
||||
empty geometry collection)
|
||||
- wkbSize() and asWkb() has been replaced by exportToWkb(). WKB representation is no longer cached within QgsGeometry
|
||||
- asGeos() has been replaced by exportToGeos(). GEOS representation is no longer cached within QgsGeometry
|
||||
- int addPart( const QList<QgsPoint> &points, QgsWkbTypes::GeometryType geomType ) has been renamed to addPoints
|
||||
- int addPart( const QList<QgsPointV2> &points, QgsWkbTypes::GeometryType geomType ) has been renamed to addPointsV2
|
||||
- int addPart( const QList<QgsPoint> &points, QgsWkbTypes::GeometryType geomType ) has been renamed to addPointsXY
|
||||
- int addPart( const QList<QgsPointV2> &points, QgsWkbTypes::GeometryType geomType ) has been renamed to addPoints
|
||||
- static bool compare( const QgsPolyline& p1, const QgsPolyline& p2, double epsilon ) has been renamed to comparePolylines
|
||||
- static bool compare( const QgsPolygon& p1, const QgsPolygon& p2, double epsilon ) has been renamed to comparePolygons
|
||||
- static bool compare( const QgsMultiPolygon& p1, const QgsMultiPolygon& p2, double epsilon ) has been renamed to compareMultiPolygons
|
||||
@ -1314,6 +1325,11 @@ empty geometry collection)
|
||||
- fromPolyline() now requires a list of QgsPoint objects, instead of QgsPointXY 2d points. A new method fromPolylineXY was
|
||||
added which uses the old list of 2d QgsPointXY objects. Using the newer method with QgsPoint is greatly preferred, as it
|
||||
maintains Z or M dimensions from the input points and is more efficient.
|
||||
- fromPoint() was renamed to fromPointXY()
|
||||
- fromMultiPoint() was renamed to fromMultiPointXY()
|
||||
- fromMultiPolyline() was renamed to fromMultiPolylineXY()
|
||||
- fromPolygon() was renamed to fromPolygonXY()
|
||||
- fromMultiPolygon() was renamed to fromMultiPolygonXY()
|
||||
|
||||
|
||||
QgsGeometryAnalyzer {#qgis_api_break_3_0_QgsGeometryAnalyzer}
|
||||
@ -1364,6 +1380,13 @@ QgsGraduatedSymbolRenderer {#qgis_api_break_3_0_QgsGraduatedSymbolRendere
|
||||
- sizeScaleFieldChanged() and scaleMethodChanged() were removed. These settings are no longer exposed in the widget's GUI.
|
||||
|
||||
|
||||
QgsGraph {#qgis_api_break_3_0_QgsGraph}
|
||||
--------
|
||||
|
||||
- addEdge now explicitly takes the fromVertex as first argument, and toVertex as second argument. The original
|
||||
API design was unclear due to the reversed methods in QgsGraphEdge and QgsGraphVertex.
|
||||
|
||||
|
||||
QgsGraphBuilderInterface {#qgis_api_break_3_0_QgsGraphBuilderInterface}
|
||||
------------------------
|
||||
|
||||
@ -1371,6 +1394,20 @@ QgsGraphBuilderInterface {#qgis_api_break_3_0_QgsGraphBuilderInterface}
|
||||
plugins calling this method will need to be updated.
|
||||
|
||||
|
||||
QgsGraphEdge {#qgis_api_break_3_0_QgsGraphEdge}
|
||||
------------
|
||||
|
||||
- outVertex() was renamed as toVertex() (yes, the original name was the opposite of the returned value!)
|
||||
- inVertex() was renamed as fromVertex() (yes, the original name was the opposite of the returned value!)
|
||||
|
||||
|
||||
QgsGraphVertex {#qgis_api_break_3_0_QgsGraphVertex}
|
||||
--------------
|
||||
|
||||
- outEdges() was renamed as incomingEdges() (yes, the original name was the opposite of the returned value!)
|
||||
- inEdges() was renamed as outgoingEdges() (yes, the original name was the opposite of the returned value!)
|
||||
|
||||
|
||||
QgsEditorWidgetRegistry {#qgis_api_break_3_0_QgsEditorWidgetRegistry}
|
||||
-----------------------
|
||||
|
||||
@ -1762,6 +1799,13 @@ QgsNetworkAccessManager {#qgis_api_break_3_0_QgsNetworkAccessManager}
|
||||
- deleteReply() was removed. Use abort() and deleteLayer() on the reply directly.
|
||||
- requestSent signal was removed. This is no longer emitted.
|
||||
|
||||
|
||||
QgsNetworkStrategy {#qgis_api_break_3_0_QgsNetworkStrategy}
|
||||
------------------
|
||||
|
||||
- requiredAttributes() now returns a set of attributes, instead of a list
|
||||
|
||||
|
||||
QgsNewVectorLayerDialog {#qgis_api_break_3_0_QgsNewVectorLayerDialog}
|
||||
-----------------------
|
||||
|
||||
@ -2274,6 +2318,8 @@ QgsSvgCache {#qgis_api_break_3_0_QgsSvgCache}
|
||||
- containsParamsV2() was removed. Use containsParamsV3() instead.
|
||||
- The rasterScaleFactor parameter was removed from all methods
|
||||
- svgAsImage(), svgAsPicture(), svgViewboxSize(), svgContent(), insertSvg(), cacheEntry() only accept absolute path to SVG file (relative paths will not be resolved).
|
||||
- The protected member insertSvg() was made private. QgsSvgCache is not intended to be subclassed.
|
||||
|
||||
|
||||
QgsSvgCacheEntry {#qgis_api_break_3_0_QgsSvgCacheEntry}
|
||||
----------------
|
||||
|
@ -44,12 +44,12 @@ sudo apt-get update
|
||||
== Install build dependencies ==
|
||||
|
||||
|| Distribution | install command for packages |
|
||||
| stretch | ``apt-get install bison ca-certificates cmake dh-python doxygen flex gdal-bin git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libpq-dev libproj-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqt5opengl5-dev libqt5scintilla2-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libzip-dev lighttpd locales ninja-build pkg-config poppler-utils pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-dev python3-future python3-gdal python3-mock python3-nose2 python3-psycopg2 python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-sip python3-sip-dev python3-termcolor python3-yaml qt5keychain-dev qtbase5-dev qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools spawn-fcgi txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb cmake-curses-gui expect`` |
|
||||
| xenial | ``apt-get install bison ca-certificates cmake dh-python doxygen flex gdal-bin git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libpq-dev libproj-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqt5opengl5-dev libqt5scintilla2-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libzip-dev lighttpd locales ninja-build pkg-config poppler-utils pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-dev python3-future python3-gdal python3-mock python3-nose2 python3-psycopg2 python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-sip python3-sip-dev python3-termcolor python3-yaml qt5keychain-dev qtbase5-dev qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools spawn-fcgi txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb cmake-curses-gui expect`` |
|
||||
| yakkety | ``apt-get install bison ca-certificates cmake dh-python doxygen flex gdal-bin git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libpq-dev libproj-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqt5opengl5-dev libqt5scintilla2-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libzip-dev lighttpd locales ninja-build pkg-config poppler-utils pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-dev python3-future python3-gdal python3-mock python3-nose2 python3-psycopg2 python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-sip python3-sip-dev python3-termcolor python3-yaml qt5keychain-dev qtbase5-dev qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools spawn-fcgi txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb cmake-curses-gui expect`` |
|
||||
| zesty | ``apt-get install bison ca-certificates cmake dh-python doxygen flex gdal-bin git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libpq-dev libproj-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqt5opengl5-dev libqt5scintilla2-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libzip-dev lighttpd locales ninja-build pkg-config poppler-utils pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-dev python3-future python3-gdal python3-mock python3-nose2 python3-psycopg2 python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-sip python3-sip-dev python3-termcolor python3-yaml qt5keychain-dev qtbase5-dev qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools spawn-fcgi txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb cmake-curses-gui expect`` |
|
||||
| artful | ``apt-get install bison ca-certificates cmake dh-python doxygen flex gdal-bin git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libpq-dev libproj-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqt5opengl5-dev libqt5scintilla2-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libzip-dev lighttpd locales ninja-build pkg-config poppler-utils pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-dev python3-future python3-gdal python3-mock python3-nose2 python3-psycopg2 python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-sip python3-sip-dev python3-termcolor python3-yaml qt5keychain-dev qtbase5-dev qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools spawn-fcgi txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb cmake-curses-gui expect`` |
|
||||
| sid | ``apt-get install bison ca-certificates cmake dh-python doxygen flex gdal-bin git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libosgearth-dev libpq-dev libproj-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqt5opengl5-dev libqt5scintilla2-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libzip-dev lighttpd locales ninja-build pkg-config poppler-utils pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-dev python3-future python3-gdal python3-mock python3-nose2 python3-psycopg2 python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-sip python3-sip-dev python3-termcolor python3-yaml qt5keychain-dev qtbase5-dev qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools spawn-fcgi txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb cmake-curses-gui expect`` |
|
||||
| stretch | ``apt-get install bison ca-certificates cmake dh-python doxygen flex gdal-bin git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libpq-dev libproj-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqt5opengl5-dev libqt5scintilla2-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libzip-dev lighttpd locales ninja-build pkg-config poppler-utils pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-dev python3-future python3-gdal python3-mock python3-nose2 python3-psycopg2 python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-sip python3-sip-dev python3-termcolor python3-yaml qt5keychain-dev qtbase5-dev qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools spawn-fcgi txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb cmake-curses-gui expect qt5-default`` |
|
||||
| xenial | ``apt-get install bison ca-certificates cmake dh-python doxygen flex gdal-bin git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libpq-dev libproj-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqt5opengl5-dev libqt5scintilla2-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libzip-dev lighttpd locales ninja-build pkg-config poppler-utils pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-dev python3-future python3-gdal python3-mock python3-nose2 python3-psycopg2 python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-sip python3-sip-dev python3-termcolor python3-yaml qt5keychain-dev qtbase5-dev qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools spawn-fcgi txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb cmake-curses-gui expect qt5-default`` |
|
||||
| yakkety | ``apt-get install bison ca-certificates cmake dh-python doxygen flex gdal-bin git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libpq-dev libproj-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqt5opengl5-dev libqt5scintilla2-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libzip-dev lighttpd locales ninja-build pkg-config poppler-utils pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-dev python3-future python3-gdal python3-mock python3-nose2 python3-psycopg2 python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-sip python3-sip-dev python3-termcolor python3-yaml qt5keychain-dev qtbase5-dev qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools spawn-fcgi txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb cmake-curses-gui expect qt5-default`` |
|
||||
| zesty | ``apt-get install bison ca-certificates cmake dh-python doxygen flex gdal-bin git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libpq-dev libproj-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqt5opengl5-dev libqt5scintilla2-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libzip-dev lighttpd locales ninja-build pkg-config poppler-utils pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-dev python3-future python3-gdal python3-mock python3-nose2 python3-psycopg2 python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-sip python3-sip-dev python3-termcolor python3-yaml qt5keychain-dev qtbase5-dev qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools spawn-fcgi txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb cmake-curses-gui expect qt5-default`` |
|
||||
| artful | ``apt-get install bison ca-certificates cmake dh-python doxygen flex gdal-bin git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libosgearth-dev libpq-dev libproj-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqt5opengl5-dev libqt5scintilla2-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libzip-dev lighttpd locales ninja-build pkg-config poppler-utils pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-dev python3-future python3-gdal python3-mock python3-nose2 python3-psycopg2 python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-sip python3-sip-dev python3-termcolor python3-yaml qt3d-assimpsceneimport-plugin qt3d-defaultgeometryloader-plugin qt3d-gltfsceneio-plugin qt3d-scene2d-plugin qt3d5-dev qt5keychain-dev qtbase5-dev qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools spawn-fcgi txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb cmake-curses-gui expect qt5-default`` |
|
||||
| sid | ``apt-get install bison ca-certificates cmake dh-python doxygen flex gdal-bin git graphviz grass-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libosgearth-dev libpq-dev libproj-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqt5opengl5-dev libqt5scintilla2-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libzip-dev lighttpd locales ninja-build pkg-config poppler-utils pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-dev python3-future python3-gdal python3-mock python3-nose2 python3-psycopg2 python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-sip python3-sip-dev python3-termcolor python3-yaml qt3d-assimpsceneimport-plugin qt3d-defaultgeometryloader-plugin qt3d-gltfsceneio-plugin qt3d-scene2d-plugin qt3d5-dev qt5keychain-dev qtbase5-dev qtpositioning5-dev qtscript5-dev qttools5-dev qttools5-dev-tools spawn-fcgi txt2tags xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb cmake-curses-gui expect qt5-default`` |
|
||||
|
||||
(extracted from the control.in file in ``debian/``)
|
||||
|
||||
|
@ -866,7 +866,7 @@ sudo chmod +x /usr/local/bin/python32
|
||||
|
||||
cmake -D CMAKE_INSTALL_PREFIX=~/Applications \
|
||||
-D CMAKE_BUILD_TYPE=MINSIZEREL -D ENABLE_TESTS=FALSE \
|
||||
-D WITH_INTERNAL_SPATIALITE=FALSE -D WITH_PYSPATIALITE=FALSE \
|
||||
-D WITH_INTERNAL_SPATIALITE=FALSE \
|
||||
-D SPATIALINDEX_LIBRARY=/usr/local/lib/libspatialindex.dylib \
|
||||
-D SPATIALINDEX_INCLUDE_DIR=/usr/local/include/spatialindex \
|
||||
-D QWT_LIBRARY=/usr/local/qwt-5.2.2/lib/libqwt.dylib \
|
||||
|
@ -27,6 +27,7 @@ Required build dependencies:
|
||||
- QScintilla2
|
||||
- QCA
|
||||
- qtkeychain (>= 0.5)
|
||||
- libzip
|
||||
-
|
||||
|
||||
Optional dependencies:
|
||||
|
@ -1 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="20" height="20" viewBox="0 0 24 24"><path fill="#000000" fill-opacity="0.25" stroke="#FFFFFF" stroke-opacity="0.25" d="M16,12V4H17V2H7V4H8V12L6,14V16H11.2V22H12.8V16H18V14L16,12Z" /></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 21.6 21.6"><path d="M14.8 10.5V3.7h1v-2h-10v2h1v6.8l-2 2v2H10v5.4h1.6v-5.4h5.2v-2z" fill-opacity=".25" stroke="#fff" stroke-opacity=".25"/></svg>
|
||||
|
Before Width: | Height: | Size: 429 B After Width: | Height: | Size: 222 B |
@ -41,15 +41,17 @@ class QgsGraphEdge
|
||||
:rtype: list of QVariant
|
||||
%End
|
||||
|
||||
int outVertex() const;
|
||||
int toVertex() const;
|
||||
%Docstring
|
||||
Returns index of the outgoing vertex
|
||||
Returns the index of the vertex at the end of this edge.
|
||||
.. seealso:: fromVertex()
|
||||
:rtype: int
|
||||
%End
|
||||
|
||||
int inVertex() const;
|
||||
int fromVertex() const;
|
||||
%Docstring
|
||||
Returns index of the incoming vertex
|
||||
Returns the index of the vertex at the start of this edge.
|
||||
.. seealso:: toVertex()
|
||||
:rtype: int
|
||||
%End
|
||||
|
||||
@ -62,6 +64,7 @@ class QgsGraphVertex
|
||||
{
|
||||
%Docstring
|
||||
This class implements a graph vertex
|
||||
.. versionadded:: 3.0
|
||||
%End
|
||||
|
||||
%TypeHeaderCode
|
||||
@ -80,21 +83,23 @@ class QgsGraphVertex
|
||||
This constructor initializes QgsGraphVertex object and associates a vertex with a point
|
||||
%End
|
||||
|
||||
QgsGraphEdgeIds outEdges() const;
|
||||
QgsGraphEdgeIds incomingEdges() const;
|
||||
%Docstring
|
||||
Returns outgoing edges ids
|
||||
Returns the incoming edge ids, i.e. edges which end at this node.
|
||||
.. seealso:: outgoingEdges()
|
||||
:rtype: QgsGraphEdgeIds
|
||||
%End
|
||||
|
||||
QgsGraphEdgeIds inEdges() const;
|
||||
QgsGraphEdgeIds outgoingEdges() const;
|
||||
%Docstring
|
||||
Return incoming edges ids
|
||||
Returns outgoing edge ids, i.e. edges which start at this node.
|
||||
.. seealso:: incomingEdges()
|
||||
:rtype: QgsGraphEdgeIds
|
||||
%End
|
||||
|
||||
QgsPointXY point() const;
|
||||
%Docstring
|
||||
Returns point associated with graph vertex
|
||||
Returns point associated with graph vertex.
|
||||
:rtype: QgsPointXY
|
||||
%End
|
||||
|
||||
@ -105,6 +110,7 @@ class QgsGraph
|
||||
{
|
||||
%Docstring
|
||||
Mathematical graph representation
|
||||
.. versionadded:: 3.0
|
||||
%End
|
||||
|
||||
%TypeHeaderCode
|
||||
@ -124,9 +130,10 @@ class QgsGraph
|
||||
:rtype: int
|
||||
%End
|
||||
|
||||
int addEdge( int outVertexIdx, int inVertexIdx, const QVector< QVariant > &strategies );
|
||||
int addEdge( int fromVertexIdx, int toVertexIdx, const QVector< QVariant > &strategies );
|
||||
%Docstring
|
||||
Add an edge to the graph
|
||||
Add an edge to the graph, going from the ``fromVertexIdx``
|
||||
to ``toVertexIdx``.
|
||||
:rtype: int
|
||||
%End
|
||||
|
||||
|
@ -30,12 +30,14 @@ class QgsGraphBuilder : QgsGraphBuilderInterface
|
||||
~QgsGraphBuilder();
|
||||
|
||||
virtual void addVertex( int id, const QgsPointXY &pt );
|
||||
|
||||
%Docstring
|
||||
MANDATORY BUILDER PROPERTY DECLARATION
|
||||
%End
|
||||
|
||||
virtual void addEdge( int pt1id, const QgsPointXY &pt1, int pt2id, const QgsPointXY &pt2, const QVector< QVariant > &prop );
|
||||
|
||||
|
||||
QgsGraph *graph() /Factory/;
|
||||
%Docstring
|
||||
Returns generated QgsGraph
|
||||
|
@ -28,18 +28,8 @@ class QgsNetworkSpeedStrategy : QgsNetworkStrategy
|
||||
|
||||
virtual QVariant cost( double distance, const QgsFeature &f ) const;
|
||||
|
||||
%Docstring
|
||||
Returns edge cost
|
||||
:rtype: QVariant
|
||||
%End
|
||||
virtual QSet< int > requiredAttributes() const;
|
||||
|
||||
virtual QgsAttributeList requiredAttributes() const;
|
||||
|
||||
%Docstring
|
||||
Returns list of the source layer attributes needed for cost calculation.
|
||||
This method called by QgsGraphDirector.
|
||||
:rtype: QgsAttributeList
|
||||
%End
|
||||
|
||||
};
|
||||
|
||||
|
@ -45,12 +45,11 @@ class QgsNetworkStrategy
|
||||
|
||||
virtual ~QgsNetworkStrategy();
|
||||
|
||||
virtual QgsAttributeList requiredAttributes() const;
|
||||
virtual QSet< int > requiredAttributes() const;
|
||||
%Docstring
|
||||
Returns list of the source layer attributes needed for cost calculation.
|
||||
This method called by QgsGraphDirector.
|
||||
:return: list of required attributes
|
||||
:rtype: QgsAttributeList
|
||||
Returns a list of the source layer attributes needed for cost calculation.
|
||||
This is method called by QgsGraphDirector.
|
||||
:rtype: set of int
|
||||
%End
|
||||
|
||||
virtual QVariant cost( double distance, const QgsFeature &f ) const = 0;
|
||||
|
@ -35,16 +35,16 @@ class QgsAbstractGeometry
|
||||
sipType = sipType_QgsCompoundCurve;
|
||||
else if ( qgsgeometry_cast<QgsTriangle *>( sipCpp ) != nullptr )
|
||||
sipType = sipType_QgsTriangle;
|
||||
else if ( qgsgeometry_cast<QgsPolygonV2 *>( sipCpp ) != nullptr )
|
||||
sipType = sipType_QgsPolygonV2;
|
||||
else if ( qgsgeometry_cast<QgsPolygon *>( sipCpp ) != nullptr )
|
||||
sipType = sipType_QgsPolygon;
|
||||
else if ( qgsgeometry_cast<QgsCurvePolygon *>( sipCpp ) != nullptr )
|
||||
sipType = sipType_QgsCurvePolygon;
|
||||
else if ( qgsgeometry_cast<QgsMultiPointV2 *>( sipCpp ) != nullptr )
|
||||
sipType = sipType_QgsMultiPointV2;
|
||||
else if ( qgsgeometry_cast<QgsMultiPoint *>( sipCpp ) != nullptr )
|
||||
sipType = sipType_QgsMultiPoint;
|
||||
else if ( qgsgeometry_cast<QgsMultiLineString *>( sipCpp ) != nullptr )
|
||||
sipType = sipType_QgsMultiLineString;
|
||||
else if ( qgsgeometry_cast<QgsMultiPolygonV2 *>( sipCpp ) != nullptr )
|
||||
sipType = sipType_QgsMultiPolygonV2;
|
||||
else if ( qgsgeometry_cast<QgsMultiPolygon *>( sipCpp ) != nullptr )
|
||||
sipType = sipType_QgsMultiPolygon;
|
||||
else if ( qgsgeometry_cast<QgsMultiSurface *>( sipCpp ) != nullptr )
|
||||
sipType = sipType_QgsMultiSurface;
|
||||
else if ( qgsgeometry_cast<QgsMultiCurve *>( sipCpp ) != nullptr )
|
||||
@ -396,8 +396,8 @@ Returns the centroid of the geometry
|
||||
virtual QgsAbstractGeometry *toCurveType() const = 0 /Factory/;
|
||||
%Docstring
|
||||
Returns the geometry converted to the more generic curve type.
|
||||
E.g. QgsLineString -> QgsCompoundCurve, QgsPolygonV2 -> QgsCurvePolygon,
|
||||
QgsMultiLineString -> QgsMultiCurve, QgsMultiPolygonV2 -> QgsMultiSurface
|
||||
E.g. QgsLineString -> QgsCompoundCurve, QgsPolygon -> QgsCurvePolygon,
|
||||
QgsMultiLineString -> QgsMultiCurve, QgsMultiPolygon -> QgsMultiSurface
|
||||
:return: the converted geometry. Caller takes ownership
|
||||
:rtype: QgsAbstractGeometry
|
||||
%End
|
||||
|
@ -61,7 +61,7 @@ class QgsCurvePolygon: QgsSurface
|
||||
|
||||
virtual double perimeter() const;
|
||||
|
||||
virtual QgsPolygonV2 *surfaceToPolygon() const /Factory/;
|
||||
virtual QgsPolygon *surfaceToPolygon() const /Factory/;
|
||||
|
||||
virtual QgsAbstractGeometry *boundary() const /Factory/;
|
||||
|
||||
@ -81,13 +81,13 @@ class QgsCurvePolygon: QgsSurface
|
||||
:rtype: QgsCurve
|
||||
%End
|
||||
|
||||
virtual QgsPolygonV2 *toPolygon( double tolerance = M_PI_2 / 90, SegmentationToleranceType toleranceType = MaximumAngle ) const /Factory/;
|
||||
virtual QgsPolygon *toPolygon( double tolerance = M_PI_2 / 90, SegmentationToleranceType toleranceType = MaximumAngle ) const /Factory/;
|
||||
%Docstring
|
||||
Returns a new polygon geometry corresponding to a segmentized approximation
|
||||
of the curve.
|
||||
\param tolerance segmentation tolerance
|
||||
\param toleranceType maximum segmentation angle or maximum difference between approximation and curve*
|
||||
:rtype: QgsPolygonV2
|
||||
:rtype: QgsPolygon
|
||||
%End
|
||||
|
||||
virtual void setExteriorRing( QgsCurve *ring /Transfer/ );
|
||||
|
@ -202,11 +202,11 @@ The circumference of the ellipse using first approximation of Ramanujan.
|
||||
:rtype: QgsPointSequence
|
||||
%End
|
||||
|
||||
virtual QgsPolygonV2 *toPolygon( unsigned int segments = 36 ) const /Factory/;
|
||||
virtual QgsPolygon *toPolygon( unsigned int segments = 36 ) const /Factory/;
|
||||
%Docstring
|
||||
Returns a segmented polygon.
|
||||
\param segments Number of segments used to segment geometry.
|
||||
:rtype: QgsPolygonV2
|
||||
:rtype: QgsPolygon
|
||||
%End
|
||||
|
||||
virtual QgsLineString *toLineString( unsigned int segments = 36 ) const /Factory/;
|
||||
@ -216,10 +216,10 @@ The circumference of the ellipse using first approximation of Ramanujan.
|
||||
:rtype: QgsLineString
|
||||
%End
|
||||
|
||||
virtual QgsPolygonV2 *orientedBoundingBox() const /Factory/;
|
||||
virtual QgsPolygon *orientedBoundingBox() const /Factory/;
|
||||
%Docstring
|
||||
Returns the oriented minimal bounding box for the ellipse.
|
||||
:rtype: QgsPolygonV2
|
||||
:rtype: QgsPolygon
|
||||
%End
|
||||
|
||||
virtual QgsRectangle boundingBox() const;
|
||||
|
@ -19,13 +19,13 @@ typedef QVector<QgsPointXY> QgsPolylineXY;
|
||||
|
||||
typedef QVector<QgsPoint> QgsPolyline;
|
||||
|
||||
typedef QVector<QVector<QgsPointXY>> QgsPolygon;
|
||||
typedef QVector<QVector<QgsPointXY>> QgsPolygonXY;
|
||||
|
||||
typedef QVector<QgsPointXY> QgsMultiPoint;
|
||||
typedef QVector<QgsPointXY> QgsMultiPointXY;
|
||||
|
||||
typedef QVector<QVector<QgsPointXY>> QgsMultiPolyline;
|
||||
typedef QVector<QVector<QgsPointXY>> QgsMultiPolylineXY;
|
||||
|
||||
typedef QVector<QVector<QVector<QgsPointXY>>> QgsMultiPolygon;
|
||||
typedef QVector<QVector<QVector<QgsPointXY>>> QgsMultiPolygonXY;
|
||||
|
||||
|
||||
|
||||
@ -145,14 +145,14 @@ Copy constructor will prompt a deep copy of the object
|
||||
Creates a new geometry from a WKT string
|
||||
:rtype: QgsGeometry
|
||||
%End
|
||||
static QgsGeometry fromPoint( const QgsPointXY &point );
|
||||
static QgsGeometry fromPointXY( const QgsPointXY &point );
|
||||
%Docstring
|
||||
Creates a new geometry from a QgsPointXY object
|
||||
:rtype: QgsGeometry
|
||||
%End
|
||||
static QgsGeometry fromMultiPoint( const QgsMultiPoint &multipoint );
|
||||
static QgsGeometry fromMultiPointXY( const QgsMultiPointXY &multipoint );
|
||||
%Docstring
|
||||
Creates a new geometry from a QgsMultiPoint object
|
||||
Creates a new geometry from a QgsMultiPointXY object
|
||||
:rtype: QgsGeometry
|
||||
%End
|
||||
|
||||
@ -184,17 +184,17 @@ Creates a new geometry from a QgsMultiPoint object
|
||||
:rtype: QgsGeometry
|
||||
%End
|
||||
|
||||
static QgsGeometry fromMultiPolyline( const QgsMultiPolyline &multiline );
|
||||
static QgsGeometry fromMultiPolylineXY( const QgsMultiPolylineXY &multiline );
|
||||
%Docstring
|
||||
Creates a new geometry from a QgsMultiPolyline object
|
||||
Creates a new geometry from a QgsMultiPolylineXY object
|
||||
:rtype: QgsGeometry
|
||||
%End
|
||||
static QgsGeometry fromPolygon( const QgsPolygon &polygon );
|
||||
static QgsGeometry fromPolygonXY( const QgsPolygonXY &polygon );
|
||||
%Docstring
|
||||
Creates a new geometry from a QgsPolygon
|
||||
:rtype: QgsGeometry
|
||||
%End
|
||||
static QgsGeometry fromMultiPolygon( const QgsMultiPolygon &multipoly );
|
||||
static QgsGeometry fromMultiPolygonXY( const QgsMultiPolygonXY &multipoly );
|
||||
%Docstring
|
||||
Creates a new geometry from a QgsMultiPolygon
|
||||
:rtype: QgsGeometry
|
||||
@ -519,7 +519,7 @@ Returns true if WKB of the geometry is of WKBMulti* type
|
||||
:rtype: OperationResult
|
||||
%End
|
||||
|
||||
OperationResult addPart( const QList<QgsPointXY> &points, QgsWkbTypes::GeometryType geomType = QgsWkbTypes::UnknownGeometry ) /PyName=addPoints/;
|
||||
OperationResult addPart( const QList<QgsPointXY> &points, QgsWkbTypes::GeometryType geomType = QgsWkbTypes::UnknownGeometry ) /PyName=addPointsXY/;
|
||||
%Docstring
|
||||
Adds a new part to a the geometry.
|
||||
\param points points describing part to add
|
||||
@ -528,7 +528,7 @@ Returns true if WKB of the geometry is of WKBMulti* type
|
||||
:rtype: OperationResult
|
||||
%End
|
||||
|
||||
OperationResult addPart( const QgsPointSequence &points, QgsWkbTypes::GeometryType geomType = QgsWkbTypes::UnknownGeometry ) /PyName=addPointsV2/;
|
||||
OperationResult addPart( const QgsPointSequence &points, QgsWkbTypes::GeometryType geomType = QgsWkbTypes::UnknownGeometry ) /PyName=addPoints/;
|
||||
%Docstring
|
||||
Adds a new part to a the geometry.
|
||||
\param points points describing part to add
|
||||
@ -1144,32 +1144,32 @@ Returns an extruded version of this geometry.
|
||||
:rtype: QgsPolylineXY
|
||||
%End
|
||||
|
||||
QgsPolygon asPolygon() const;
|
||||
QgsPolygonXY asPolygon() const;
|
||||
%Docstring
|
||||
Returns contents of the geometry as a polygon
|
||||
if wkbType is WKBPolygon, otherwise an empty list
|
||||
:rtype: QgsPolygon
|
||||
:rtype: QgsPolygonXY
|
||||
%End
|
||||
|
||||
QgsMultiPoint asMultiPoint() const;
|
||||
QgsMultiPointXY asMultiPoint() const;
|
||||
%Docstring
|
||||
Returns contents of the geometry as a multi point
|
||||
if wkbType is WKBMultiPoint, otherwise an empty list
|
||||
:rtype: QgsMultiPoint
|
||||
:rtype: QgsMultiPointXY
|
||||
%End
|
||||
|
||||
QgsMultiPolyline asMultiPolyline() const;
|
||||
QgsMultiPolylineXY asMultiPolyline() const;
|
||||
%Docstring
|
||||
Returns contents of the geometry as a multi linestring
|
||||
if wkbType is WKBMultiLineString, otherwise an empty list
|
||||
:rtype: QgsMultiPolyline
|
||||
:rtype: QgsMultiPolylineXY
|
||||
%End
|
||||
|
||||
QgsMultiPolygon asMultiPolygon() const;
|
||||
QgsMultiPolygonXY asMultiPolygon() const;
|
||||
%Docstring
|
||||
Returns contents of the geometry as a multi polygon
|
||||
if wkbType is WKBMultiPolygon, otherwise an empty list
|
||||
:rtype: QgsMultiPolygon
|
||||
:rtype: QgsMultiPolygonXY
|
||||
%End
|
||||
|
||||
QList<QgsGeometry> asGeometryCollection() const;
|
||||
@ -1430,20 +1430,20 @@ Returns an extruded version of this geometry.
|
||||
:rtype: QgsPolylineXY
|
||||
%End
|
||||
|
||||
static QgsPolygon createPolygonFromQPolygonF( const QPolygonF &polygon ) /Factory/;
|
||||
static QgsPolygonXY createPolygonFromQPolygonF( const QPolygonF &polygon ) /Factory/;
|
||||
%Docstring
|
||||
Creates a QgsPolygon from a QPolygonF.
|
||||
Creates a QgsPolygonXYfrom a QPolygonF.
|
||||
\param polygon source polygon
|
||||
:return: QgsPolygon
|
||||
.. seealso:: createPolylineFromQPolygonF
|
||||
:rtype: QgsPolygon
|
||||
:rtype: QgsPolygonXY
|
||||
%End
|
||||
|
||||
|
||||
static bool compare( PyObject *obj1, PyObject *obj2, double epsilon = 4 * DBL_EPSILON );
|
||||
%Docstring
|
||||
Compares two geometry objects for equality within a specified tolerance.
|
||||
The objects can be of type QgsPolylineXY, QgsPolygon or QgsMultiPolygon.
|
||||
The objects can be of type QgsPolylineXY, QgsPolygonXYor QgsMultiPolygon.
|
||||
The 2 types should match.
|
||||
\param p1 first geometry object
|
||||
\param p2 second geometry object
|
||||
@ -1507,10 +1507,10 @@ Returns an extruded version of this geometry.
|
||||
sipCanConvertToType( a0, sipType_QVector_0600QVector_0100QgsPointXY, SIP_NOT_NONE ) &&
|
||||
sipCanConvertToType( a1, sipType_QVector_0600QVector_0100QgsPointXY, SIP_NOT_NONE ) )
|
||||
{
|
||||
QgsPolygon *p0;
|
||||
QgsPolygon *p1;
|
||||
p0 = reinterpret_cast<QgsPolygon *>( sipConvertToType( a0, sipType_QVector_0600QVector_0100QgsPointXY, 0, SIP_NOT_NONE, &state0, &sipIsErr ) );
|
||||
p1 = reinterpret_cast<QgsPolygon *>( sipConvertToType( a1, sipType_QVector_0600QVector_0100QgsPointXY, 0, SIP_NOT_NONE, &state1, &sipIsErr ) );
|
||||
QgsPolygonXY *p0;
|
||||
QgsPolygonXY *p1;
|
||||
p0 = reinterpret_cast<QgsPolygonXY *>( sipConvertToType( a0, sipType_QVector_0600QVector_0100QgsPointXY, 0, SIP_NOT_NONE, &state0, &sipIsErr ) );
|
||||
p1 = reinterpret_cast<QgsPolygonXY *>( sipConvertToType( a1, sipType_QVector_0600QVector_0100QgsPointXY, 0, SIP_NOT_NONE, &state1, &sipIsErr ) );
|
||||
if ( sipIsErr )
|
||||
{
|
||||
sipReleaseType( p0, sipType_QVector_0600QVector_0100QgsPointXY, state0 );
|
||||
@ -1534,10 +1534,10 @@ Returns an extruded version of this geometry.
|
||||
sipCanConvertToType( a0, sipType_QVector_0600QVector_0600QVector_0100QgsPointXY, SIP_NOT_NONE ) &&
|
||||
sipCanConvertToType( a1, sipType_QVector_0600QVector_0600QVector_0100QgsPointXY, SIP_NOT_NONE ) )
|
||||
{
|
||||
QgsMultiPolygon *p0;
|
||||
QgsMultiPolygon *p1;
|
||||
p0 = reinterpret_cast<QgsMultiPolygon *>( sipConvertToType( a0, sipType_QVector_0600QVector_0600QVector_0100QgsPointXY, 0, SIP_NOT_NONE, &state0, &sipIsErr ) );
|
||||
p1 = reinterpret_cast<QgsMultiPolygon *>( sipConvertToType( a1, sipType_QVector_0600QVector_0600QVector_0100QgsPointXY, 0, SIP_NOT_NONE, &state1, &sipIsErr ) );
|
||||
QgsMultiPolygonXY *p0;
|
||||
QgsMultiPolygonXY *p1;
|
||||
p0 = reinterpret_cast<QgsMultiPolygonXY *>( sipConvertToType( a0, sipType_QVector_0600QVector_0600QVector_0100QgsPointXY, 0, SIP_NOT_NONE, &state0, &sipIsErr ) );
|
||||
p1 = reinterpret_cast<QgsMultiPolygonXY *>( sipConvertToType( a1, sipType_QVector_0600QVector_0600QVector_0100QgsPointXY, 0, SIP_NOT_NONE, &state1, &sipIsErr ) );
|
||||
if ( sipIsErr )
|
||||
{
|
||||
sipReleaseType( p0, sipType_QVector_0600QVector_0600QVector_0100QgsPointXY, state0 );
|
||||
@ -1581,16 +1581,16 @@ Returns an extruded version of this geometry.
|
||||
|
||||
static void convertPointList( const QList<QgsPointXY> &input, QgsPointSequence &output );
|
||||
%Docstring
|
||||
Upgrades a point list from QgsPointXY to QgsPointV2
|
||||
Upgrades a point list from QgsPointXY to QgsPoint
|
||||
\param input list of QgsPointXY objects to be upgraded
|
||||
\param output destination for list of points converted to QgsPointV2
|
||||
\param output destination for list of points converted to QgsPoint
|
||||
%End
|
||||
|
||||
static void convertPointList( const QgsPointSequence &input, QList<QgsPointXY> &output );
|
||||
%Docstring
|
||||
Downgrades a point list from QgsPoint to QgsPoint
|
||||
Downgrades a point list from QgsPoint to QgsPointXY
|
||||
\param input list of QgsPoint objects to be downgraded
|
||||
\param output destination for list of points converted to QgsPoint
|
||||
\param output destination for list of points converted to QgsPointXY
|
||||
%End
|
||||
|
||||
operator QVariant() const;
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
|
||||
|
||||
class QgsMultiPointV2: QgsGeometryCollection
|
||||
class QgsMultiPoint: QgsGeometryCollection
|
||||
{
|
||||
%Docstring
|
||||
Multi point geometry collection.
|
||||
@ -19,13 +19,13 @@ class QgsMultiPointV2: QgsGeometryCollection
|
||||
#include "qgsmultipoint.h"
|
||||
%End
|
||||
public:
|
||||
QgsMultiPointV2();
|
||||
QgsMultiPoint();
|
||||
|
||||
virtual QString geometryType() const;
|
||||
|
||||
virtual QgsMultiPointV2 *clone() const /Factory/;
|
||||
virtual QgsMultiPoint *clone() const /Factory/;
|
||||
|
||||
virtual QgsMultiPointV2 *toCurveType() const /Factory/;
|
||||
virtual QgsMultiPoint *toCurveType() const /Factory/;
|
||||
|
||||
virtual bool fromWkt( const QString &wkt );
|
||||
|
||||
@ -50,7 +50,7 @@ class QgsMultiPointV2: QgsGeometryCollection
|
||||
|
||||
|
||||
protected:
|
||||
virtual QgsMultiPointV2 *createEmptyWithSameType() const /Factory/;
|
||||
virtual QgsMultiPoint *createEmptyWithSameType() const /Factory/;
|
||||
|
||||
virtual bool wktOmitChildType() const;
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
|
||||
|
||||
class QgsMultiPolygonV2: QgsMultiSurface
|
||||
class QgsMultiPolygon: QgsMultiSurface
|
||||
{
|
||||
%Docstring
|
||||
Multi polygon geometry collection.
|
||||
@ -19,12 +19,12 @@ class QgsMultiPolygonV2: QgsMultiSurface
|
||||
#include "qgsmultipolygon.h"
|
||||
%End
|
||||
public:
|
||||
QgsMultiPolygonV2();
|
||||
QgsMultiPolygon();
|
||||
virtual QString geometryType() const;
|
||||
|
||||
virtual void clear();
|
||||
|
||||
virtual QgsMultiPolygonV2 *clone() const /Factory/;
|
||||
virtual QgsMultiPolygon *clone() const /Factory/;
|
||||
|
||||
virtual bool fromWkt( const QString &wkt );
|
||||
|
||||
@ -51,7 +51,7 @@ class QgsMultiPolygonV2: QgsMultiSurface
|
||||
|
||||
|
||||
protected:
|
||||
virtual QgsMultiPolygonV2 *createEmptyWithSameType() const /Factory/;
|
||||
virtual QgsMultiPolygon *createEmptyWithSameType() const /Factory/;
|
||||
|
||||
virtual bool wktOmitChildType() const;
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
|
||||
|
||||
class QgsPolygonV2: QgsCurvePolygon
|
||||
class QgsPolygon: QgsCurvePolygon
|
||||
{
|
||||
%Docstring
|
||||
Polygon geometry type.
|
||||
@ -20,11 +20,11 @@ class QgsPolygonV2: QgsCurvePolygon
|
||||
#include "qgspolygon.h"
|
||||
%End
|
||||
public:
|
||||
QgsPolygonV2();
|
||||
QgsPolygon();
|
||||
|
||||
virtual QString geometryType() const;
|
||||
|
||||
virtual QgsPolygonV2 *clone() const /Factory/;
|
||||
virtual QgsPolygon *clone() const /Factory/;
|
||||
|
||||
virtual void clear();
|
||||
|
||||
@ -32,7 +32,7 @@ class QgsPolygonV2: QgsCurvePolygon
|
||||
|
||||
virtual QByteArray asWkb() const;
|
||||
|
||||
virtual QgsPolygonV2 *surfaceToPolygon() const /Factory/;
|
||||
virtual QgsPolygon *surfaceToPolygon() const /Factory/;
|
||||
|
||||
|
||||
virtual QgsCurvePolygon *toCurveType() const /Factory/;
|
||||
@ -63,7 +63,7 @@ class QgsPolygonV2: QgsCurvePolygon
|
||||
|
||||
protected:
|
||||
|
||||
virtual QgsPolygonV2 *createEmptyWithSameType() const /Factory/;
|
||||
virtual QgsPolygon *createEmptyWithSameType() const /Factory/;
|
||||
|
||||
|
||||
|
||||
|
@ -145,10 +145,10 @@ A regular polygon is empty if radius equal to 0 or number of sides < 3
|
||||
:rtype: QgsPointSequence
|
||||
%End
|
||||
|
||||
QgsPolygonV2 *toPolygon() const /Factory/;
|
||||
QgsPolygon *toPolygon() const /Factory/;
|
||||
%Docstring
|
||||
Returns as a polygon.
|
||||
:rtype: QgsPolygonV2
|
||||
:rtype: QgsPolygon
|
||||
%End
|
||||
|
||||
QgsLineString *toLineString() const /Factory/;
|
||||
|
@ -18,11 +18,11 @@ class QgsSurface: QgsAbstractGeometry
|
||||
%End
|
||||
public:
|
||||
|
||||
virtual QgsPolygonV2 *surfaceToPolygon() const = 0 /Factory/;
|
||||
virtual QgsPolygon *surfaceToPolygon() const = 0 /Factory/;
|
||||
%Docstring
|
||||
Get a polygon representation of this surface.
|
||||
Ownership is transferred to the caller.
|
||||
:rtype: QgsPolygonV2
|
||||
:rtype: QgsPolygon
|
||||
%End
|
||||
|
||||
virtual QgsRectangle boundingBox() const;
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
|
||||
|
||||
class QgsTriangle : QgsPolygonV2
|
||||
class QgsTriangle : QgsPolygon
|
||||
{
|
||||
%Docstring
|
||||
Triangle geometry type.
|
||||
@ -68,7 +68,7 @@ class QgsTriangle : QgsPolygonV2
|
||||
virtual QDomElement asGML3( QDomDocument &doc, int precision = 17, const QString &ns = "gml" ) const;
|
||||
|
||||
|
||||
virtual QgsPolygonV2 *surfaceToPolygon() const /Factory/;
|
||||
virtual QgsPolygon *surfaceToPolygon() const /Factory/;
|
||||
|
||||
|
||||
virtual QgsCurvePolygon *toCurveType() const /Factory/;
|
||||
|
@ -11,69 +11,6 @@
|
||||
|
||||
|
||||
|
||||
class QgsSvgCacheEntry
|
||||
{
|
||||
|
||||
%TypeHeaderCode
|
||||
#include "qgssvgcache.h"
|
||||
%End
|
||||
public:
|
||||
|
||||
QgsSvgCacheEntry();
|
||||
|
||||
QgsSvgCacheEntry( const QString &path, double size, double strokeWidth, double widthScaleFactor, const QColor &fill, const QColor &stroke,
|
||||
double fixedAspectRatio = 0 ) ;
|
||||
%Docstring
|
||||
Constructor.
|
||||
\param path Absolute path to SVG file (relative paths are not resolved).
|
||||
\param size
|
||||
\param strokeWidth width of stroke
|
||||
\param widthScaleFactor width scale factor
|
||||
\param fill color of fill
|
||||
\param stroke color of stroke
|
||||
\param fixedAspectRatio fixed aspect ratio (optional)
|
||||
%End
|
||||
~QgsSvgCacheEntry();
|
||||
|
||||
|
||||
QString path;
|
||||
%Docstring
|
||||
Absolute path to SVG file
|
||||
%End
|
||||
double size;
|
||||
double strokeWidth;
|
||||
double widthScaleFactor;
|
||||
|
||||
double fixedAspectRatio;
|
||||
%Docstring
|
||||
Fixed aspect ratio
|
||||
%End
|
||||
|
||||
QSizeF viewboxSize;
|
||||
%Docstring
|
||||
SVG viewbox size.
|
||||
.. versionadded:: 2.14
|
||||
%End
|
||||
|
||||
QColor fill;
|
||||
QColor stroke;
|
||||
QImage *image;
|
||||
QPicture *picture;
|
||||
QByteArray svgContent;
|
||||
|
||||
QgsSvgCacheEntry *nextEntry;
|
||||
QgsSvgCacheEntry *previousEntry;
|
||||
|
||||
bool operator==( const QgsSvgCacheEntry &other ) const;
|
||||
int dataSize() const;
|
||||
%Docstring
|
||||
Return memory usage in bytes
|
||||
:rtype: int
|
||||
%End
|
||||
|
||||
private:
|
||||
QgsSvgCacheEntry( const QgsSvgCacheEntry &rh );
|
||||
};
|
||||
|
||||
class QgsSvgCache : QObject
|
||||
{
|
||||
@ -200,39 +137,6 @@ Get SVG content
|
||||
Emit a signal to be caught by qgisapp and display a msg on status bar
|
||||
%End
|
||||
|
||||
protected:
|
||||
|
||||
QgsSvgCacheEntry *insertSvg( const QString &path, double size, const QColor &fill, const QColor &stroke, double strokeWidth,
|
||||
double widthScaleFactor, double fixedAspectRatio = 0 );
|
||||
%Docstring
|
||||
Creates new cache entry and returns pointer to it
|
||||
\param path Absolute path to SVG file
|
||||
\param size size of cached image
|
||||
\param fill color of fill
|
||||
\param stroke color of stroke
|
||||
\param strokeWidth width of stroke
|
||||
\param widthScaleFactor width scale factor
|
||||
\param fixedAspectRatio fixed aspect ratio (optional)
|
||||
:rtype: QgsSvgCacheEntry
|
||||
%End
|
||||
|
||||
void replaceParamsAndCacheSvg( QgsSvgCacheEntry *entry );
|
||||
void cacheImage( QgsSvgCacheEntry *entry );
|
||||
void cachePicture( QgsSvgCacheEntry *entry, bool forceVectorOutput = false );
|
||||
QgsSvgCacheEntry *cacheEntry( const QString &path, double size, const QColor &fill, const QColor &stroke, double strokeWidth,
|
||||
double widthScaleFactor, double fixedAspectRatio = 0 );
|
||||
%Docstring
|
||||
Returns entry from cache or creates a new entry if it does not exist already
|
||||
:rtype: QgsSvgCacheEntry
|
||||
%End
|
||||
|
||||
void trimToMaximumSize();
|
||||
%Docstring
|
||||
Removes the least used items until the maximum size is under the limit
|
||||
%End
|
||||
|
||||
void takeEntryFromList( QgsSvgCacheEntry *entry );
|
||||
|
||||
};
|
||||
|
||||
/************************************************************************
|
||||
|
@ -342,9 +342,9 @@ Generate symbol as image
|
||||
:rtype: QPolygonF
|
||||
%End
|
||||
|
||||
static void _getPolygon( QPolygonF &pts, QList<QPolygonF> &holes, QgsRenderContext &context, const QgsPolygonV2 &polygon, bool clipToExtent = true );
|
||||
static void _getPolygon( QPolygonF &pts, QList<QPolygonF> &holes, QgsRenderContext &context, const QgsPolygon &polygon, bool clipToExtent = true );
|
||||
%Docstring
|
||||
Creates a polygon in screen coordinates from a QgsPolygon in map coordinates
|
||||
Creates a polygon in screen coordinates from a QgsPolygonXYin map coordinates
|
||||
%End
|
||||
|
||||
QgsSymbolLayerList cloneLayers() const /Factory/;
|
||||
|
@ -1,18 +0,0 @@
|
||||
DB Manager
|
||||
==========
|
||||
|
||||
Copyright (c) 2011 Giuseppe Sucameli
|
||||
|
||||
DB Manager is a database manager core plugin for QGIS.
|
||||
It allows showing the database contents and running queries on them.
|
||||
|
||||
At the moment DB Manager supports the following DBMS backends:
|
||||
|
||||
- PostgreSQL/PostGIS through the psycopg2 pymodule
|
||||
- SQLite/SpatiaLite using the pyspatialite pymodule
|
||||
- GeoPackage
|
||||
- Oracle Spatial using PyQt QtSql module
|
||||
|
||||
For more info about the project see the [QGIS
|
||||
Documentation](http://docs.qgis.org/testing/en/docs/user_manual/plugins/plugins_db_manager.html)
|
||||
or the [GSoC 2011 wiki page](http://qgis.org/wiki/DB_Manager_plugin_GSoC_2011).
|
@ -152,7 +152,7 @@ class CheckValidity(QgisAlgorithm):
|
||||
reasons = []
|
||||
for error in errors:
|
||||
errFeat = QgsFeature()
|
||||
error_geom = QgsGeometry.fromPoint(error.where())
|
||||
error_geom = QgsGeometry.fromPointXY(error.where())
|
||||
errFeat.setGeometry(error_geom)
|
||||
errFeat.setAttributes([error.what()])
|
||||
if error_output_sink:
|
||||
|
@ -148,7 +148,7 @@ class Delaunay(QgisAlgorithm):
|
||||
attrs.append(ids[index])
|
||||
step += 1
|
||||
feat.setAttributes(attrs)
|
||||
geometry = QgsGeometry().fromPolygon([polygon])
|
||||
geometry = QgsGeometry().fromPolygonXY([polygon])
|
||||
feat.setGeometry(geometry)
|
||||
sink.addFeature(feat, QgsFeatureSink.FastInsert)
|
||||
feedback.setProgress(int(current * total))
|
||||
|
@ -27,10 +27,10 @@ __revision__ = '$Format:%H$'
|
||||
|
||||
from qgis.core import (QgsFeature,
|
||||
QgsGeometry,
|
||||
QgsMultiPointV2,
|
||||
QgsMultiPoint,
|
||||
QgsMultiLineString,
|
||||
QgsLineString,
|
||||
QgsPolygonV2,
|
||||
QgsPolygon,
|
||||
QgsFeatureSink,
|
||||
QgsWkbTypes,
|
||||
QgsProcessingException,
|
||||
@ -148,7 +148,7 @@ class GeometryConvert(QgisAlgorithm):
|
||||
return [geom.centroid()]
|
||||
|
||||
def convertToNodes(self, geom):
|
||||
mp = QgsMultiPointV2()
|
||||
mp = QgsMultiPoint()
|
||||
# TODO: mega inefficient - needs rework when geometry iterators land
|
||||
# (but at least it doesn't lose Z/M values)
|
||||
for g in geom.constGet().coordinateSequence():
|
||||
@ -206,14 +206,14 @@ class GeometryConvert(QgisAlgorithm):
|
||||
points.append(p)
|
||||
linestring = QgsLineString(points)
|
||||
linestring.close()
|
||||
p = QgsPolygonV2()
|
||||
p = QgsPolygon()
|
||||
p.setExteriorRing(linestring)
|
||||
return [QgsGeometry(p)]
|
||||
elif QgsWkbTypes.geometryType(geom.wkbType()) == QgsWkbTypes.LineGeometry:
|
||||
if QgsWkbTypes.isMultiType(geom):
|
||||
parts = []
|
||||
for i in range(geom.constGet().numGeometries()):
|
||||
p = QgsPolygonV2()
|
||||
p = QgsPolygon()
|
||||
linestring = geom.constGet().geometryN(i).clone()
|
||||
linestring.close()
|
||||
p.setExteriorRing(linestring)
|
||||
@ -221,7 +221,7 @@ class GeometryConvert(QgisAlgorithm):
|
||||
return QgsGeometry.collectGeometry(parts)
|
||||
else:
|
||||
# linestring to polygon
|
||||
p = QgsPolygonV2()
|
||||
p = QgsPolygon()
|
||||
linestring = geom.constGet().clone()
|
||||
linestring.close()
|
||||
p.setExteriorRing(linestring)
|
||||
|
@ -190,7 +190,7 @@ class GridPolygon(QgisAlgorithm):
|
||||
polyline.append(QgsPointXY(x1, y2))
|
||||
polyline.append(QgsPointXY(x1, y1))
|
||||
|
||||
ft.setGeometry(QgsGeometry.fromPolygon([polyline]))
|
||||
ft.setGeometry(QgsGeometry.fromPolygonXY([polyline]))
|
||||
ft.setAttributes([x1, y1, x2, y2, id])
|
||||
sink.addFeature(ft, QgsFeatureSink.FastInsert)
|
||||
|
||||
@ -245,7 +245,7 @@ class GridPolygon(QgisAlgorithm):
|
||||
polyline.append(QgsPointXY(x2, y3))
|
||||
polyline.append(QgsPointXY(x1, y2))
|
||||
|
||||
ft.setGeometry(QgsGeometry.fromPolygon([polyline]))
|
||||
ft.setGeometry(QgsGeometry.fromPolygonXY([polyline]))
|
||||
ft.setAttributes([x1, y1, x3, y3, id])
|
||||
sink.addFeature(ft, QgsFeatureSink.FastInsert)
|
||||
id += 1
|
||||
@ -312,7 +312,7 @@ class GridPolygon(QgisAlgorithm):
|
||||
polyline.append(QgsPointXY(x2, y3))
|
||||
polyline.append(QgsPointXY(x1, y2))
|
||||
|
||||
ft.setGeometry(QgsGeometry.fromPolygon([polyline]))
|
||||
ft.setGeometry(QgsGeometry.fromPolygonXY([polyline]))
|
||||
ft.setAttributes([x1, y1, x4, y3, id])
|
||||
sink.addFeature(ft, QgsFeatureSink.FastInsert)
|
||||
id += 1
|
||||
|
@ -144,7 +144,7 @@ class HubDistancePoints(QgisAlgorithm):
|
||||
feat = QgsFeature()
|
||||
feat.setAttributes(attributes)
|
||||
|
||||
feat.setGeometry(QgsGeometry.fromPoint(src))
|
||||
feat.setGeometry(QgsGeometry.fromPointXY(src))
|
||||
|
||||
sink.addFeature(feat, QgsFeatureSink.FastInsert)
|
||||
feedback.setProgress(int(current * total))
|
||||
|
@ -32,8 +32,8 @@ from qgis.PyQt.QtGui import QIcon
|
||||
from qgis.core import (QgsFeature,
|
||||
QgsGeometry,
|
||||
QgsGeometryCollection,
|
||||
QgsPolygonV2,
|
||||
QgsMultiPolygonV2,
|
||||
QgsPolygon,
|
||||
QgsMultiPolygon,
|
||||
QgsMultiSurface,
|
||||
QgsWkbTypes,
|
||||
QgsFeatureSink,
|
||||
@ -105,7 +105,7 @@ class LinesToPolygons(QgisFeatureBasedAlgorithm):
|
||||
output_wkb = self.convertWkbToPolygons(geometry.wkbType())
|
||||
out_geom = None
|
||||
if QgsWkbTypes.flatType(output_wkb) == QgsWkbTypes.MultiPolygon:
|
||||
out_geom = QgsMultiPolygonV2()
|
||||
out_geom = QgsMultiPolygon()
|
||||
else:
|
||||
out_geom = QgsMultiSurface()
|
||||
|
||||
@ -123,7 +123,7 @@ class LinesToPolygons(QgisFeatureBasedAlgorithm):
|
||||
else:
|
||||
# not collection
|
||||
if geometry.vertexCount() > 2:
|
||||
surface = QgsPolygonV2()
|
||||
surface = QgsPolygon()
|
||||
surface.setExteriorRing(geometry.clone())
|
||||
surfaces.append(surface)
|
||||
|
||||
|
@ -46,7 +46,7 @@ from qgis.core import (QgsField,
|
||||
QgsProcessing,
|
||||
QgsFeature,
|
||||
QgsVertexId,
|
||||
QgsMultiPointV2)
|
||||
QgsMultiPoint)
|
||||
|
||||
from processing.algs.qgis.QgisAlgorithm import QgisAlgorithm
|
||||
|
||||
@ -228,7 +228,7 @@ class MinimumBoundingGeometry(QgisAlgorithm):
|
||||
if class_field is not None:
|
||||
attrs.append(class_field)
|
||||
|
||||
multi_point = QgsMultiPointV2()
|
||||
multi_point = QgsMultiPoint()
|
||||
|
||||
for g in geometries:
|
||||
if feedback.isCanceled():
|
||||
|
@ -192,7 +192,7 @@ class PointsFromLines(QgisAlgorithm):
|
||||
def createPoint(self, pX, pY, geoTransform, writer, feature):
|
||||
(x, y) = raster.pixelToMap(pX, pY, geoTransform)
|
||||
|
||||
feature.setGeometry(QgsGeometry.fromPoint(QgsPointXY(x, y)))
|
||||
feature.setGeometry(QgsGeometry.fromPointXY(QgsPointXY(x, y)))
|
||||
feature['id'] = self.fid
|
||||
feature['line_id'] = self.lineId
|
||||
feature['point_id'] = self.pointId
|
||||
|
@ -148,7 +148,7 @@ class RandomPointsAlongLines(QgisAlgorithm):
|
||||
|
||||
# generate random point
|
||||
p = QgsPointXY(rx, ry)
|
||||
geom = QgsGeometry.fromPoint(p)
|
||||
geom = QgsGeometry.fromPointXY(p)
|
||||
if vector.checkMinDistance(p, index, minDistance, points):
|
||||
f = QgsFeature(nPoints)
|
||||
f.initAttributes(1)
|
||||
|
@ -125,7 +125,7 @@ class RandomPointsExtent(QgisAlgorithm):
|
||||
ry = bbox.yMinimum() + bbox.height() * random.random()
|
||||
|
||||
p = QgsPointXY(rx, ry)
|
||||
geom = QgsGeometry.fromPoint(p)
|
||||
geom = QgsGeometry.fromPointXY(p)
|
||||
if geom.within(extent) and \
|
||||
vector.checkMinDistance(p, index, minDistance, points):
|
||||
f = QgsFeature(nPoints)
|
||||
|
@ -122,7 +122,7 @@ class RandomPointsLayer(QgisAlgorithm):
|
||||
ry = bbox.yMinimum() + bbox.height() * random.random()
|
||||
|
||||
p = QgsPointXY(rx, ry)
|
||||
geom = QgsGeometry.fromPoint(p)
|
||||
geom = QgsGeometry.fromPointXY(p)
|
||||
ids = sourceIndex.intersects(geom.buffer(5, 5).boundingBox())
|
||||
if len(ids) > 0 and \
|
||||
vector.checkMinDistance(p, index, minDistance, points):
|
||||
|
@ -168,7 +168,7 @@ class RandomPointsPolygons(QgisAlgorithm):
|
||||
ry = bbox.yMinimum() + bbox.height() * random.random()
|
||||
|
||||
p = QgsPointXY(rx, ry)
|
||||
geom = QgsGeometry.fromPoint(p)
|
||||
geom = QgsGeometry.fromPointXY(p)
|
||||
if geom.within(fGeom) and \
|
||||
vector.checkMinDistance(p, index, minDistance, points):
|
||||
f = QgsFeature(nPoints)
|
||||
|
@ -134,7 +134,7 @@ class RectanglesOvalsDiamondsFixed(QgisAlgorithm):
|
||||
polygon = [[QgsPointXY(i[0] * math.cos(phi) + i[1] * math.sin(phi) + x,
|
||||
-i[0] * math.sin(phi) + i[1] * math.cos(phi) + y) for i in points]]
|
||||
|
||||
ft.setGeometry(QgsGeometry.fromPolygon(polygon))
|
||||
ft.setGeometry(QgsGeometry.fromPolygonXY(polygon))
|
||||
ft.setAttributes(feat.attributes())
|
||||
sink.addFeature(ft, QgsFeatureSink.FastInsert)
|
||||
|
||||
@ -153,7 +153,7 @@ class RectanglesOvalsDiamondsFixed(QgisAlgorithm):
|
||||
points = [(-xOffset, -yOffset), (-xOffset, yOffset), (xOffset, yOffset), (xOffset, -yOffset)]
|
||||
polygon = [[QgsPointXY(i[0] + x, i[1] + y) for i in points]]
|
||||
|
||||
ft.setGeometry(QgsGeometry.fromPolygon(polygon))
|
||||
ft.setGeometry(QgsGeometry.fromPolygonXY(polygon))
|
||||
ft.setAttributes(feat.attributes())
|
||||
sink.addFeature(ft, QgsFeatureSink.FastInsert)
|
||||
|
||||
@ -183,7 +183,7 @@ class RectanglesOvalsDiamondsFixed(QgisAlgorithm):
|
||||
polygon = [[QgsPointXY(i[0] * math.cos(phi) + i[1] * math.sin(phi) + x,
|
||||
-i[0] * math.sin(phi) + i[1] * math.cos(phi) + y) for i in points]]
|
||||
|
||||
ft.setGeometry(QgsGeometry.fromPolygon(polygon))
|
||||
ft.setGeometry(QgsGeometry.fromPolygonXY(polygon))
|
||||
ft.setAttributes(feat.attributes())
|
||||
sink.addFeature(ft, QgsFeatureSink.FastInsert)
|
||||
feedback.setProgress(int(current * total))
|
||||
@ -201,7 +201,7 @@ class RectanglesOvalsDiamondsFixed(QgisAlgorithm):
|
||||
points = [(0.0, -yOffset), (-xOffset, 0.0), (0.0, yOffset), (xOffset, 0.0)]
|
||||
polygon = [[QgsPointXY(i[0] + x, i[1] + y) for i in points]]
|
||||
|
||||
ft.setGeometry(QgsGeometry.fromPolygon(polygon))
|
||||
ft.setGeometry(QgsGeometry.fromPolygonXY(polygon))
|
||||
ft.setAttributes(feat.attributes())
|
||||
sink.addFeature(ft, QgsFeatureSink.FastInsert)
|
||||
feedback.setProgress(int(current * total))
|
||||
@ -232,7 +232,7 @@ class RectanglesOvalsDiamondsFixed(QgisAlgorithm):
|
||||
polygon = [[QgsPointXY(i[0] * math.cos(phi) + i[1] * math.sin(phi) + x,
|
||||
-i[0] * math.sin(phi) + i[1] * math.cos(phi) + y) for i in points]]
|
||||
|
||||
ft.setGeometry(QgsGeometry.fromPolygon(polygon))
|
||||
ft.setGeometry(QgsGeometry.fromPolygonXY(polygon))
|
||||
ft.setAttributes(feat.attributes())
|
||||
sink.addFeature(ft, QgsFeatureSink.FastInsert)
|
||||
feedback.setProgress(int(current * total))
|
||||
@ -252,7 +252,7 @@ class RectanglesOvalsDiamondsFixed(QgisAlgorithm):
|
||||
points.append((xOffset * math.cos(t), yOffset * math.sin(t)))
|
||||
polygon = [[QgsPointXY(i[0] + x, i[1] + y) for i in points]]
|
||||
|
||||
ft.setGeometry(QgsGeometry.fromPolygon(polygon))
|
||||
ft.setGeometry(QgsGeometry.fromPolygonXY(polygon))
|
||||
ft.setAttributes(feat.attributes())
|
||||
sink.addFeature(ft, QgsFeatureSink.FastInsert)
|
||||
feedback.setProgress(int(current * total))
|
||||
|
@ -156,7 +156,7 @@ class RectanglesOvalsDiamondsVariable(QgisAlgorithm):
|
||||
polygon = [[QgsPointXY(i[0] * math.cos(phi) + i[1] * math.sin(phi) + x,
|
||||
-i[0] * math.sin(phi) + i[1] * math.cos(phi) + y) for i in points]]
|
||||
|
||||
ft.setGeometry(QgsGeometry.fromPolygon(polygon))
|
||||
ft.setGeometry(QgsGeometry.fromPolygonXY(polygon))
|
||||
ft.setAttributes(feat.attributes())
|
||||
sink.addFeature(ft, QgsFeatureSink.FastInsert)
|
||||
|
||||
@ -186,7 +186,7 @@ class RectanglesOvalsDiamondsVariable(QgisAlgorithm):
|
||||
points = [(-xOffset, -yOffset), (-xOffset, yOffset), (xOffset, yOffset), (xOffset, -yOffset)]
|
||||
polygon = [[QgsPointXY(i[0] + x, i[1] + y) for i in points]]
|
||||
|
||||
ft.setGeometry(QgsGeometry.fromPolygon(polygon))
|
||||
ft.setGeometry(QgsGeometry.fromPolygonXY(polygon))
|
||||
ft.setAttributes(feat.attributes())
|
||||
sink.addFeature(ft, QgsFeatureSink.FastInsert)
|
||||
|
||||
@ -225,7 +225,7 @@ class RectanglesOvalsDiamondsVariable(QgisAlgorithm):
|
||||
polygon = [[QgsPointXY(i[0] * math.cos(phi) + i[1] * math.sin(phi) + x,
|
||||
-i[0] * math.sin(phi) + i[1] * math.cos(phi) + y) for i in points]]
|
||||
|
||||
ft.setGeometry(QgsGeometry.fromPolygon(polygon))
|
||||
ft.setGeometry(QgsGeometry.fromPolygonXY(polygon))
|
||||
ft.setAttributes(feat.attributes())
|
||||
sink.addFeature(ft, QgsFeatureSink.FastInsert)
|
||||
feedback.setProgress(int(current * total))
|
||||
@ -254,7 +254,7 @@ class RectanglesOvalsDiamondsVariable(QgisAlgorithm):
|
||||
points = [(0.0, -yOffset), (-xOffset, 0.0), (0.0, yOffset), (xOffset, 0.0)]
|
||||
polygon = [[QgsPointXY(i[0] + x, i[1] + y) for i in points]]
|
||||
|
||||
ft.setGeometry(QgsGeometry.fromPolygon(polygon))
|
||||
ft.setGeometry(QgsGeometry.fromPolygonXY(polygon))
|
||||
ft.setAttributes(feat.attributes())
|
||||
sink.addFeature(ft, QgsFeatureSink.FastInsert)
|
||||
feedback.setProgress(int(current * total))
|
||||
@ -294,7 +294,7 @@ class RectanglesOvalsDiamondsVariable(QgisAlgorithm):
|
||||
polygon = [[QgsPointXY(i[0] * math.cos(phi) + i[1] * math.sin(phi) + x,
|
||||
-i[0] * math.sin(phi) + i[1] * math.cos(phi) + y) for i in points]]
|
||||
|
||||
ft.setGeometry(QgsGeometry.fromPolygon(polygon))
|
||||
ft.setGeometry(QgsGeometry.fromPolygonXY(polygon))
|
||||
ft.setAttributes(feat.attributes())
|
||||
sink.addFeature(ft, QgsFeatureSink.FastInsert)
|
||||
feedback.setProgress(int(current * total))
|
||||
@ -325,7 +325,7 @@ class RectanglesOvalsDiamondsVariable(QgisAlgorithm):
|
||||
points.append((xOffset * math.cos(t), yOffset * math.sin(t)))
|
||||
polygon = [[QgsPointXY(i[0] + x, i[1] + y) for i in points]]
|
||||
|
||||
ft.setGeometry(QgsGeometry.fromPolygon(polygon))
|
||||
ft.setGeometry(QgsGeometry.fromPolygonXY(polygon))
|
||||
ft.setAttributes(feat.attributes())
|
||||
sink.addFeature(ft, QgsFeatureSink.FastInsert)
|
||||
feedback.setProgress(int(current * total))
|
||||
|
@ -134,11 +134,11 @@ class RegularPoints(QgisAlgorithm):
|
||||
break
|
||||
|
||||
if randomize:
|
||||
geom = QgsGeometry().fromPoint(QgsPointXY(
|
||||
geom = QgsGeometry().fromPointXY(QgsPointXY(
|
||||
uniform(x - (pSpacing / 2.0), x + (pSpacing / 2.0)),
|
||||
uniform(y - (pSpacing / 2.0), y + (pSpacing / 2.0))))
|
||||
else:
|
||||
geom = QgsGeometry().fromPoint(QgsPointXY(x, y))
|
||||
geom = QgsGeometry().fromPointXY(QgsPointXY(x, y))
|
||||
|
||||
if extent_engine.intersects(geom.constGet()):
|
||||
f.setAttribute('id', count)
|
||||
|
@ -38,6 +38,7 @@ from qgis.core import (QgsWkbTypes,
|
||||
QgsFeatureRequest,
|
||||
QgsGeometry,
|
||||
QgsFields,
|
||||
QgsPointXY,
|
||||
QgsField,
|
||||
QgsProcessing,
|
||||
QgsProcessingParameterEnum,
|
||||
@ -88,8 +89,8 @@ class ServiceAreaFromLayer(QgisAlgorithm):
|
||||
def initAlgorithm(self, config=None):
|
||||
self.DIRECTIONS = OrderedDict([
|
||||
(self.tr('Forward direction'), QgsVectorLayerDirector.DirectionForward),
|
||||
(self.tr('Backward direction'), QgsVectorLayerDirector.DirectionForward),
|
||||
(self.tr('Both directions'), QgsVectorLayerDirector.DirectionForward)])
|
||||
(self.tr('Backward direction'), QgsVectorLayerDirector.DirectionBackward),
|
||||
(self.tr('Both directions'), QgsVectorLayerDirector.DirectionBoth)])
|
||||
|
||||
self.STRATEGIES = [self.tr('Shortest'),
|
||||
self.tr('Fastest')
|
||||
@ -172,7 +173,7 @@ class ServiceAreaFromLayer(QgisAlgorithm):
|
||||
defaultSpeed = self.parameterAsDouble(parameters, self.DEFAULT_SPEED, context)
|
||||
tolerance = self.parameterAsDouble(parameters, self.TOLERANCE, context)
|
||||
|
||||
fields = QgsFields()
|
||||
fields = startPoints.fields()
|
||||
fields.append(QgsField('type', QVariant.String, '', 254, 0))
|
||||
fields.append(QgsField('start', QVariant.String, '', 254, 0))
|
||||
|
||||
@ -209,17 +210,25 @@ class ServiceAreaFromLayer(QgisAlgorithm):
|
||||
|
||||
feedback.pushInfo(self.tr('Loading start points...'))
|
||||
request = QgsFeatureRequest()
|
||||
request.setFlags(request.flags() ^ QgsFeatureRequest.SubsetOfAttributes)
|
||||
request.setDestinationCrs(network.sourceCrs())
|
||||
features = startPoints.getFeatures(request)
|
||||
total = 100.0 / startPoints.featureCount() if startPoints.featureCount() else 0
|
||||
|
||||
points = []
|
||||
source_attributes = {}
|
||||
i = 0
|
||||
for current, f in enumerate(features):
|
||||
if feedback.isCanceled():
|
||||
break
|
||||
|
||||
points.append(f.geometry().asPoint())
|
||||
if not f.hasGeometry():
|
||||
continue
|
||||
|
||||
for p in f.geometry().vertices():
|
||||
points.append(QgsPointXY(p))
|
||||
source_attributes[i] = f.attributes()
|
||||
i += 1
|
||||
|
||||
feedback.setProgress(int(current * total))
|
||||
|
||||
feedback.pushInfo(self.tr('Building graph...'))
|
||||
@ -245,25 +254,27 @@ class ServiceAreaFromLayer(QgisAlgorithm):
|
||||
tree, cost = QgsGraphAnalyzer.dijkstra(graph, idxStart, 0)
|
||||
for j, v in enumerate(cost):
|
||||
if v > travelCost and tree[j] != -1:
|
||||
vertexId = graph.edge(tree[j]).outVertex()
|
||||
vertexId = graph.edge(tree[j]).fromVertex()
|
||||
if cost[vertexId] <= travelCost:
|
||||
vertices.append(j)
|
||||
|
||||
for j in vertices:
|
||||
upperBoundary.append(graph.vertex(graph.edge(tree[j]).inVertex()).point())
|
||||
lowerBoundary.append(graph.vertex(graph.edge(tree[j]).outVertex()).point())
|
||||
upperBoundary.append(graph.vertex(graph.edge(tree[j]).toVertex()).point())
|
||||
lowerBoundary.append(graph.vertex(graph.edge(tree[j]).fromVertex()).point())
|
||||
|
||||
geomUpper = QgsGeometry.fromMultiPoint(upperBoundary)
|
||||
geomLower = QgsGeometry.fromMultiPoint(lowerBoundary)
|
||||
geomUpper = QgsGeometry.fromMultiPointXY(upperBoundary)
|
||||
geomLower = QgsGeometry.fromMultiPointXY(lowerBoundary)
|
||||
|
||||
feat.setGeometry(geomUpper)
|
||||
feat['type'] = 'upper'
|
||||
feat['start'] = origPoint
|
||||
|
||||
attrs = source_attributes[i]
|
||||
attrs.extend(['upper', origPoint])
|
||||
feat.setAttributes(attrs)
|
||||
sink.addFeature(feat, QgsFeatureSink.FastInsert)
|
||||
|
||||
feat.setGeometry(geomLower)
|
||||
feat['type'] = 'lower'
|
||||
feat['start'] = origPoint
|
||||
attrs[-2] = 'lower'
|
||||
feat.setAttributes(attrs)
|
||||
sink.addFeature(feat, QgsFeatureSink.FastInsert)
|
||||
|
||||
vertices[:] = []
|
||||
|
@ -87,8 +87,8 @@ class ServiceAreaFromPoint(QgisAlgorithm):
|
||||
def initAlgorithm(self, config=None):
|
||||
self.DIRECTIONS = OrderedDict([
|
||||
(self.tr('Forward direction'), QgsVectorLayerDirector.DirectionForward),
|
||||
(self.tr('Backward direction'), QgsVectorLayerDirector.DirectionForward),
|
||||
(self.tr('Both directions'), QgsVectorLayerDirector.DirectionForward)])
|
||||
(self.tr('Backward direction'), QgsVectorLayerDirector.DirectionBackward),
|
||||
(self.tr('Both directions'), QgsVectorLayerDirector.DirectionBoth)])
|
||||
|
||||
self.STRATEGIES = [self.tr('Shortest'),
|
||||
self.tr('Fastest')
|
||||
@ -208,15 +208,15 @@ class ServiceAreaFromPoint(QgisAlgorithm):
|
||||
vertices = []
|
||||
for i, v in enumerate(cost):
|
||||
if v > travelCost and tree[i] != -1:
|
||||
vertexId = graph.edge(tree[i]).outVertex()
|
||||
vertexId = graph.edge(tree[i]).fromVertex()
|
||||
if cost[vertexId] <= travelCost:
|
||||
vertices.append(i)
|
||||
|
||||
upperBoundary = []
|
||||
lowerBoundary = []
|
||||
for i in vertices:
|
||||
upperBoundary.append(graph.vertex(graph.edge(tree[i]).inVertex()).point())
|
||||
lowerBoundary.append(graph.vertex(graph.edge(tree[i]).outVertex()).point())
|
||||
upperBoundary.append(graph.vertex(graph.edge(tree[i]).toVertex()).point())
|
||||
lowerBoundary.append(graph.vertex(graph.edge(tree[i]).fromVertex()).point())
|
||||
|
||||
feedback.pushInfo(self.tr('Writing results...'))
|
||||
|
||||
@ -227,8 +227,8 @@ class ServiceAreaFromPoint(QgisAlgorithm):
|
||||
feat = QgsFeature()
|
||||
feat.setFields(fields)
|
||||
|
||||
geomUpper = QgsGeometry.fromMultiPoint(upperBoundary)
|
||||
geomLower = QgsGeometry.fromMultiPoint(lowerBoundary)
|
||||
geomUpper = QgsGeometry.fromMultiPointXY(upperBoundary)
|
||||
geomLower = QgsGeometry.fromMultiPointXY(lowerBoundary)
|
||||
|
||||
(sink, dest_id) = self.parameterAsSink(parameters, self.OUTPUT, context,
|
||||
fields, QgsWkbTypes.MultiPoint, network.sourceCrs())
|
||||
@ -245,7 +245,7 @@ class ServiceAreaFromPoint(QgisAlgorithm):
|
||||
|
||||
upperBoundary.append(startPoint)
|
||||
lowerBoundary.append(startPoint)
|
||||
geomUpper = QgsGeometry.fromMultiPoint(upperBoundary)
|
||||
geomLower = QgsGeometry.fromMultiPoint(lowerBoundary)
|
||||
geomUpper = QgsGeometry.fromMultiPointXY(upperBoundary)
|
||||
geomLower = QgsGeometry.fromMultiPointXY(lowerBoundary)
|
||||
|
||||
return {self.OUTPUT: dest_id}
|
||||
|
@ -37,9 +37,8 @@ from qgis.core import (QgsWkbTypes,
|
||||
QgsFeatureRequest,
|
||||
QgsFeatureSink,
|
||||
QgsGeometry,
|
||||
QgsFields,
|
||||
QgsField,
|
||||
QgsMessageLog,
|
||||
QgsPointXY,
|
||||
QgsProcessing,
|
||||
QgsProcessingParameterEnum,
|
||||
QgsProcessingParameterPoint,
|
||||
@ -89,8 +88,8 @@ class ShortestPathLayerToPoint(QgisAlgorithm):
|
||||
def initAlgorithm(self, config=None):
|
||||
self.DIRECTIONS = OrderedDict([
|
||||
(self.tr('Forward direction'), QgsVectorLayerDirector.DirectionForward),
|
||||
(self.tr('Backward direction'), QgsVectorLayerDirector.DirectionForward),
|
||||
(self.tr('Both directions'), QgsVectorLayerDirector.DirectionForward)])
|
||||
(self.tr('Backward direction'), QgsVectorLayerDirector.DirectionBackward),
|
||||
(self.tr('Both directions'), QgsVectorLayerDirector.DirectionBoth)])
|
||||
|
||||
self.STRATEGIES = [self.tr('Shortest'),
|
||||
self.tr('Fastest')
|
||||
@ -171,7 +170,7 @@ class ShortestPathLayerToPoint(QgisAlgorithm):
|
||||
defaultSpeed = self.parameterAsDouble(parameters, self.DEFAULT_SPEED, context)
|
||||
tolerance = self.parameterAsDouble(parameters, self.TOLERANCE, context)
|
||||
|
||||
fields = QgsFields()
|
||||
fields = startPoints.fields()
|
||||
fields.append(QgsField('start', QVariant.String, '', 254, 0))
|
||||
fields.append(QgsField('end', QVariant.String, '', 254, 0))
|
||||
fields.append(QgsField('cost', QVariant.Double, '', 20, 7))
|
||||
@ -213,17 +212,25 @@ class ShortestPathLayerToPoint(QgisAlgorithm):
|
||||
|
||||
feedback.pushInfo(self.tr('Loading start points...'))
|
||||
request = QgsFeatureRequest()
|
||||
request.setFlags(request.flags() ^ QgsFeatureRequest.SubsetOfAttributes)
|
||||
request.setDestinationCrs(network.sourceCrs())
|
||||
features = startPoints.getFeatures(request)
|
||||
total = 100.0 / startPoints.featureCount() if startPoints.featureCount() else 0
|
||||
|
||||
points = [endPoint]
|
||||
source_attributes = {}
|
||||
i = 1
|
||||
for current, f in enumerate(features):
|
||||
if feedback.isCanceled():
|
||||
break
|
||||
|
||||
points.append(f.geometry().asPoint())
|
||||
if not f.hasGeometry():
|
||||
continue
|
||||
|
||||
for p in f.geometry().vertices():
|
||||
points.append(QgsPointXY(p))
|
||||
source_attributes[i] = f.attributes()
|
||||
i += 1
|
||||
|
||||
feedback.setProgress(int(current * total))
|
||||
|
||||
feedback.pushInfo(self.tr('Building graph...'))
|
||||
@ -233,42 +240,44 @@ class ShortestPathLayerToPoint(QgisAlgorithm):
|
||||
graph = builder.graph()
|
||||
|
||||
idxEnd = graph.findVertex(snappedPoints[0])
|
||||
route = []
|
||||
|
||||
nPoints = len(snappedPoints)
|
||||
total = 100.0 / nPoints if nPoints else 1
|
||||
for i in range(1, nPoints + 1):
|
||||
for i in range(1, nPoints):
|
||||
if feedback.isCanceled():
|
||||
break
|
||||
|
||||
idxStart = graph.findVertex(snappedPoints[i])
|
||||
tree, cost = QgsGraphAnalyzer.dijkstra(graph, idxStart, 0)
|
||||
|
||||
tree, costs = QgsGraphAnalyzer.dijkstra(graph, idxStart, 0)
|
||||
|
||||
if tree[idxEnd] == -1:
|
||||
msg = self.tr('There is no route from start point ({}) to end point ({}).'.format(points[i].toString(), endPoint.toString()))
|
||||
feedback.setProgressText(msg)
|
||||
QgsMessageLog.logMessage(msg, self.tr('Processing'), QgsMessageLog.WARNING)
|
||||
feedback.reportError(msg)
|
||||
# add feature with no geometry
|
||||
feat.clearGeometry()
|
||||
attrs = source_attributes[i]
|
||||
attrs.append(points[i].toString())
|
||||
feat.setAttributes(attrs)
|
||||
sink.addFeature(feat, QgsFeatureSink.FastInsert)
|
||||
continue
|
||||
|
||||
cost = 0.0
|
||||
route = [graph.vertex(idxEnd).point()]
|
||||
cost = costs[idxEnd]
|
||||
current = idxEnd
|
||||
while current != idxStart:
|
||||
cost += graph.edge(tree[current]).cost(0)
|
||||
route.append(graph.vertex(graph.edge(tree[current]).inVertex()).point())
|
||||
current = graph.edge(tree[current]).outVertex()
|
||||
current = graph.edge(tree[current]).fromVertex()
|
||||
route.append(graph.vertex(current).point())
|
||||
|
||||
route.append(snappedPoints[i])
|
||||
route.reverse()
|
||||
|
||||
geom = QgsGeometry.fromPolylineXY(route)
|
||||
feat.setGeometry(geom)
|
||||
feat['start'] = points[i].toString()
|
||||
feat['end'] = endPoint.toString()
|
||||
feat['cost'] = cost / multiplier
|
||||
attrs = source_attributes[i]
|
||||
attrs.extend([points[i].toString(), endPoint.toString(), cost / multiplier])
|
||||
feat.setAttributes(attrs)
|
||||
sink.addFeature(feat, QgsFeatureSink.FastInsert)
|
||||
|
||||
route[:] = []
|
||||
|
||||
feedback.setProgress(int(i * total))
|
||||
|
||||
return {self.OUTPUT: dest_id}
|
||||
|
@ -31,15 +31,15 @@ from collections import OrderedDict
|
||||
from qgis.PyQt.QtCore import QVariant
|
||||
from qgis.PyQt.QtGui import QIcon
|
||||
|
||||
from qgis.core import (QgsWkbTypes,
|
||||
from qgis.core import (NULL,
|
||||
QgsWkbTypes,
|
||||
QgsUnitTypes,
|
||||
QgsFeature,
|
||||
QgsFeatureSink,
|
||||
QgsGeometry,
|
||||
QgsFeatureRequest,
|
||||
QgsFields,
|
||||
QgsField,
|
||||
QgsMessageLog,
|
||||
QgsPointXY,
|
||||
QgsProcessing,
|
||||
QgsProcessingParameterEnum,
|
||||
QgsProcessingParameterPoint,
|
||||
@ -89,8 +89,8 @@ class ShortestPathPointToLayer(QgisAlgorithm):
|
||||
def initAlgorithm(self, config=None):
|
||||
self.DIRECTIONS = OrderedDict([
|
||||
(self.tr('Forward direction'), QgsVectorLayerDirector.DirectionForward),
|
||||
(self.tr('Backward direction'), QgsVectorLayerDirector.DirectionForward),
|
||||
(self.tr('Both directions'), QgsVectorLayerDirector.DirectionForward)])
|
||||
(self.tr('Backward direction'), QgsVectorLayerDirector.DirectionBackward),
|
||||
(self.tr('Both directions'), QgsVectorLayerDirector.DirectionBoth)])
|
||||
|
||||
self.STRATEGIES = [self.tr('Shortest'),
|
||||
self.tr('Fastest')
|
||||
@ -171,7 +171,7 @@ class ShortestPathPointToLayer(QgisAlgorithm):
|
||||
defaultSpeed = self.parameterAsDouble(parameters, self.DEFAULT_SPEED, context)
|
||||
tolerance = self.parameterAsDouble(parameters, self.TOLERANCE, context)
|
||||
|
||||
fields = QgsFields()
|
||||
fields = endPoints.fields()
|
||||
fields.append(QgsField('start', QVariant.String, '', 254, 0))
|
||||
fields.append(QgsField('end', QVariant.String, '', 254, 0))
|
||||
fields.append(QgsField('cost', QVariant.Double, '', 20, 7))
|
||||
@ -213,17 +213,25 @@ class ShortestPathPointToLayer(QgisAlgorithm):
|
||||
|
||||
feedback.pushInfo(self.tr('Loading end points...'))
|
||||
request = QgsFeatureRequest()
|
||||
request.setFlags(request.flags() ^ QgsFeatureRequest.SubsetOfAttributes)
|
||||
request.setDestinationCrs(network.sourceCrs())
|
||||
features = endPoints.getFeatures(request)
|
||||
total = 100.0 / endPoints.featureCount() if endPoints.featureCount() else 0
|
||||
|
||||
points = [startPoint]
|
||||
source_attributes = {}
|
||||
i = 1
|
||||
for current, f in enumerate(features):
|
||||
if feedback.isCanceled():
|
||||
break
|
||||
|
||||
points.append(f.geometry().asPoint())
|
||||
if not f.hasGeometry():
|
||||
continue
|
||||
|
||||
for p in f.geometry().vertices():
|
||||
points.append(QgsPointXY(p))
|
||||
source_attributes[i] = f.attributes()
|
||||
i += 1
|
||||
|
||||
feedback.setProgress(int(current * total))
|
||||
|
||||
feedback.pushInfo(self.tr('Building graph...'))
|
||||
@ -233,12 +241,11 @@ class ShortestPathPointToLayer(QgisAlgorithm):
|
||||
graph = builder.graph()
|
||||
|
||||
idxStart = graph.findVertex(snappedPoints[0])
|
||||
tree, cost = QgsGraphAnalyzer.dijkstra(graph, idxStart, 0)
|
||||
route = []
|
||||
tree, costs = QgsGraphAnalyzer.dijkstra(graph, idxStart, 0)
|
||||
|
||||
nPoints = len(snappedPoints)
|
||||
total = 100.0 / nPoints if nPoints else 1
|
||||
for i in range(1, nPoints + 1):
|
||||
for i in range(1, nPoints):
|
||||
if feedback.isCanceled():
|
||||
break
|
||||
|
||||
@ -246,29 +253,31 @@ class ShortestPathPointToLayer(QgisAlgorithm):
|
||||
|
||||
if tree[idxEnd] == -1:
|
||||
msg = self.tr('There is no route from start point ({}) to end point ({}).'.format(startPoint.toString(), points[i].toString()))
|
||||
feedback.setProgressText(msg)
|
||||
QgsMessageLog.logMessage(msg, self.tr('Processing'), QgsMessageLog.WARNING)
|
||||
feedback.reportError(msg)
|
||||
# add feature with no geometry
|
||||
feat.clearGeometry()
|
||||
attrs = source_attributes[i]
|
||||
attrs.extend([NULL, points[i].toString()])
|
||||
feat.setAttributes(attrs)
|
||||
sink.addFeature(feat, QgsFeatureSink.FastInsert)
|
||||
continue
|
||||
|
||||
cost = 0.0
|
||||
route = [graph.vertex(idxEnd).point()]
|
||||
cost = costs[idxEnd]
|
||||
current = idxEnd
|
||||
while current != idxStart:
|
||||
cost += graph.edge(tree[current]).cost(0)
|
||||
route.append(graph.vertex(graph.edge(tree[current]).inVertex()).point())
|
||||
current = graph.edge(tree[current]).outVertex()
|
||||
current = graph.edge(tree[current]).fromVertex()
|
||||
route.append(graph.vertex(current).point())
|
||||
|
||||
route.append(snappedPoints[0])
|
||||
route.reverse()
|
||||
|
||||
geom = QgsGeometry.fromPolylineXY(route)
|
||||
attrs = source_attributes[i]
|
||||
attrs.extend([startPoint.toString(), points[i].toString(), cost / multiplier])
|
||||
feat.setAttributes(attrs)
|
||||
feat.setGeometry(geom)
|
||||
feat['start'] = startPoint.toString()
|
||||
feat['end'] = points[i].toString()
|
||||
feat['cost'] = cost / multiplier
|
||||
sink.addFeature(feat, QgsFeatureSink.FastInsert)
|
||||
|
||||
route[:] = []
|
||||
|
||||
feedback.setProgress(int(i * total))
|
||||
|
||||
return {self.OUTPUT: dest_id}
|
||||
|
@ -90,8 +90,8 @@ class ShortestPathPointToPoint(QgisAlgorithm):
|
||||
def initAlgorithm(self, config=None):
|
||||
self.DIRECTIONS = OrderedDict([
|
||||
(self.tr('Forward direction'), QgsVectorLayerDirector.DirectionForward),
|
||||
(self.tr('Backward direction'), QgsVectorLayerDirector.DirectionForward),
|
||||
(self.tr('Both directions'), QgsVectorLayerDirector.DirectionForward)])
|
||||
(self.tr('Backward direction'), QgsVectorLayerDirector.DirectionBackward),
|
||||
(self.tr('Both directions'), QgsVectorLayerDirector.DirectionBoth)])
|
||||
|
||||
self.STRATEGIES = [self.tr('Shortest'),
|
||||
self.tr('Fastest')
|
||||
@ -217,20 +217,18 @@ class ShortestPathPointToPoint(QgisAlgorithm):
|
||||
idxStart = graph.findVertex(snappedPoints[0])
|
||||
idxEnd = graph.findVertex(snappedPoints[1])
|
||||
|
||||
tree, cost = QgsGraphAnalyzer.dijkstra(graph, idxStart, 0)
|
||||
tree, costs = QgsGraphAnalyzer.dijkstra(graph, idxStart, 0)
|
||||
if tree[idxEnd] == -1:
|
||||
raise QgsProcessingException(
|
||||
self.tr('There is no route from start point to end point.'))
|
||||
|
||||
route = []
|
||||
cost = 0.0
|
||||
route = [graph.vertex(idxEnd).point()]
|
||||
cost = costs[idxEnd]
|
||||
current = idxEnd
|
||||
while current != idxStart:
|
||||
cost += graph.edge(tree[current]).cost(0)
|
||||
route.append(graph.vertex(graph.edge(tree[current]).inVertex()).point())
|
||||
current = graph.edge(tree[current]).outVertex()
|
||||
current = graph.edge(tree[current]).fromVertex()
|
||||
route.append(graph.vertex(current).point())
|
||||
|
||||
route.append(snappedPoints[0])
|
||||
route.reverse()
|
||||
|
||||
feedback.pushInfo(self.tr('Writing results...'))
|
||||
|
@ -135,7 +135,7 @@ class VoronoiPolygons(QgisAlgorithm):
|
||||
inFeat = next(source.getFeatures(request))
|
||||
lines = self.clip_voronoi(edges, c, width, height, extent, extraX, extraY)
|
||||
|
||||
geom = QgsGeometry.fromMultiPoint(lines)
|
||||
geom = QgsGeometry.fromMultiPointXY(lines)
|
||||
geom = QgsGeometry(geom.convexHull())
|
||||
outFeat.setGeometry(geom)
|
||||
outFeat.setAttributes(inFeat.attributes())
|
||||
|
@ -39,7 +39,7 @@ for n, feat in enumerate(Polygons.getFeatures()):
|
||||
else:
|
||||
features.setGeometry(geom)
|
||||
geomres = [geoms[i].asPolygon() for i, a in geomarea[-1 * To_keep:]]
|
||||
features.setGeometry(QgsGeometry.fromMultiPolygon(geomres))
|
||||
features.setGeometry(QgsGeometry.fromMultiPolygonXY(geomres))
|
||||
sink.addFeature(features)
|
||||
else:
|
||||
sink.addFeature(feat)
|
||||
|
37
python/plugins/processing/tests/testdata/custom/route_points.gml
vendored
Normal file
37
python/plugins/processing/tests/testdata/custom/route_points.gml
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ogr:FeatureCollection
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://ogr.maptools.org/ route_points.xsd"
|
||||
xmlns:ogr="http://ogr.maptools.org/"
|
||||
xmlns:gml="http://www.opengis.net/gml">
|
||||
<gml:boundedBy>
|
||||
<gml:Box>
|
||||
<gml:coord><gml:X>20.4273694007118</gml:X><gml:Y>-34.03714867571521</gml:Y></gml:coord>
|
||||
<gml:coord><gml:X>20.45438438930011</gml:X><gml:Y>-34.01428003760926</gml:Y></gml:coord>
|
||||
</gml:Box>
|
||||
</gml:boundedBy>
|
||||
|
||||
<gml:featureMember>
|
||||
<ogr:route_points fid="route_points.0">
|
||||
<ogr:geometryProperty><gml:MultiPoint srsName="EPSG:4326"><gml:pointMember><gml:Point><gml:coordinates>20.4273694007118,-34.0371486757152</gml:coordinates></gml:Point></gml:pointMember></gml:MultiPoint></ogr:geometryProperty>
|
||||
<ogr:d>1</ogr:d>
|
||||
</ogr:route_points>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:route_points fid="route_points.1">
|
||||
<ogr:geometryProperty><gml:MultiPoint srsName="EPSG:4326"><gml:pointMember><gml:Point><gml:coordinates>20.4366264365433,-34.0289935170312</gml:coordinates></gml:Point></gml:pointMember></gml:MultiPoint></ogr:geometryProperty>
|
||||
<ogr:d>2</ogr:d>
|
||||
</ogr:route_points>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:route_points fid="route_points.2">
|
||||
<ogr:geometryProperty><gml:MultiPoint srsName="EPSG:4326"><gml:pointMember><gml:Point><gml:coordinates>20.4440686605369,-34.0142800376093</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>20.4543843893001,-34.0209124105391</gml:coordinates></gml:Point></gml:pointMember></gml:MultiPoint></ogr:geometryProperty>
|
||||
<ogr:d>3</ogr:d>
|
||||
</ogr:route_points>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:route_points fid="route_points.3">
|
||||
<ogr:d>4</ogr:d>
|
||||
</ogr:route_points>
|
||||
</gml:featureMember>
|
||||
</ogr:FeatureCollection>
|
30
python/plugins/processing/tests/testdata/custom/route_points.xsd
vendored
Normal file
30
python/plugins/processing/tests/testdata/custom/route_points.xsd
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema targetNamespace="http://ogr.maptools.org/" xmlns:ogr="http://ogr.maptools.org/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml" elementFormDefault="qualified" version="1.0">
|
||||
<xs:import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/2.1.2/feature.xsd"/>
|
||||
<xs:element name="FeatureCollection" type="ogr:FeatureCollectionType" substitutionGroup="gml:_FeatureCollection"/>
|
||||
<xs:complexType name="FeatureCollectionType">
|
||||
<xs:complexContent>
|
||||
<xs:extension base="gml:AbstractFeatureCollectionType">
|
||||
<xs:attribute name="lockId" type="xs:string" use="optional"/>
|
||||
<xs:attribute name="scope" type="xs:string" use="optional"/>
|
||||
</xs:extension>
|
||||
</xs:complexContent>
|
||||
</xs:complexType>
|
||||
<xs:element name="route_points" type="ogr:route_points_Type" substitutionGroup="gml:_Feature"/>
|
||||
<xs:complexType name="route_points_Type">
|
||||
<xs:complexContent>
|
||||
<xs:extension base="gml:AbstractFeatureType">
|
||||
<xs:sequence>
|
||||
<xs:element name="geometryProperty" type="gml:MultiPointPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/>
|
||||
<xs:element name="d" nillable="true" minOccurs="0" maxOccurs="1">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:integer">
|
||||
<xs:totalDigits value="10"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:extension>
|
||||
</xs:complexContent>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
@ -13,14 +13,14 @@
|
||||
|
||||
<gml:featureMember>
|
||||
<ogr:service_area fid="service_area.0">
|
||||
<ogr:geometryProperty><gml:MultiPoint srsName="EPSG:32733"><gml:pointMember><gml:Point><gml:coordinates>1001843.08473263,6221828.62873543</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1001891.40736133,6221430.94581986</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1001940.09434754,6221707.78585671</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1001962.5674552,6222024.23591493</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002086.66939634,6222010.7240816</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002103.66905047,6221324.68154126</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002129.95849754,6222135.73878474</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002299.19357268,6222416.40706398</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002416.57059498,6221277.56159465</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002622.66996036,6221162.46807726</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002667.16458207,6221195.87188063</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002761.33635685,6222354.19324527</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002897.32222975,6222395.42838888</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002897.87933631,6221326.06027793</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1003028.1814962,6221611.96830289</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1003037.55521283,6222118.73863535</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1003040.80096358,6222322.18412711</gml:coordinates></gml:Point></gml:pointMember></gml:MultiPoint></ogr:geometryProperty>
|
||||
<ogr:geometryProperty><gml:MultiPoint srsName="EPSG:32733"><gml:pointMember><gml:Point><gml:coordinates>1001891.40736133,6221430.94581986</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1003040.80096358,6222322.18412711</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002622.66996036,6221162.46807726</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1001843.08473263,6221828.62873543</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002086.66939634,6222010.7240816</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1001940.09434754,6221707.78585671</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1001962.5674552,6222024.23591493</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002299.19357268,6222416.40706398</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002103.66905047,6221324.68154126</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002129.95849754,6222135.73878474</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002416.57059498,6221277.56159465</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002897.32222975,6222395.42838888</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002761.33635685,6222354.19324527</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002897.87933631,6221326.06027793</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1003037.55521283,6222118.73863535</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1003028.1814962,6221611.96830289</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002667.16458207,6221195.87188063</gml:coordinates></gml:Point></gml:pointMember></gml:MultiPoint></ogr:geometryProperty>
|
||||
<ogr:type>upper</ogr:type>
|
||||
<ogr:start>1002465.00896, 6221875.43249</ogr:start>
|
||||
</ogr:service_area>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:service_area fid="service_area.1">
|
||||
<ogr:geometryProperty><gml:MultiPoint srsName="EPSG:32733"><gml:pointMember><gml:Point><gml:coordinates>1002015.92985521,6221953.13030737</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1001930.78353526,6221467.36521594</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002045.66496862,6221837.84991727</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002015.92985521,6221953.13030737</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002125.77638469,6222042.5574598</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002275.1898604,6221455.19588041</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002161.08326842,6222058.23120113</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002382.21032908,6222317.66803566</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002275.1898604,6221455.19588041</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002310.58466849,6221563.42200322</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002845.50542017,6221400.90692838</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002724.17727046,6222326.95840711</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002991.11072264,6222281.72914386</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002845.50542017,6221400.90692838</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002657.33259138,6222018.20620536</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002945.17950103,6222241.31856099</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002991.11072264,6222281.72914386</gml:coordinates></gml:Point></gml:pointMember></gml:MultiPoint></ogr:geometryProperty>
|
||||
<ogr:geometryProperty><gml:MultiPoint srsName="EPSG:32733"><gml:pointMember><gml:Point><gml:coordinates>1001930.78353526,6221467.36521594</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002991.11072264,6222281.72914386</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002310.58466849,6221563.42200322</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002015.92985521,6221953.13030737</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002125.77638469,6222042.5574598</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002045.66496862,6221837.84991727</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002015.92985521,6221953.13030737</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002382.21032908,6222317.66803566</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002275.1898604,6221455.19588041</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002161.08326842,6222058.23120113</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002275.1898604,6221455.19588041</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002991.11072264,6222281.72914386</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002724.17727046,6222326.95840711</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002845.50542017,6221400.90692838</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002945.17950103,6222241.31856099</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002657.33259138,6222018.20620536</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>1002845.50542017,6221400.90692838</gml:coordinates></gml:Point></gml:pointMember></gml:MultiPoint></ogr:geometryProperty>
|
||||
<ogr:type>lower</ogr:type>
|
||||
<ogr:start>1002465.00896, 6221875.43249</ogr:start>
|
||||
</ogr:service_area>
|
||||
|
BIN
python/plugins/processing/tests/testdata/expected/service_area_from_layer.dbf
vendored
Normal file
BIN
python/plugins/processing/tests/testdata/expected/service_area_from_layer.dbf
vendored
Normal file
Binary file not shown.
1
python/plugins/processing/tests/testdata/expected/service_area_from_layer.prj
vendored
Normal file
1
python/plugins/processing/tests/testdata/expected/service_area_from_layer.prj
vendored
Normal file
@ -0,0 +1 @@
|
||||
PROJCS["WGS_1984_UTM_Zone_33S",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",15],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["Meter",1]]
|
1
python/plugins/processing/tests/testdata/expected/service_area_from_layer.qpj
vendored
Normal file
1
python/plugins/processing/tests/testdata/expected/service_area_from_layer.qpj
vendored
Normal file
@ -0,0 +1 @@
|
||||
PROJCS["WGS 84 / UTM zone 33S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",15],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","32733"]]
|
BIN
python/plugins/processing/tests/testdata/expected/service_area_from_layer.shp
vendored
Normal file
BIN
python/plugins/processing/tests/testdata/expected/service_area_from_layer.shp
vendored
Normal file
Binary file not shown.
BIN
python/plugins/processing/tests/testdata/expected/service_area_from_layer.shx
vendored
Normal file
BIN
python/plugins/processing/tests/testdata/expected/service_area_from_layer.shx
vendored
Normal file
Binary file not shown.
BIN
python/plugins/processing/tests/testdata/expected/shortest_path_layer_to_point.dbf
vendored
Normal file
BIN
python/plugins/processing/tests/testdata/expected/shortest_path_layer_to_point.dbf
vendored
Normal file
Binary file not shown.
50
python/plugins/processing/tests/testdata/expected/shortest_path_layer_to_point.gml
vendored
Normal file
50
python/plugins/processing/tests/testdata/expected/shortest_path_layer_to_point.gml
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ogr:FeatureCollection
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://ogr.maptools.org/ shortest_path_layer_to_point.xsd"
|
||||
xmlns:ogr="http://ogr.maptools.org/"
|
||||
xmlns:gml="http://www.opengis.net/gml">
|
||||
<gml:boundedBy>
|
||||
<gml:Box>
|
||||
<gml:coord><gml:X>1001186.34740161</gml:X><gml:Y>6220412.593725896</gml:Y></gml:coord>
|
||||
<gml:coord><gml:X>1004138.7211059</gml:X><gml:Y>6223142.049559583</gml:Y></gml:coord>
|
||||
</gml:Box>
|
||||
</gml:boundedBy>
|
||||
|
||||
<gml:featureMember>
|
||||
<ogr:shortest_path_layer_to_point fid="route_points.0">
|
||||
<ogr:geometryProperty><gml:LineString srsName="EPSG:32733"><gml:coordinates>1001269.29926109,6220412.5937259 1001186.34740161,6220459.66433954 1001230.60014311,6220497.58606688 1001417.00785562,6220703.65963346 1001474.56242038,6220771.95914347 1001535.25328051,6220851.26299517 1001730.88604383,6221182.3451556 1001806.08518826,6221307.13224234 1001821.61736105,6221332.90322892 1001835.96992268,6221356.72100035 1001891.40736133,6221430.94581986 1001930.78353526,6221467.36521594 1001968.37489204,6221502.13083684 1002137.81278244,6221630.62018051 1002215.13556068,6221689.25446887 1002288.4678461,6221744.85964495 1002334.20638747,6221779.49098284 1002425.63766482,6221848.74446543 1002462.62346654,6221875.38780442 1002518.06990805,6221915.34875741 1002626.85249869,6221993.7562202 1002657.33259138,6222018.20620536 1002781.74783802,6222107.45193255 1002852.18578258,6222162.74032983 1002903.48249244,6222204.64725757 1002916.58033846,6222216.16749784 1002945.17950103,6222241.31856099 1002991.11072264,6222281.72914386 1003040.80096358,6222322.18412711 1003081.26058941,6222355.11171034 1003105.74257399,6222376.7841218 1003153.88971381,6222419.41498029 1003172.94058079,6222436.28679202 1003198.63616199,6222463.1404267 1003261.7338751,6222520.86764589 1003285.57002497,6222541.37125149 1003318.51056419,6222558.84948158 1003416.77290022,6222570.20188393 1003430.63468333,6222565.77529146 1003461.44609399,6222555.86616133 1003536.86501513,6222502.0742548 1003555.31281829,6222483.13439712 1003602.8338769,6222436.67874613 1003647.3751082,6222401.82100567 1003696.4437017,6222455.04866221 1003745.10253898,6222507.54062578 1003852.72754463,6222623.65770678 1004026.21371718,6222810.84939244 1004138.7211059,6222934.89025765 1004027.57619058,6223045.89797913 1004078.05459543,6223104.58501454 1004113.27822798,6223142.04955958</gml:coordinates></gml:LineString></ogr:geometryProperty>
|
||||
<ogr:d>1</ogr:d>
|
||||
<ogr:start>1001269.16642, 6220412.35961</ogr:start>
|
||||
<ogr:end>1004113.23166, 6223142.09335</ogr:end>
|
||||
<ogr:cost>4509.5154628</ogr:cost>
|
||||
</ogr:shortest_path_layer_to_point>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:shortest_path_layer_to_point fid="route_points.1">
|
||||
<ogr:geometryProperty><gml:LineString srsName="EPSG:32733"><gml:coordinates>1002169.82194678,6221268.41390691 1002103.66905047,6221324.68154126 1002275.1898604,6221455.19588041 1002226.82368085,6221517.62843522 1002302.22841804,6221576.64258306 1002310.58466849,6221563.42200322 1002421.46534272,6221674.17571725 1002532.83636772,6221785.38136521 1002462.62346654,6221875.38780442 1002518.06990805,6221915.34875741 1002626.85249869,6221993.7562202 1002657.33259138,6222018.20620536 1002781.74783802,6222107.45193255 1002852.18578258,6222162.74032983 1002903.48249244,6222204.64725757 1002916.58033846,6222216.16749784 1002945.17950103,6222241.31856099 1002991.11072264,6222281.72914386 1003040.80096358,6222322.18412711 1003081.26058941,6222355.11171034 1003105.74257399,6222376.7841218 1003153.88971381,6222419.41498029 1003172.94058079,6222436.28679202 1003198.63616199,6222463.1404267 1003261.7338751,6222520.86764589 1003285.57002497,6222541.37125149 1003318.51056419,6222558.84948158 1003416.77290022,6222570.20188393 1003430.63468333,6222565.77529146 1003461.44609399,6222555.86616133 1003536.86501513,6222502.0742548 1003555.31281829,6222483.13439712 1003602.8338769,6222436.67874613 1003647.3751082,6222401.82100567 1003696.4437017,6222455.04866221 1003745.10253898,6222507.54062578 1003852.72754463,6222623.65770678 1004026.21371718,6222810.84939244 1004138.7211059,6222934.89025765 1004027.57619058,6223045.89797913 1004078.05459543,6223104.58501454 1004113.27822798,6223142.04955958</gml:coordinates></gml:LineString></ogr:geometryProperty>
|
||||
<ogr:d>2</ogr:d>
|
||||
<ogr:start>1002173.3505, 6221272.56237</ogr:start>
|
||||
<ogr:end>1004113.23166, 6223142.09335</ogr:end>
|
||||
<ogr:cost>3407.7806316</ogr:cost>
|
||||
</ogr:shortest_path_layer_to_point>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:shortest_path_layer_to_point fid="route_points.2">
|
||||
<ogr:geometryProperty><gml:LineString srsName="EPSG:32733"><gml:coordinates>1002947.79277674,6222869.79641753 1003002.42639578,6222681.59030886 1002950.16219022,6222560.53103646 1002981.05280059,6222513.31733464 1002988.8334088,6222500.42759959 1003006.76410522,6222480.99306342 1003027.13399838,6222458.25399505 1003105.74257399,6222376.7841218 1003153.88971381,6222419.41498029 1003172.94058079,6222436.28679202 1003198.63616199,6222463.1404267 1003261.7338751,6222520.86764589 1003285.57002497,6222541.37125149 1003318.51056419,6222558.84948158 1003416.77290022,6222570.20188393 1003430.63468333,6222565.77529146 1003461.44609399,6222555.86616133 1003536.86501513,6222502.0742548 1003555.31281829,6222483.13439712 1003602.8338769,6222436.67874613 1003647.3751082,6222401.82100567 1003696.4437017,6222455.04866221 1003745.10253898,6222507.54062578 1003852.72754463,6222623.65770678 1004026.21371718,6222810.84939244 1004138.7211059,6222934.89025765 1004027.57619058,6223045.89797913 1004078.05459543,6223104.58501454 1004113.27822798,6223142.04955958</gml:coordinates></gml:LineString></ogr:geometryProperty>
|
||||
<ogr:d>3</ogr:d>
|
||||
<ogr:start>1002948.69578, 6222870.05855</ogr:start>
|
||||
<ogr:end>1004113.23166, 6223142.09335</ogr:end>
|
||||
<ogr:cost>2243.3726118</ogr:cost>
|
||||
</ogr:shortest_path_layer_to_point>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:shortest_path_layer_to_point fid="route_points.2">
|
||||
<ogr:geometryProperty><gml:LineString srsName="EPSG:32733"><gml:coordinates>1003866.67429938,6222081.06454087 1003835.88711567,6222011.8549713 1003839.54015074,6221908.19492644 1003775.57324976,6221922.76175725 1003645.34240628,6221954.38918302 1003525.93018347,6222064.10735181 1003596.67006395,6222145.79506248 1003745.40906699,6222317.55884368 1003692.73332615,6222357.0841711 1003647.3751082,6222401.82100567 1003696.4437017,6222455.04866221 1003745.10253898,6222507.54062578 1003852.72754463,6222623.65770678 1004026.21371718,6222810.84939244 1004138.7211059,6222934.89025765 1004027.57619058,6223045.89797913 1004078.05459543,6223104.58501454 1004113.27822798,6223142.04955958</gml:coordinates></gml:LineString></ogr:geometryProperty>
|
||||
<ogr:d>3</ogr:d>
|
||||
<ogr:start>1003863.44041, 6222082.50311</ogr:start>
|
||||
<ogr:end>1004113.23166, 6223142.09335</ogr:end>
|
||||
<ogr:cost>2011.5004590</ogr:cost>
|
||||
</ogr:shortest_path_layer_to_point>
|
||||
</gml:featureMember>
|
||||
</ogr:FeatureCollection>
|
1
python/plugins/processing/tests/testdata/expected/shortest_path_layer_to_point.prj
vendored
Normal file
1
python/plugins/processing/tests/testdata/expected/shortest_path_layer_to_point.prj
vendored
Normal file
@ -0,0 +1 @@
|
||||
PROJCS["WGS_1984_UTM_Zone_33S",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",15],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["Meter",1]]
|
1
python/plugins/processing/tests/testdata/expected/shortest_path_layer_to_point.qpj
vendored
Normal file
1
python/plugins/processing/tests/testdata/expected/shortest_path_layer_to_point.qpj
vendored
Normal file
@ -0,0 +1 @@
|
||||
PROJCS["WGS 84 / UTM zone 33S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",15],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","32733"]]
|
BIN
python/plugins/processing/tests/testdata/expected/shortest_path_layer_to_point.shp
vendored
Normal file
BIN
python/plugins/processing/tests/testdata/expected/shortest_path_layer_to_point.shp
vendored
Normal file
Binary file not shown.
BIN
python/plugins/processing/tests/testdata/expected/shortest_path_layer_to_point.shx
vendored
Normal file
BIN
python/plugins/processing/tests/testdata/expected/shortest_path_layer_to_point.shx
vendored
Normal file
Binary file not shown.
52
python/plugins/processing/tests/testdata/expected/shortest_path_layer_to_point.xsd
vendored
Normal file
52
python/plugins/processing/tests/testdata/expected/shortest_path_layer_to_point.xsd
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema targetNamespace="http://ogr.maptools.org/" xmlns:ogr="http://ogr.maptools.org/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml" elementFormDefault="qualified" version="1.0">
|
||||
<xs:import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/2.1.2/feature.xsd"/>
|
||||
<xs:element name="FeatureCollection" type="ogr:FeatureCollectionType" substitutionGroup="gml:_FeatureCollection"/>
|
||||
<xs:complexType name="FeatureCollectionType">
|
||||
<xs:complexContent>
|
||||
<xs:extension base="gml:AbstractFeatureCollectionType">
|
||||
<xs:attribute name="lockId" type="xs:string" use="optional"/>
|
||||
<xs:attribute name="scope" type="xs:string" use="optional"/>
|
||||
</xs:extension>
|
||||
</xs:complexContent>
|
||||
</xs:complexType>
|
||||
<xs:element name="shortest_path_layer_to_point" type="ogr:shortest_path_layer_to_point_Type" substitutionGroup="gml:_Feature"/>
|
||||
<xs:complexType name="shortest_path_layer_to_point_Type">
|
||||
<xs:complexContent>
|
||||
<xs:extension base="gml:AbstractFeatureType">
|
||||
<xs:sequence>
|
||||
<xs:element name="geometryProperty" type="gml:LineStringPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/>
|
||||
<xs:element name="d" nillable="true" minOccurs="0" maxOccurs="1">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:integer">
|
||||
<xs:totalDigits value="10"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="start" nillable="true" minOccurs="0" maxOccurs="1">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:maxLength value="254"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="end" nillable="true" minOccurs="0" maxOccurs="1">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:maxLength value="254"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="cost" nillable="true" minOccurs="0" maxOccurs="1">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:decimal">
|
||||
<xs:totalDigits value="21"/>
|
||||
<xs:fractionDigits value="7"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:extension>
|
||||
</xs:complexContent>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
BIN
python/plugins/processing/tests/testdata/expected/shortest_path_point_to_layer.dbf
vendored
Normal file
BIN
python/plugins/processing/tests/testdata/expected/shortest_path_point_to_layer.dbf
vendored
Normal file
Binary file not shown.
1
python/plugins/processing/tests/testdata/expected/shortest_path_point_to_layer.prj
vendored
Normal file
1
python/plugins/processing/tests/testdata/expected/shortest_path_point_to_layer.prj
vendored
Normal file
@ -0,0 +1 @@
|
||||
PROJCS["WGS_1984_UTM_Zone_33S",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",15],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["Meter",1]]
|
1
python/plugins/processing/tests/testdata/expected/shortest_path_point_to_layer.qpj
vendored
Normal file
1
python/plugins/processing/tests/testdata/expected/shortest_path_point_to_layer.qpj
vendored
Normal file
@ -0,0 +1 @@
|
||||
PROJCS["WGS 84 / UTM zone 33S",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",15],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","32733"]]
|
BIN
python/plugins/processing/tests/testdata/expected/shortest_path_point_to_layer.shp
vendored
Normal file
BIN
python/plugins/processing/tests/testdata/expected/shortest_path_point_to_layer.shp
vendored
Normal file
Binary file not shown.
BIN
python/plugins/processing/tests/testdata/expected/shortest_path_point_to_layer.shx
vendored
Normal file
BIN
python/plugins/processing/tests/testdata/expected/shortest_path_point_to_layer.shx
vendored
Normal file
Binary file not shown.
@ -2609,7 +2609,6 @@ tests:
|
||||
name: expected/join_attribute_table_subset.gml
|
||||
type: vector
|
||||
|
||||
|
||||
- algorithm: qgis:shortestpathpointtopoint
|
||||
name: Shortest path (point to point, shortest route)
|
||||
params:
|
||||
@ -2632,10 +2631,12 @@ tests:
|
||||
compare:
|
||||
ignore_crs_check: true
|
||||
geometry:
|
||||
precision: 5
|
||||
precision: 2
|
||||
fields:
|
||||
cost:
|
||||
precision: 2
|
||||
start: skip
|
||||
end: skip
|
||||
|
||||
- algorithm: qgis:shortestpathpointtopoint
|
||||
name: Shortest path (point to point, fastest route)
|
||||
@ -2660,7 +2661,72 @@ tests:
|
||||
compare:
|
||||
ignore_crs_check: true
|
||||
geometry:
|
||||
precision: 5
|
||||
precision: 2
|
||||
fields:
|
||||
cost:
|
||||
precision: 2
|
||||
start: skip
|
||||
end: skip
|
||||
|
||||
- algorithm: qgis:shortestpathlayertopoint
|
||||
name: Shortest path layer to point
|
||||
params:
|
||||
DEFAULT_DIRECTION: 2
|
||||
DEFAULT_SPEED: 5.0
|
||||
END_POINT: 1004160.8843928401,6223198.426763908 [EPSG:32733]
|
||||
INPUT:
|
||||
name: roads.gml
|
||||
type: vector
|
||||
START_POINTS:
|
||||
name: custom/route_points.gml
|
||||
type: vector
|
||||
STRATEGY: 0
|
||||
TOLERANCE: 0.0
|
||||
VALUE_BACKWARD: ''
|
||||
VALUE_BOTH: ''
|
||||
VALUE_FORWARD: ''
|
||||
results:
|
||||
OUTPUT:
|
||||
name: expected/shortest_path_layer_to_point.shp
|
||||
type: vector
|
||||
compare:
|
||||
geometry:
|
||||
precision: 2
|
||||
fields:
|
||||
cost:
|
||||
precision: 2
|
||||
start: skip
|
||||
end: skip
|
||||
|
||||
- algorithm: qgis:shortestpathpointtolayer
|
||||
name: Shortest path point to layer
|
||||
params:
|
||||
DEFAULT_DIRECTION: 2
|
||||
DEFAULT_SPEED: 5.0
|
||||
END_POINTS:
|
||||
name: custom/route_points.gml
|
||||
type: vector
|
||||
INPUT:
|
||||
name: roads.gml
|
||||
type: vector
|
||||
START_POINT: 1001285.5030045575,6219636.580449594 [EPSG:32733]
|
||||
STRATEGY: 0
|
||||
TOLERANCE: 0.0
|
||||
VALUE_BACKWARD: ''
|
||||
VALUE_BOTH: ''
|
||||
VALUE_FORWARD: ''
|
||||
results:
|
||||
OUTPUT:
|
||||
name: expected/shortest_path_point_to_layer.shp
|
||||
type: vector
|
||||
compare:
|
||||
geometry:
|
||||
precision: 2
|
||||
fields:
|
||||
cost:
|
||||
precision: 2
|
||||
start: skip
|
||||
end: skip
|
||||
|
||||
- algorithm: qgis:serviceareafrompoint
|
||||
name: Service area (from point, shortest)
|
||||
@ -2684,7 +2750,47 @@ tests:
|
||||
compare:
|
||||
ignore_crs_check: true
|
||||
geometry:
|
||||
precision: 5
|
||||
precision: 2
|
||||
fields:
|
||||
cost:
|
||||
precision: 2
|
||||
start: skip
|
||||
end: skip
|
||||
|
||||
- algorithm: qgis:serviceareafromlayer
|
||||
name: Service area from layer
|
||||
params:
|
||||
DEFAULT_DIRECTION: 2
|
||||
DEFAULT_SPEED: 5.0
|
||||
INPUT:
|
||||
name: roads.gml
|
||||
type: vector
|
||||
START_POINTS:
|
||||
name: custom/route_points.gml
|
||||
type: vector
|
||||
STRATEGY: 0
|
||||
TOLERANCE: 0.0
|
||||
TRAVEL_COST: 700.0
|
||||
VALUE_BACKWARD: ''
|
||||
VALUE_BOTH: ''
|
||||
VALUE_FORWARD: ''
|
||||
results:
|
||||
OUTPUT:
|
||||
name: expected/service_area_from_layer.shp
|
||||
type: vector
|
||||
compare:
|
||||
ignore_crs_check: true
|
||||
geometry:
|
||||
precision: 2
|
||||
fields:
|
||||
cost:
|
||||
precision: 2
|
||||
start: skip
|
||||
end: skip
|
||||
pk:
|
||||
- d
|
||||
- type
|
||||
|
||||
|
||||
- algorithm: qgis:createattributeindex
|
||||
name: Create attribute index
|
||||
|
@ -598,6 +598,8 @@ using the "mod_spatialite" extension (python3)"""
|
||||
libs = [
|
||||
# SpatiaLite >= 4.2 and Sqlite >= 3.7.17, should work on all platforms
|
||||
("mod_spatialite", "sqlite3_modspatialite_init"),
|
||||
# SpatiaLite >= 4.2 (windows)
|
||||
("spatialite4.dll", "sqlite3_modspatialite_init"),
|
||||
# SpatiaLite >= 4.2 and Sqlite < 3.7.17 (Travis)
|
||||
("mod_spatialite.so", "sqlite3_modspatialite_init"),
|
||||
# SpatiaLite < 4.2 (linux)
|
||||
|
@ -43,7 +43,7 @@ for i in $FILES; do
|
||||
author=volayaf
|
||||
;;
|
||||
|
||||
src/app/gps/qwtpolar-*|src/app/qtmain_android.cpp|src/core/gps/qextserialport/*|lib/astyle/*|python/pyspatialite/*)
|
||||
src/app/gps/qwtpolar-*|src/app/qtmain_android.cpp|src/core/gps/qextserialport/*|lib/astyle/*)
|
||||
# Skip third party files
|
||||
echo $f skipped
|
||||
continue
|
||||
|
@ -14,16 +14,24 @@
|
||||
# #
|
||||
###########################################################################
|
||||
|
||||
for ASTYLE in ${QGISSTYLE} $(dirname $0)/qgisstyle $(dirname $0)/RelWithDebInfo/qgisstyle
|
||||
min_version="3"
|
||||
astyle_version_check() {
|
||||
$1 --version
|
||||
[ `printf "$($1 --version | cut -d ' ' -f4)\n$min_version" | sort -V | head -n1` = "$min_version" ]
|
||||
}
|
||||
|
||||
for ASTYLE in ${QGISSTYLE} $(dirname $0)/qgisstyle $(dirname $0)/RelWithDebInfo/qgisstyle astyle
|
||||
do
|
||||
if type -p $ASTYLE >/dev/null; then
|
||||
break
|
||||
if type -p $ASTYLE >/dev/null ; then
|
||||
if astyle_version_check $ASTYLE ; then
|
||||
break
|
||||
fi
|
||||
fi
|
||||
ASTYLE=
|
||||
done
|
||||
|
||||
if [ -z "$ASTYLE" ]; then
|
||||
echo "qgisstyle not found - please enable WITH_ASTYLE in cmake and build it" >&2
|
||||
echo "qgisstyle / astyle not found - please install astyle >= $min_version or enable WITH_ASTYLE in cmake and build" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@ -87,6 +87,7 @@ for my $dist (@dists) {
|
||||
push @dep, $dep;
|
||||
push @dep, "cmake-curses-gui";
|
||||
push @dep, "expect"; # for unbuffer
|
||||
push @dep, "qt5-default"; # to avoid having to select Qt5 manually
|
||||
|
||||
print O "| $dist | ``apt-get install" . join( " ", @dep ) . "`` |\n";
|
||||
}
|
||||
|
@ -1575,6 +1575,7 @@ conesencus:consensus
|
||||
confidental:confidential
|
||||
confidentally:confidentially
|
||||
confids:confides
|
||||
configire:configure
|
||||
configration:configuration
|
||||
configrations:configurations
|
||||
configuation:configuration
|
||||
|
@ -57,7 +57,7 @@ ASTYLEDIFF=astyle.r$REV0-r$REV1.diff
|
||||
# reformat
|
||||
for f in $MODIFIED; do
|
||||
case "$f" in
|
||||
src/core/gps/qextserialport/*|src/plugins/grass/qtermwidget/*|external/astyle/*|python/pyspatialite/*)
|
||||
src/core/gps/qextserialport/*|src/plugins/grass/qtermwidget/*|external/astyle/*)
|
||||
echo $f skipped
|
||||
continue
|
||||
;;
|
||||
|
@ -113,7 +113,7 @@ void Qgs3DUtils::clampAltitudes( QgsLineString *lineString, AltitudeClamping alt
|
||||
}
|
||||
|
||||
|
||||
bool Qgs3DUtils::clampAltitudes( QgsPolygonV2 *polygon, AltitudeClamping altClamp, AltitudeBinding altBind, float height, const Qgs3DMapSettings &map )
|
||||
bool Qgs3DUtils::clampAltitudes( QgsPolygon *polygon, AltitudeClamping altClamp, AltitudeBinding altBind, float height, const Qgs3DMapSettings &map )
|
||||
{
|
||||
if ( !polygon->is3D() )
|
||||
polygon->addZValue( 0 );
|
||||
|
@ -17,7 +17,7 @@
|
||||
#define QGS3DUTILS_H
|
||||
|
||||
class QgsLineString;
|
||||
class QgsPolygonV2;
|
||||
class QgsPolygon;
|
||||
|
||||
#include "qgs3dmapsettings.h"
|
||||
#include "qgsaabb.h"
|
||||
@ -67,7 +67,7 @@ class _3D_EXPORT Qgs3DUtils
|
||||
//! Clamps altitude of vertices of a linestring according to the settings
|
||||
static void clampAltitudes( QgsLineString *lineString, AltitudeClamping altClamp, AltitudeBinding altBind, const QgsPoint ¢roid, float height, const Qgs3DMapSettings &map );
|
||||
//! Clamps altitude of vertices of a polygon according to the settings
|
||||
static bool clampAltitudes( QgsPolygonV2 *polygon, AltitudeClamping altClamp, AltitudeBinding altBind, float height, const Qgs3DMapSettings &map );
|
||||
static bool clampAltitudes( QgsPolygon *polygon, AltitudeClamping altClamp, AltitudeBinding altBind, float height, const Qgs3DMapSettings &map );
|
||||
|
||||
//! Converts a 4x4 transform matrix to a string
|
||||
static QString matrix4x4toString( const QMatrix4x4 &m );
|
||||
|
@ -65,7 +65,7 @@ QgsTessellatedPolygonGeometry::~QgsTessellatedPolygonGeometry()
|
||||
qDeleteAll( mPolygons );
|
||||
}
|
||||
|
||||
void QgsTessellatedPolygonGeometry::setPolygons( const QList<QgsPolygonV2 *> &polygons, const QgsPointXY &origin, float extrusionHeight, const QList<float> &extrusionHeightPerPolygon )
|
||||
void QgsTessellatedPolygonGeometry::setPolygons( const QList<QgsPolygon *> &polygons, const QgsPointXY &origin, float extrusionHeight, const QList<float> &extrusionHeightPerPolygon )
|
||||
{
|
||||
qDeleteAll( mPolygons );
|
||||
mPolygons = polygons;
|
||||
@ -73,7 +73,7 @@ void QgsTessellatedPolygonGeometry::setPolygons( const QList<QgsPolygonV2 *> &po
|
||||
QgsTessellator tesselator( origin.x(), origin.y(), mWithNormals );
|
||||
for ( int i = 0; i < polygons.count(); ++i )
|
||||
{
|
||||
QgsPolygonV2 *polygon = polygons.at( i );
|
||||
QgsPolygon *polygon = polygons.at( i );
|
||||
float extr = extrusionHeightPerPolygon.isEmpty() ? extrusionHeight : extrusionHeightPerPolygon.at( i );
|
||||
tesselator.addPolygon( *polygon, extr );
|
||||
}
|
||||
|
@ -42,10 +42,10 @@ class QgsTessellatedPolygonGeometry : public Qt3DRender::QGeometry
|
||||
~QgsTessellatedPolygonGeometry();
|
||||
|
||||
//! Initializes vertex buffer from given polygons. Takes ownership of passed polygon geometries
|
||||
void setPolygons( const QList<QgsPolygonV2 *> &polygons, const QgsPointXY &origin, float extrusionHeight, const QList<float> &extrusionHeightPerPolygon = QList<float>() );
|
||||
void setPolygons( const QList<QgsPolygon *> &polygons, const QgsPointXY &origin, float extrusionHeight, const QList<float> &extrusionHeightPerPolygon = QList<float>() );
|
||||
|
||||
private:
|
||||
QList<QgsPolygonV2 *> mPolygons;
|
||||
QList<QgsPolygon *> mPolygons;
|
||||
|
||||
Qt3DRender::QAttribute *mPositionAttribute = nullptr;
|
||||
Qt3DRender::QAttribute *mNormalAttribute = nullptr;
|
||||
|
@ -222,7 +222,7 @@ static void _ringToPoly2tri( const QgsCurve *ring, const QgsPoint &ptFirst, cons
|
||||
}
|
||||
}
|
||||
|
||||
static bool _check_intersecting_rings( const QgsPolygonV2 &polygon )
|
||||
static bool _check_intersecting_rings( const QgsPolygon &polygon )
|
||||
{
|
||||
// At this point we assume that input polygons are valid according to the OGC definition.
|
||||
// This means e.g. no duplicate points, polygons are simple (no butterfly shaped polygon with self-intersection),
|
||||
@ -259,7 +259,7 @@ static bool _check_intersecting_rings( const QgsPolygonV2 &polygon )
|
||||
}
|
||||
|
||||
|
||||
void QgsTessellator::addPolygon( const QgsPolygonV2 &polygon, float extrusionHeight )
|
||||
void QgsTessellator::addPolygon( const QgsPolygon &polygon, float extrusionHeight )
|
||||
{
|
||||
if ( !_check_intersecting_rings( polygon ) )
|
||||
{
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
#include "qgis_3d.h"
|
||||
|
||||
class QgsPolygonV2;
|
||||
class QgsPolygon;
|
||||
|
||||
#include <QVector>
|
||||
|
||||
@ -41,7 +41,7 @@ class _3D_EXPORT QgsTessellator
|
||||
QgsTessellator( double originX, double originY, bool addNormals );
|
||||
|
||||
//! Tessellates a triangle and adds its vertex entries to the output data array
|
||||
void addPolygon( const QgsPolygonV2 &polygon, float extrusionHeight );
|
||||
void addPolygon( const QgsPolygon &polygon, float extrusionHeight );
|
||||
|
||||
//! Returns array of triangle vertex data
|
||||
QVector<float> data() const { return mData; }
|
||||
|
@ -101,7 +101,7 @@ Qt3DRender::QGeometryRenderer *QgsLine3DSymbolEntityNode::renderer( const Qgs3DM
|
||||
QgsGeometry::JoinStyle joinStyle = QgsGeometry::JoinStyleRound;
|
||||
double mitreLimit = 0;
|
||||
|
||||
QList<QgsPolygonV2 *> polygons;
|
||||
QList<QgsPolygon *> polygons;
|
||||
QgsFeature f;
|
||||
QgsFeatureIterator fi = layer->getFeatures( request );
|
||||
while ( fi.nextFeature( f ) )
|
||||
@ -122,18 +122,18 @@ Qt3DRender::QGeometryRenderer *QgsLine3DSymbolEntityNode::renderer( const Qgs3DM
|
||||
|
||||
if ( QgsWkbTypes::flatType( buffered->wkbType() ) == QgsWkbTypes::Polygon )
|
||||
{
|
||||
QgsPolygonV2 *polyBuffered = static_cast<QgsPolygonV2 *>( buffered );
|
||||
QgsPolygon *polyBuffered = static_cast<QgsPolygon *>( buffered );
|
||||
Qgs3DUtils::clampAltitudes( polyBuffered, symbol.altitudeClamping(), symbol.altitudeBinding(), symbol.height(), map );
|
||||
polygons.append( polyBuffered );
|
||||
}
|
||||
else if ( QgsWkbTypes::flatType( buffered->wkbType() ) == QgsWkbTypes::MultiPolygon )
|
||||
{
|
||||
QgsMultiPolygonV2 *mpolyBuffered = static_cast<QgsMultiPolygonV2 *>( buffered );
|
||||
QgsMultiPolygon *mpolyBuffered = static_cast<QgsMultiPolygon *>( buffered );
|
||||
for ( int i = 0; i < mpolyBuffered->numGeometries(); ++i )
|
||||
{
|
||||
QgsAbstractGeometry *partBuffered = mpolyBuffered->geometryN( i );
|
||||
Q_ASSERT( QgsWkbTypes::flatType( partBuffered->wkbType() ) == QgsWkbTypes::Polygon );
|
||||
QgsPolygonV2 *polyBuffered = static_cast<QgsPolygonV2 *>( partBuffered )->clone(); // need to clone individual geometry parts
|
||||
QgsPolygon *polyBuffered = static_cast<QgsPolygon *>( partBuffered )->clone(); // need to clone individual geometry parts
|
||||
Qgs3DUtils::clampAltitudes( polyBuffered, symbol.altitudeClamping(), symbol.altitudeBinding(), symbol.height(), map );
|
||||
polygons.append( polyBuffered );
|
||||
}
|
||||
|
@ -122,7 +122,7 @@ QgsPolygon3DSymbolEntityNode::QgsPolygon3DSymbolEntityNode( const Qgs3DMapSettin
|
||||
Qt3DRender::QGeometryRenderer *QgsPolygon3DSymbolEntityNode::renderer( const Qgs3DMapSettings &map, const QgsPolygon3DSymbol &symbol, const QgsVectorLayer *layer, const QgsFeatureRequest &request )
|
||||
{
|
||||
QgsPointXY origin( map.originX(), map.originY() );
|
||||
QList<QgsPolygonV2 *> polygons;
|
||||
QList<QgsPolygon *> polygons;
|
||||
QList<float> extrusionHeightPerPolygon; // will stay empty if not needed per polygon
|
||||
|
||||
QgsExpressionContext ctx( _expressionContext3D() );
|
||||
@ -155,21 +155,21 @@ Qt3DRender::QGeometryRenderer *QgsPolygon3DSymbolEntityNode::renderer( const Qgs
|
||||
if ( hasDDExtrusion )
|
||||
extrusionHeight = ddp.valueAsDouble( QgsAbstract3DSymbol::PropertyExtrusionHeight, ctx, extrusionHeight );
|
||||
|
||||
if ( const QgsPolygonV2 *poly = qgsgeometry_cast< const QgsPolygonV2 *>( g ) )
|
||||
if ( const QgsPolygon *poly = qgsgeometry_cast< const QgsPolygon *>( g ) )
|
||||
{
|
||||
QgsPolygonV2 *polyClone = poly->clone();
|
||||
QgsPolygon *polyClone = poly->clone();
|
||||
Qgs3DUtils::clampAltitudes( polyClone, symbol.altitudeClamping(), symbol.altitudeBinding(), height, map );
|
||||
polygons.append( polyClone );
|
||||
if ( hasDDExtrusion )
|
||||
extrusionHeightPerPolygon.append( extrusionHeight );
|
||||
}
|
||||
else if ( const QgsMultiPolygonV2 *mpoly = qgsgeometry_cast< const QgsMultiPolygonV2 *>( g ) )
|
||||
else if ( const QgsMultiPolygon *mpoly = qgsgeometry_cast< const QgsMultiPolygon *>( g ) )
|
||||
{
|
||||
for ( int i = 0; i < mpoly->numGeometries(); ++i )
|
||||
{
|
||||
const QgsAbstractGeometry *g2 = mpoly->geometryN( i );
|
||||
Q_ASSERT( QgsWkbTypes::flatType( g2->wkbType() ) == QgsWkbTypes::Polygon );
|
||||
QgsPolygonV2 *polyClone = static_cast< const QgsPolygonV2 *>( g2 )->clone();
|
||||
QgsPolygon *polyClone = static_cast< const QgsPolygon *>( g2 )->clone();
|
||||
Qgs3DUtils::clampAltitudes( polyClone, symbol.altitudeClamping(), symbol.altitudeBinding(), height, map );
|
||||
polygons.append( polyClone );
|
||||
if ( hasDDExtrusion )
|
||||
|
@ -254,6 +254,7 @@ INCLUDE_DIRECTORIES(SYSTEM
|
||||
${GEOS_INCLUDE_DIR}
|
||||
${GDAL_INCLUDE_DIR}
|
||||
${SQLITE3_INCLUDE_DIR}
|
||||
${SPATIALINDEX_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
#############################################################
|
||||
|
@ -26,18 +26,18 @@ int QgsGraph::addVertex( const QgsPointXY &pt )
|
||||
return mGraphVertices.size() - 1;
|
||||
}
|
||||
|
||||
int QgsGraph::addEdge( int outVertexIdx, int inVertexIdx, const QVector< QVariant > &strategies )
|
||||
int QgsGraph::addEdge( int fromVertexIdx, int toVertexIdx, const QVector< QVariant > &strategies )
|
||||
{
|
||||
QgsGraphEdge e;
|
||||
|
||||
e.mStrategies = strategies;
|
||||
e.mOut = outVertexIdx;
|
||||
e.mIn = inVertexIdx;
|
||||
e.mToIdx = toVertexIdx;
|
||||
e.mFromIdx = fromVertexIdx;
|
||||
mGraphEdges.push_back( e );
|
||||
int edgeIdx = mGraphEdges.size() - 1;
|
||||
|
||||
mGraphVertices[ outVertexIdx ].mOutEdges.push_back( edgeIdx );
|
||||
mGraphVertices[ inVertexIdx ].mInEdges.push_back( edgeIdx );
|
||||
mGraphVertices[ toVertexIdx ].mIncomingEdges.push_back( edgeIdx );
|
||||
mGraphVertices[ fromVertexIdx ].mOutgoingEdges.push_back( edgeIdx );
|
||||
|
||||
return mGraphEdges.size() - 1;
|
||||
}
|
||||
@ -85,14 +85,14 @@ QVector< QVariant > QgsGraphEdge::strategies() const
|
||||
return mStrategies;
|
||||
}
|
||||
|
||||
int QgsGraphEdge::inVertex() const
|
||||
int QgsGraphEdge::fromVertex() const
|
||||
{
|
||||
return mIn;
|
||||
return mFromIdx;
|
||||
}
|
||||
|
||||
int QgsGraphEdge::outVertex() const
|
||||
int QgsGraphEdge::toVertex() const
|
||||
{
|
||||
return mOut;
|
||||
return mToIdx;
|
||||
}
|
||||
|
||||
QgsGraphVertex::QgsGraphVertex( const QgsPointXY &point )
|
||||
@ -101,14 +101,14 @@ QgsGraphVertex::QgsGraphVertex( const QgsPointXY &point )
|
||||
|
||||
}
|
||||
|
||||
QgsGraphEdgeIds QgsGraphVertex::outEdges() const
|
||||
QgsGraphEdgeIds QgsGraphVertex::incomingEdges() const
|
||||
{
|
||||
return mOutEdges;
|
||||
return mIncomingEdges;
|
||||
}
|
||||
|
||||
QgsGraphEdgeIds QgsGraphVertex::inEdges() const
|
||||
QgsGraphEdgeIds QgsGraphVertex::outgoingEdges() const
|
||||
{
|
||||
return mInEdges;
|
||||
return mOutgoingEdges;
|
||||
}
|
||||
|
||||
QgsPointXY QgsGraphVertex::point() const
|
||||
|
@ -61,21 +61,23 @@ class ANALYSIS_EXPORT QgsGraphEdge
|
||||
QVector< QVariant > strategies() const;
|
||||
|
||||
/**
|
||||
* Returns index of the outgoing vertex
|
||||
* Returns the index of the vertex at the end of this edge.
|
||||
* \see fromVertex()
|
||||
*/
|
||||
int outVertex() const;
|
||||
int toVertex() const;
|
||||
|
||||
/**
|
||||
* Returns index of the incoming vertex
|
||||
* Returns the index of the vertex at the start of this edge.
|
||||
* \see toVertex()
|
||||
*/
|
||||
int inVertex() const;
|
||||
int fromVertex() const;
|
||||
|
||||
private:
|
||||
|
||||
QVector< QVariant > mStrategies;
|
||||
|
||||
int mOut = 0;
|
||||
int mIn = 0;
|
||||
int mToIdx = 0;
|
||||
int mFromIdx = 0;
|
||||
|
||||
friend class QgsGraph;
|
||||
};
|
||||
@ -87,6 +89,7 @@ typedef QList< int > QgsGraphEdgeIds;
|
||||
* \ingroup analysis
|
||||
* \class QgsGraphVertex
|
||||
* \brief This class implements a graph vertex
|
||||
* \since QGIS 3.0
|
||||
*/
|
||||
class ANALYSIS_EXPORT QgsGraphVertex
|
||||
{
|
||||
@ -104,24 +107,26 @@ class ANALYSIS_EXPORT QgsGraphVertex
|
||||
QgsGraphVertex( const QgsPointXY &point );
|
||||
|
||||
/**
|
||||
* Returns outgoing edges ids
|
||||
* Returns the incoming edge ids, i.e. edges which end at this node.
|
||||
* \see outgoingEdges()
|
||||
*/
|
||||
QgsGraphEdgeIds outEdges() const;
|
||||
QgsGraphEdgeIds incomingEdges() const;
|
||||
|
||||
/**
|
||||
* Return incoming edges ids
|
||||
* Returns outgoing edge ids, i.e. edges which start at this node.
|
||||
* \see incomingEdges()
|
||||
*/
|
||||
QgsGraphEdgeIds inEdges() const;
|
||||
QgsGraphEdgeIds outgoingEdges() const;
|
||||
|
||||
/**
|
||||
* Returns point associated with graph vertex
|
||||
* Returns point associated with graph vertex.
|
||||
*/
|
||||
QgsPointXY point() const;
|
||||
|
||||
private:
|
||||
QgsPointXY mCoordinate;
|
||||
QgsGraphEdgeIds mOutEdges;
|
||||
QgsGraphEdgeIds mInEdges;
|
||||
QgsGraphEdgeIds mIncomingEdges;
|
||||
QgsGraphEdgeIds mOutgoingEdges;
|
||||
|
||||
friend class QgsGraph;
|
||||
};
|
||||
@ -130,6 +135,7 @@ class ANALYSIS_EXPORT QgsGraphVertex
|
||||
* \ingroup analysis
|
||||
* \class QgsGraph
|
||||
* \brief Mathematical graph representation
|
||||
* \since QGIS 3.0
|
||||
*/
|
||||
|
||||
class ANALYSIS_EXPORT QgsGraph
|
||||
@ -149,9 +155,10 @@ class ANALYSIS_EXPORT QgsGraph
|
||||
int addVertex( const QgsPointXY &pt );
|
||||
|
||||
/**
|
||||
* Add an edge to the graph
|
||||
* Add an edge to the graph, going from the \a fromVertexIdx
|
||||
* to \a toVertexIdx.
|
||||
*/
|
||||
int addEdge( int outVertexIdx, int inVertexIdx, const QVector< QVariant > &strategies );
|
||||
int addEdge( int fromVertexIdx, int toVertexIdx, const QVector< QVariant > &strategies );
|
||||
|
||||
/**
|
||||
* Returns number of graph vertices
|
||||
|
@ -59,21 +59,20 @@ void QgsGraphAnalyzer::dijkstra( const QgsGraph *source, int startPointIdx, int
|
||||
not_begin.erase( it );
|
||||
|
||||
// edge index list
|
||||
QgsGraphEdgeIds l = source->vertex( curVertex ).outEdges();
|
||||
QgsGraphEdgeIds::iterator arcIt;
|
||||
for ( arcIt = l.begin(); arcIt != l.end(); ++arcIt )
|
||||
const QgsGraphEdgeIds &outgoingEdges = source->vertex( curVertex ).outgoingEdges();
|
||||
for ( int edgeId : outgoingEdges )
|
||||
{
|
||||
const QgsGraphEdge arc = source->edge( *arcIt );
|
||||
const QgsGraphEdge &arc = source->edge( edgeId );
|
||||
double cost = arc.cost( criterionNum ).toDouble() + curCost;
|
||||
|
||||
if ( cost < ( *result )[ arc.inVertex()] )
|
||||
if ( cost < ( *result )[ arc.toVertex()] )
|
||||
{
|
||||
( *result )[ arc.inVertex()] = cost;
|
||||
( *result )[ arc.toVertex()] = cost;
|
||||
if ( resultTree )
|
||||
{
|
||||
( *resultTree )[ arc.inVertex()] = *arcIt;
|
||||
( *resultTree )[ arc.toVertex()] = edgeId;
|
||||
}
|
||||
not_begin.insert( cost, arc.inVertex() );
|
||||
not_begin.insert( cost, arc.toVertex() );
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -111,7 +110,7 @@ QgsGraph *QgsGraphAnalyzer::shortestTree( const QgsGraph *source, int startVerte
|
||||
{
|
||||
const QgsGraphEdge &arc = source->edge( tree[i] );
|
||||
|
||||
treeResult->addEdge( source2result[ arc.outVertex()], source2result[ arc.inVertex()],
|
||||
treeResult->addEdge( source2result[ arc.fromVertex()], source2result[ arc.toVertex()],
|
||||
arc.strategies() );
|
||||
}
|
||||
}
|
||||
|
@ -46,9 +46,9 @@ class ANALYSIS_EXPORT QgsGraphBuilder : public QgsGraphBuilderInterface
|
||||
/*
|
||||
* MANDATORY BUILDER PROPERTY DECLARATION
|
||||
*/
|
||||
virtual void addVertex( int id, const QgsPointXY &pt ) override;
|
||||
void addVertex( int id, const QgsPointXY &pt ) override;
|
||||
|
||||
virtual void addEdge( int pt1id, const QgsPointXY &pt1, int pt2id, const QgsPointXY &pt2, const QVector< QVariant > &prop ) override;
|
||||
void addEdge( int pt1id, const QgsPointXY &pt1, int pt2id, const QgsPointXY &pt2, const QVector< QVariant > &prop ) override;
|
||||
|
||||
/**
|
||||
* Returns generated QgsGraph
|
||||
|
@ -36,9 +36,9 @@ QVariant QgsNetworkSpeedStrategy::cost( double distance, const QgsFeature &f ) c
|
||||
return QVariant( val );
|
||||
}
|
||||
|
||||
QgsAttributeList QgsNetworkSpeedStrategy::requiredAttributes() const
|
||||
QSet<int> QgsNetworkSpeedStrategy::requiredAttributes() const
|
||||
{
|
||||
QgsAttributeList l;
|
||||
l.push_back( mAttributeId );
|
||||
QSet< int > l;
|
||||
l.insert( mAttributeId );
|
||||
return l;
|
||||
}
|
||||
|
@ -35,14 +35,8 @@ class ANALYSIS_EXPORT QgsNetworkSpeedStrategy : public QgsNetworkStrategy
|
||||
*/
|
||||
QgsNetworkSpeedStrategy( int attributeId, double defaultValue, double toMetricFactor );
|
||||
|
||||
//! Returns edge cost
|
||||
QVariant cost( double distance, const QgsFeature &f ) const override;
|
||||
|
||||
/**
|
||||
* Returns list of the source layer attributes needed for cost calculation.
|
||||
* This method called by QgsGraphDirector.
|
||||
*/
|
||||
QgsAttributeList requiredAttributes() const override;
|
||||
QSet< int > requiredAttributes() const override;
|
||||
|
||||
private:
|
||||
int mAttributeId;
|
||||
|
@ -63,11 +63,10 @@ class ANALYSIS_EXPORT QgsNetworkStrategy
|
||||
virtual ~QgsNetworkStrategy() = default;
|
||||
|
||||
/**
|
||||
* Returns list of the source layer attributes needed for cost calculation.
|
||||
* This method called by QgsGraphDirector.
|
||||
* \returns list of required attributes
|
||||
* Returns a list of the source layer attributes needed for cost calculation.
|
||||
* This is method called by QgsGraphDirector.
|
||||
*/
|
||||
virtual QgsAttributeList requiredAttributes() const { return QgsAttributeList(); }
|
||||
virtual QSet< int > requiredAttributes() const { return QSet< int >(); }
|
||||
|
||||
/**
|
||||
* Returns edge cost
|
||||
|
@ -32,91 +32,41 @@
|
||||
#include <QString>
|
||||
#include <QtAlgorithms>
|
||||
|
||||
/**
|
||||
* \ingroup analysis
|
||||
* \class QgsPointCompare
|
||||
*/
|
||||
class QgsPointCompare
|
||||
{
|
||||
public:
|
||||
explicit QgsPointCompare( double tolerance )
|
||||
: mTolerance( tolerance )
|
||||
{ }
|
||||
#include "SpatialIndex.h"
|
||||
|
||||
bool operator()( const QgsPointXY &p1, const QgsPointXY &p2 ) const
|
||||
{
|
||||
if ( mTolerance <= 0 )
|
||||
return p1.x() == p2.x() ? p1.y() < p2.y() : p1.x() < p2.x();
|
||||
|
||||
double tx1 = std::ceil( p1.x() / mTolerance );
|
||||
double tx2 = std::ceil( p2.x() / mTolerance );
|
||||
if ( tx1 == tx2 )
|
||||
return std::ceil( p1.y() / mTolerance ) < std::ceil( p2.y() / mTolerance );
|
||||
return tx1 < tx2;
|
||||
}
|
||||
|
||||
private:
|
||||
double mTolerance;
|
||||
};
|
||||
|
||||
template <typename RandIter, typename Type, typename CompareOp > RandIter my_binary_search( RandIter begin, RandIter end, Type val, CompareOp comp )
|
||||
{
|
||||
// result if not found
|
||||
RandIter not_found = end;
|
||||
|
||||
while ( true )
|
||||
{
|
||||
RandIter avg = begin + ( end - begin ) / 2;
|
||||
if ( begin == avg || end == avg )
|
||||
{
|
||||
if ( !comp( *begin, val ) && !comp( val, *begin ) )
|
||||
return begin;
|
||||
if ( !comp( *end, val ) && !comp( val, *end ) )
|
||||
return end;
|
||||
|
||||
return not_found;
|
||||
}
|
||||
if ( comp( val, *avg ) )
|
||||
end = avg;
|
||||
else if ( comp( *avg, val ) )
|
||||
begin = avg;
|
||||
else
|
||||
return avg;
|
||||
}
|
||||
|
||||
return not_found;
|
||||
}
|
||||
using namespace SpatialIndex;
|
||||
|
||||
struct TiePointInfo
|
||||
{
|
||||
TiePointInfo() = default;
|
||||
TiePointInfo( int additionalPointId, QgsFeatureId featureId, const QgsPointXY &start, const QgsPointXY &end )
|
||||
: additionalPointId( additionalPointId )
|
||||
, mNetworkFeatureId( featureId )
|
||||
, mFirstPoint( start )
|
||||
, mLastPoint( end )
|
||||
{}
|
||||
|
||||
int additionalPointId = -1;
|
||||
QgsPointXY mTiedPoint;
|
||||
double mLength;
|
||||
double mLength = DBL_MAX;
|
||||
QgsFeatureId mNetworkFeatureId = -1;
|
||||
QgsPointXY mFirstPoint;
|
||||
QgsPointXY mLastPoint;
|
||||
};
|
||||
|
||||
bool TiePointInfoCompare( const TiePointInfo &a, const TiePointInfo &b )
|
||||
{
|
||||
if ( a.mFirstPoint == b.mFirstPoint )
|
||||
return a.mLastPoint.x() == b.mLastPoint.x() ? a.mLastPoint.y() < b.mLastPoint.y() : a.mLastPoint.x() < b.mLastPoint.x();
|
||||
|
||||
return a.mFirstPoint.x() == b.mFirstPoint.x() ? a.mFirstPoint.y() < b.mFirstPoint.y() : a.mFirstPoint.x() < b.mFirstPoint.x();
|
||||
}
|
||||
|
||||
QgsVectorLayerDirector::QgsVectorLayerDirector( QgsFeatureSource *source,
|
||||
int directionFieldId,
|
||||
const QString &directDirectionValue,
|
||||
const QString &reverseDirectionValue,
|
||||
const QString &bothDirectionValue,
|
||||
const Direction defaultDirection
|
||||
)
|
||||
const Direction defaultDirection )
|
||||
: mSource( source )
|
||||
, mDirectionFieldId( directionFieldId )
|
||||
, mDirectDirectionValue( directDirectionValue )
|
||||
, mReverseDirectionValue( reverseDirectionValue )
|
||||
, mBothDirectionValue( bothDirectionValue )
|
||||
, mDefaultDirection( defaultDirection )
|
||||
{
|
||||
mSource = source;
|
||||
mDirectionFieldId = directionFieldId;
|
||||
mDirectDirectionValue = directDirectionValue;
|
||||
mReverseDirectionValue = reverseDirectionValue;
|
||||
mDefaultDirection = defaultDirection;
|
||||
mBothDirectionValue = bothDirectionValue;
|
||||
}
|
||||
|
||||
QString QgsVectorLayerDirector::name() const
|
||||
@ -124,10 +74,102 @@ QString QgsVectorLayerDirector::name() const
|
||||
return QStringLiteral( "Vector line" );
|
||||
}
|
||||
|
||||
QgsAttributeList QgsVectorLayerDirector::requiredAttributes() const
|
||||
{
|
||||
QSet< int > attrs;
|
||||
|
||||
if ( mDirectionFieldId != -1 )
|
||||
attrs.insert( mDirectionFieldId );
|
||||
|
||||
for ( const QgsNetworkStrategy *strategy : mStrategies )
|
||||
{
|
||||
attrs.unite( strategy->requiredAttributes() );
|
||||
}
|
||||
return attrs.toList();
|
||||
}
|
||||
|
||||
QgsVectorLayerDirector::Direction QgsVectorLayerDirector::directionForFeature( const QgsFeature &feature ) const
|
||||
{
|
||||
if ( mDirectionFieldId < 0 )
|
||||
return mDefaultDirection;
|
||||
|
||||
QString str = feature.attribute( mDirectionFieldId ).toString();
|
||||
if ( str == mBothDirectionValue )
|
||||
{
|
||||
return Direction::DirectionBoth;
|
||||
}
|
||||
else if ( str == mDirectDirectionValue )
|
||||
{
|
||||
return Direction::DirectionForward;
|
||||
}
|
||||
else if ( str == mReverseDirectionValue )
|
||||
{
|
||||
return Direction::DirectionBackward;
|
||||
}
|
||||
else
|
||||
{
|
||||
return mDefaultDirection;
|
||||
}
|
||||
}
|
||||
|
||||
///@cond PRIVATE
|
||||
class QgsNetworkVisitor : public SpatialIndex::IVisitor
|
||||
{
|
||||
public:
|
||||
explicit QgsNetworkVisitor( QVector< int > &pointIndexes )
|
||||
: mPoints( pointIndexes ) {}
|
||||
|
||||
void visitNode( const INode &n ) override
|
||||
{ Q_UNUSED( n ); }
|
||||
|
||||
void visitData( const IData &d ) override
|
||||
{
|
||||
mPoints.append( d.getIdentifier() );
|
||||
}
|
||||
|
||||
void visitData( std::vector<const IData *> &v ) override
|
||||
{ Q_UNUSED( v ); }
|
||||
|
||||
private:
|
||||
QVector< int > &mPoints;
|
||||
};
|
||||
|
||||
///@endcond
|
||||
|
||||
std::unique_ptr< SpatialIndex::ISpatialIndex > createVertexSpatialIndex( SpatialIndex::IStorageManager &storageManager )
|
||||
{
|
||||
// R-Tree parameters
|
||||
double fillFactor = 0.7;
|
||||
unsigned long indexCapacity = 10;
|
||||
unsigned long leafCapacity = 10;
|
||||
unsigned long dimension = 2;
|
||||
RTree::RTreeVariant variant = RTree::RV_RSTAR;
|
||||
|
||||
// create R-tree
|
||||
SpatialIndex::id_type indexId;
|
||||
std::unique_ptr< SpatialIndex::ISpatialIndex > iRTree( RTree::createNewRTree( storageManager, fillFactor, indexCapacity,
|
||||
leafCapacity, dimension, variant, indexId ) );
|
||||
return iRTree;
|
||||
}
|
||||
|
||||
int findClosestVertex( const QgsPointXY &point, SpatialIndex::ISpatialIndex *index, double tolerance )
|
||||
{
|
||||
QVector< int > matching;
|
||||
QgsNetworkVisitor visitor( matching );
|
||||
|
||||
double pt1[2] = { point.x() - tolerance, point.y() - tolerance },
|
||||
pt2[2] = { point.x() + tolerance, point.y() + tolerance };
|
||||
SpatialIndex::Region searchRegion( pt1, pt2, 2 );
|
||||
|
||||
index->intersectsWithQuery( searchRegion, visitor );
|
||||
|
||||
return matching.empty() ? -1 : matching.at( 0 );
|
||||
}
|
||||
|
||||
void QgsVectorLayerDirector::makeGraph( QgsGraphBuilderInterface *builder, const QVector< QgsPointXY > &additionalPoints,
|
||||
QVector< QgsPointXY > &snappedPoints, QgsFeedback *feedback ) const
|
||||
{
|
||||
int featureCount = ( int ) mSource->featureCount() * 2;
|
||||
long featureCount = mSource->featureCount() * 2;
|
||||
int step = 0;
|
||||
|
||||
QgsCoordinateTransform ct;
|
||||
@ -136,77 +178,227 @@ void QgsVectorLayerDirector::makeGraph( QgsGraphBuilderInterface *builder, const
|
||||
{
|
||||
ct.setDestinationCrs( builder->destinationCrs() );
|
||||
}
|
||||
else
|
||||
{
|
||||
ct.setDestinationCrs( mSource->sourceCrs() );
|
||||
}
|
||||
|
||||
// clear existing snapped points list, and resize to length of provided additional points
|
||||
snappedPoints = QVector< QgsPointXY >( additionalPoints.size(), QgsPointXY( 0.0, 0.0 ) );
|
||||
// tie points = snapped location of specified additional points to network lines
|
||||
QVector< TiePointInfo > additionalTiePoints( additionalPoints.size() );
|
||||
|
||||
TiePointInfo tmpInfo;
|
||||
tmpInfo.mLength = std::numeric_limits<double>::infinity();
|
||||
// graph's vertices = all vertices in graph, with vertices within builder's tolerance collapsed together
|
||||
QVector< QgsPointXY > graphVertices;
|
||||
|
||||
QVector< TiePointInfo > pointLengthMap( additionalPoints.size(), tmpInfo );
|
||||
QVector< TiePointInfo >::iterator pointLengthIt;
|
||||
// spatial index for graph vertices
|
||||
std::unique_ptr< SpatialIndex::IStorageManager > iStorage( StorageManager::createNewMemoryStorageManager() );
|
||||
std::unique_ptr< SpatialIndex::ISpatialIndex > iRTree = createVertexSpatialIndex( *iStorage );
|
||||
|
||||
//Graph's points;
|
||||
QVector< QgsPointXY > points;
|
||||
double tolerance = std::max( builder->topologyTolerance(), 1e-10 );
|
||||
auto findPointWithinTolerance = [&iRTree, tolerance]( const QgsPointXY & point )->int
|
||||
{
|
||||
return findClosestVertex( point, iRTree.get(), tolerance );
|
||||
};
|
||||
auto addPointToIndex = [&iRTree]( const QgsPointXY & point, int index )
|
||||
{
|
||||
double coords[] = {point.x(), point.y()};
|
||||
iRTree->insertData( 0, nullptr, SpatialIndex::Point( coords, 2 ), index );
|
||||
};
|
||||
|
||||
// first iteration - get all nodes from network, and snap additional points to network
|
||||
QgsFeatureIterator fit = mSource->getFeatures( QgsFeatureRequest().setSubsetOfAttributes( QgsAttributeList() ) );
|
||||
|
||||
// begin: tie points to the graph
|
||||
QgsAttributeList la;
|
||||
QgsFeature feature;
|
||||
while ( fit.nextFeature( feature ) )
|
||||
{
|
||||
if ( feedback && feedback->isCanceled() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
QgsMultiPolyline mpl;
|
||||
QgsMultiPolylineXY mpl;
|
||||
if ( QgsWkbTypes::flatType( feature.geometry().wkbType() ) == QgsWkbTypes::MultiLineString )
|
||||
mpl = feature.geometry().asMultiPolyline();
|
||||
else if ( QgsWkbTypes::flatType( feature.geometry().wkbType() ) == QgsWkbTypes::LineString )
|
||||
mpl.push_back( feature.geometry().asPolyline() );
|
||||
|
||||
QgsMultiPolyline::iterator mplIt;
|
||||
for ( mplIt = mpl.begin(); mplIt != mpl.end(); ++mplIt )
|
||||
for ( const QgsPolylineXY &line : qgis::as_const( mpl ) )
|
||||
{
|
||||
QgsPointXY pt1, pt2;
|
||||
bool isFirstPoint = true;
|
||||
QgsPolylineXY::iterator pointIt;
|
||||
for ( pointIt = mplIt->begin(); pointIt != mplIt->end(); ++pointIt )
|
||||
for ( const QgsPointXY &point : line )
|
||||
{
|
||||
pt2 = ct.transform( *pointIt );
|
||||
points.push_back( pt2 );
|
||||
pt2 = ct.transform( point );
|
||||
|
||||
int pt2Idx = findPointWithinTolerance( pt2 ) ;
|
||||
if ( pt2Idx == -1 )
|
||||
{
|
||||
// no vertex already exists within tolerance - add to points, and index
|
||||
addPointToIndex( pt2, graphVertices.count() );
|
||||
graphVertices.push_back( pt2 );
|
||||
}
|
||||
else
|
||||
{
|
||||
// vertex already exists within tolerance - use that
|
||||
pt2 = graphVertices.at( pt2Idx );
|
||||
}
|
||||
|
||||
if ( !isFirstPoint )
|
||||
{
|
||||
// check if this line segment is a candidate for being closest to each additional point
|
||||
int i = 0;
|
||||
for ( i = 0; i != additionalPoints.size(); ++i )
|
||||
for ( const QgsPointXY &additionalPoint : additionalPoints )
|
||||
{
|
||||
TiePointInfo info;
|
||||
|
||||
QgsPointXY snappedPoint;
|
||||
double thisSegmentClosestDist = DBL_MAX;
|
||||
if ( pt1 == pt2 )
|
||||
{
|
||||
info.mLength = additionalPoints[ i ].sqrDist( pt1 );
|
||||
info.mTiedPoint = pt1;
|
||||
thisSegmentClosestDist = additionalPoint.sqrDist( pt1 );
|
||||
snappedPoint = pt1;
|
||||
}
|
||||
else
|
||||
{
|
||||
info.mLength = additionalPoints[ i ].sqrDistToSegment( pt1.x(), pt1.y(),
|
||||
pt2.x(), pt2.y(), info.mTiedPoint );
|
||||
thisSegmentClosestDist = additionalPoint.sqrDistToSegment( pt1.x(), pt1.y(),
|
||||
pt2.x(), pt2.y(), snappedPoint );
|
||||
}
|
||||
|
||||
if ( pointLengthMap[ i ].mLength > info.mLength )
|
||||
if ( thisSegmentClosestDist < additionalTiePoints[ i ].mLength )
|
||||
{
|
||||
Q_UNUSED( info.mTiedPoint );
|
||||
info.mFirstPoint = pt1;
|
||||
info.mLastPoint = pt2;
|
||||
// found a closer segment for this additional point
|
||||
TiePointInfo info( i, feature.id(), pt1, pt2 );
|
||||
info.mLength = thisSegmentClosestDist;
|
||||
info.mTiedPoint = snappedPoint;
|
||||
|
||||
pointLengthMap[ i ] = info;
|
||||
additionalTiePoints[ i ] = info;
|
||||
snappedPoints[ i ] = info.mTiedPoint;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
pt1 = pt2;
|
||||
isFirstPoint = false;
|
||||
}
|
||||
}
|
||||
if ( feedback )
|
||||
feedback->setProgress( 100.0 * static_cast< double >( ++step ) / featureCount );
|
||||
}
|
||||
|
||||
// build a hash of feature ids to tie points which depend on this feature
|
||||
QHash< QgsFeatureId, QList< int > > tiePointNetworkFeatures;
|
||||
int i = 0;
|
||||
for ( TiePointInfo &info : additionalTiePoints )
|
||||
{
|
||||
tiePointNetworkFeatures[ info.mNetworkFeatureId ] << i;
|
||||
i++;
|
||||
}
|
||||
|
||||
// add tied point to graph
|
||||
for ( int i = 0; i < snappedPoints.size(); ++i )
|
||||
{
|
||||
// check index to see if vertex exists within tolerance of tie point
|
||||
const QgsPointXY point = snappedPoints.at( i );
|
||||
int ptIdx = findPointWithinTolerance( point );
|
||||
if ( ptIdx == -1 )
|
||||
{
|
||||
// no vertex already within tolerance, add to index and network vertices
|
||||
addPointToIndex( point, graphVertices.count() );
|
||||
graphVertices.push_back( point );
|
||||
}
|
||||
else
|
||||
{
|
||||
// otherwise snap tie point to vertex
|
||||
snappedPoints[ i ] = graphVertices.at( ptIdx );
|
||||
}
|
||||
}
|
||||
// also need to update tie points - they need to be matched for snapped points
|
||||
for ( int i = 0; i < additionalTiePoints.count(); ++i )
|
||||
{
|
||||
additionalTiePoints[ i ].mTiedPoint = snappedPoints.at( additionalTiePoints.at( i ).additionalPointId );
|
||||
}
|
||||
|
||||
|
||||
// begin graph construction
|
||||
|
||||
// add vertices to graph
|
||||
{
|
||||
int i = 0;
|
||||
for ( const QgsPointXY &point : graphVertices )
|
||||
{
|
||||
builder->addVertex( i, point );
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
fit = mSource->getFeatures( QgsFeatureRequest().setSubsetOfAttributes( requiredAttributes() ) );
|
||||
while ( fit.nextFeature( feature ) )
|
||||
{
|
||||
if ( feedback && feedback->isCanceled() )
|
||||
return;
|
||||
|
||||
Direction direction = directionForFeature( feature );
|
||||
|
||||
// begin features segments and add arc to the Graph;
|
||||
QgsMultiPolylineXY mpl;
|
||||
if ( QgsWkbTypes::flatType( feature.geometry().wkbType() ) == QgsWkbTypes::MultiLineString )
|
||||
mpl = feature.geometry().asMultiPolyline();
|
||||
else if ( QgsWkbTypes::flatType( feature.geometry().wkbType() ) == QgsWkbTypes::LineString )
|
||||
mpl.push_back( feature.geometry().asPolyline() );
|
||||
|
||||
for ( const QgsPolylineXY &line : qgis::as_const( mpl ) )
|
||||
{
|
||||
QgsPointXY pt1, pt2;
|
||||
|
||||
bool isFirstPoint = true;
|
||||
for ( const QgsPointXY &point : line )
|
||||
{
|
||||
pt2 = ct.transform( point );
|
||||
|
||||
if ( !isFirstPoint )
|
||||
{
|
||||
QMap< double, QgsPointXY > pointsOnArc;
|
||||
pointsOnArc[ 0.0 ] = pt1;
|
||||
pointsOnArc[ pt1.sqrDist( pt2 )] = pt2;
|
||||
|
||||
const QList< int > tiePointsForCurrentFeature = tiePointNetworkFeatures.value( feature.id() );
|
||||
for ( int tiePointIdx : tiePointsForCurrentFeature )
|
||||
{
|
||||
const TiePointInfo &t = additionalTiePoints.at( tiePointIdx );
|
||||
if ( t.mFirstPoint == pt1 && t.mLastPoint == pt2 )
|
||||
{
|
||||
pointsOnArc[ pt1.sqrDist( t.mTiedPoint )] = t.mTiedPoint;
|
||||
}
|
||||
}
|
||||
|
||||
QgsPointXY pt1;
|
||||
QgsPointXY pt2;
|
||||
int pt1idx = -1;
|
||||
int pt2idx = -1;
|
||||
bool isFirstPoint = true;
|
||||
for ( auto arcPointIt = pointsOnArc.constBegin(); arcPointIt != pointsOnArc.constEnd(); ++arcPointIt )
|
||||
{
|
||||
pt2 = arcPointIt.value();
|
||||
|
||||
pt2idx = findPointWithinTolerance( pt2 );
|
||||
Q_ASSERT_X( pt2idx >= 0, "QgsVectorLayerDirectory::makeGraph", "encountered a vertex which was not present in graph" );
|
||||
|
||||
if ( !isFirstPoint && pt1 != pt2 )
|
||||
{
|
||||
double distance = builder->distanceArea()->measureLine( pt1, pt2 );
|
||||
QVector< QVariant > prop;
|
||||
for ( QgsNetworkStrategy *strategy : mStrategies )
|
||||
{
|
||||
prop.push_back( strategy->cost( distance, feature ) );
|
||||
}
|
||||
|
||||
if ( direction == Direction::DirectionForward ||
|
||||
direction == Direction::DirectionBoth )
|
||||
{
|
||||
builder->addEdge( pt1idx, pt1, pt2idx, pt2, prop );
|
||||
}
|
||||
if ( direction == Direction::DirectionBackward ||
|
||||
direction == Direction::DirectionBoth )
|
||||
{
|
||||
builder->addEdge( pt2idx, pt2, pt1idx, pt1, prop );
|
||||
}
|
||||
}
|
||||
pt1idx = pt2idx;
|
||||
pt1 = pt2;
|
||||
isFirstPoint = false;
|
||||
}
|
||||
}
|
||||
pt1 = pt2;
|
||||
@ -219,188 +411,4 @@ void QgsVectorLayerDirector::makeGraph( QgsGraphBuilderInterface *builder, const
|
||||
}
|
||||
|
||||
}
|
||||
// end: tie points to graph
|
||||
|
||||
// add tied point to graph
|
||||
int i = 0;
|
||||
for ( i = 0; i < snappedPoints.size(); ++i )
|
||||
{
|
||||
if ( snappedPoints[ i ] != QgsPointXY( 0.0, 0.0 ) )
|
||||
{
|
||||
points.push_back( snappedPoints [ i ] );
|
||||
}
|
||||
}
|
||||
|
||||
QgsPointCompare pointCompare( builder->topologyTolerance() );
|
||||
|
||||
std::sort( points.begin(), points.end(), pointCompare );
|
||||
QVector< QgsPointXY >::iterator tmp = std::unique( points.begin(), points.end() );
|
||||
points.resize( tmp - points.begin() );
|
||||
|
||||
for ( i = 0; i < points.size(); ++i )
|
||||
builder->addVertex( i, points[ i ] );
|
||||
|
||||
for ( i = 0; i < snappedPoints.size() ; ++i )
|
||||
snappedPoints[ i ] = *( my_binary_search( points.begin(), points.end(), snappedPoints[ i ], pointCompare ) );
|
||||
|
||||
std::sort( pointLengthMap.begin(), pointLengthMap.end(), TiePointInfoCompare );
|
||||
|
||||
{
|
||||
// fill attribute list 'la'
|
||||
QgsAttributeList tmpAttr;
|
||||
if ( mDirectionFieldId != -1 )
|
||||
{
|
||||
tmpAttr.push_back( mDirectionFieldId );
|
||||
}
|
||||
|
||||
QList< QgsNetworkStrategy * >::const_iterator it;
|
||||
QgsAttributeList::const_iterator it2;
|
||||
|
||||
for ( it = mStrategies.constBegin(); it != mStrategies.constEnd(); ++it )
|
||||
{
|
||||
QgsAttributeList tmp = ( *it )->requiredAttributes();
|
||||
for ( it2 = tmp.constBegin(); it2 != tmp.constEnd(); ++it2 )
|
||||
{
|
||||
tmpAttr.push_back( *it2 );
|
||||
}
|
||||
}
|
||||
std::sort( tmpAttr.begin(), tmpAttr.end() );
|
||||
|
||||
int lastAttrId = -1;
|
||||
for ( it2 = tmpAttr.constBegin(); it2 != tmpAttr.constEnd(); ++it2 )
|
||||
{
|
||||
if ( *it2 == lastAttrId )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
la.push_back( *it2 );
|
||||
|
||||
lastAttrId = *it2;
|
||||
}
|
||||
} // end fill attribute list 'la'
|
||||
|
||||
// begin graph construction
|
||||
fit = mSource->getFeatures( QgsFeatureRequest().setSubsetOfAttributes( la ) );
|
||||
while ( fit.nextFeature( feature ) )
|
||||
{
|
||||
if ( feedback && feedback->isCanceled() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Direction directionType = mDefaultDirection;
|
||||
|
||||
// What direction have feature?
|
||||
QString str = feature.attribute( mDirectionFieldId ).toString();
|
||||
if ( str == mBothDirectionValue )
|
||||
{
|
||||
directionType = Direction::DirectionBoth;
|
||||
}
|
||||
else if ( str == mDirectDirectionValue )
|
||||
{
|
||||
directionType = Direction::DirectionForward;
|
||||
}
|
||||
else if ( str == mReverseDirectionValue )
|
||||
{
|
||||
directionType = Direction::DirectionBackward;
|
||||
}
|
||||
|
||||
// begin features segments and add arc to the Graph;
|
||||
QgsMultiPolyline mpl;
|
||||
if ( QgsWkbTypes::flatType( feature.geometry().wkbType() ) == QgsWkbTypes::MultiLineString )
|
||||
mpl = feature.geometry().asMultiPolyline();
|
||||
else if ( QgsWkbTypes::flatType( feature.geometry().wkbType() ) == QgsWkbTypes::LineString )
|
||||
mpl.push_back( feature.geometry().asPolyline() );
|
||||
|
||||
QgsMultiPolyline::iterator mplIt;
|
||||
for ( mplIt = mpl.begin(); mplIt != mpl.end(); ++mplIt )
|
||||
{
|
||||
QgsPointXY pt1, pt2;
|
||||
|
||||
bool isFirstPoint = true;
|
||||
QgsPolylineXY::iterator pointIt;
|
||||
for ( pointIt = mplIt->begin(); pointIt != mplIt->end(); ++pointIt )
|
||||
{
|
||||
pt2 = ct.transform( *pointIt );
|
||||
|
||||
if ( !isFirstPoint )
|
||||
{
|
||||
QMap< double, QgsPointXY > pointsOnArc;
|
||||
pointsOnArc[ 0.0 ] = pt1;
|
||||
pointsOnArc[ pt1.sqrDist( pt2 )] = pt2;
|
||||
|
||||
TiePointInfo t;
|
||||
t.mFirstPoint = pt1;
|
||||
t.mLastPoint = pt2;
|
||||
t.mLength = 0.0;
|
||||
pointLengthIt = my_binary_search( pointLengthMap.begin(), pointLengthMap.end(), t, TiePointInfoCompare );
|
||||
|
||||
if ( pointLengthIt != pointLengthMap.end() )
|
||||
{
|
||||
QVector< TiePointInfo >::iterator it;
|
||||
for ( it = pointLengthIt; it - pointLengthMap.begin() >= 0; --it )
|
||||
{
|
||||
if ( it->mFirstPoint == pt1 && it->mLastPoint == pt2 )
|
||||
{
|
||||
pointsOnArc[ pt1.sqrDist( it->mTiedPoint )] = it->mTiedPoint;
|
||||
}
|
||||
}
|
||||
for ( it = pointLengthIt + 1; it != pointLengthMap.end(); ++it )
|
||||
{
|
||||
if ( it->mFirstPoint == pt1 && it->mLastPoint == pt2 )
|
||||
{
|
||||
pointsOnArc[ pt1.sqrDist( it->mTiedPoint )] = it->mTiedPoint;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QMap< double, QgsPointXY >::iterator pointsIt;
|
||||
QgsPointXY pt1;
|
||||
QgsPointXY pt2;
|
||||
int pt1idx = -1, pt2idx = -1;
|
||||
bool isFirstPoint = true;
|
||||
for ( pointsIt = pointsOnArc.begin(); pointsIt != pointsOnArc.end(); ++pointsIt )
|
||||
{
|
||||
pt2 = *pointsIt;
|
||||
tmp = my_binary_search( points.begin(), points.end(), pt2, pointCompare );
|
||||
pt2 = *tmp;
|
||||
pt2idx = tmp - points.begin();
|
||||
|
||||
if ( !isFirstPoint && pt1 != pt2 )
|
||||
{
|
||||
double distance = builder->distanceArea()->measureLine( pt1, pt2 );
|
||||
QVector< QVariant > prop;
|
||||
QList< QgsNetworkStrategy * >::const_iterator it;
|
||||
for ( it = mStrategies.begin(); it != mStrategies.end(); ++it )
|
||||
{
|
||||
prop.push_back( ( *it )->cost( distance, feature ) );
|
||||
}
|
||||
|
||||
if ( directionType == Direction::DirectionForward ||
|
||||
directionType == Direction::DirectionBoth )
|
||||
{
|
||||
builder->addEdge( pt1idx, pt1, pt2idx, pt2, prop );
|
||||
}
|
||||
if ( directionType == Direction::DirectionBackward ||
|
||||
directionType == Direction::DirectionBoth )
|
||||
{
|
||||
builder->addEdge( pt2idx, pt2, pt1idx, pt1, prop );
|
||||
}
|
||||
}
|
||||
pt1idx = pt2idx;
|
||||
pt1 = pt2;
|
||||
isFirstPoint = false;
|
||||
}
|
||||
} // if ( !isFirstPoint )
|
||||
pt1 = pt2;
|
||||
isFirstPoint = false;
|
||||
} // for (it = pl.begin(); it != pl.end(); ++it)
|
||||
}
|
||||
if ( feedback )
|
||||
{
|
||||
feedback->setProgress( 100.0 * static_cast< double >( ++step ) / featureCount );
|
||||
}
|
||||
|
||||
} // while( mSource->nextFeature(feature) )
|
||||
} // makeGraph( QgsGraphBuilderInterface *builder, const QVector< QgsPointXY >& additionalPoints, QVector< QgsPointXY >& tiedPoint )
|
||||
}
|
||||
|
@ -82,11 +82,14 @@ class ANALYSIS_EXPORT QgsVectorLayerDirector : public QgsGraphDirector
|
||||
|
||||
private:
|
||||
QgsFeatureSource *mSource = nullptr;
|
||||
int mDirectionFieldId;
|
||||
int mDirectionFieldId = -1;
|
||||
QString mDirectDirectionValue;
|
||||
QString mReverseDirectionValue;
|
||||
QString mBothDirectionValue;
|
||||
Direction mDefaultDirection;
|
||||
Direction mDefaultDirection = DirectionBoth;
|
||||
|
||||
QgsAttributeList requiredAttributes() const;
|
||||
Direction directionForFeature( const QgsFeature &feature ) const;
|
||||
};
|
||||
|
||||
#endif // QGSVECTORLAYERDIRECTOR_H
|
||||
|
@ -180,7 +180,7 @@ QVariantMap QgsLineIntersectionAlgorithm::processAlgorithm( const QVariantMap &p
|
||||
QgsGeometry tmpGeom = inFeatureB.geometry();
|
||||
if ( engine->intersects( tmpGeom.constGet() ) )
|
||||
{
|
||||
QgsMultiPoint points;
|
||||
QgsMultiPointXY points;
|
||||
QgsGeometry intersectGeom = inGeom.intersection( tmpGeom );
|
||||
QgsAttributes outAttributes;
|
||||
for ( int a : qgis::as_const( fieldsAIndices ) )
|
||||
@ -204,7 +204,7 @@ QVariantMap QgsLineIntersectionAlgorithm::processAlgorithm( const QVariantMap &p
|
||||
|
||||
for ( const QgsPointXY &j : qgis::as_const( points ) )
|
||||
{
|
||||
outFeature.setGeometry( QgsGeometry::fromPoint( j ) );
|
||||
outFeature.setGeometry( QgsGeometry::fromPointXY( j ) );
|
||||
outFeature.setAttributes( outAttributes );
|
||||
sink->addFeature( outFeature, QgsFeatureSink::FastInsert );
|
||||
}
|
||||
|
@ -196,7 +196,7 @@ QVariantMap QgsMeanCoordinatesAlgorithm::processAlgorithm( const QVariantMap &pa
|
||||
double cy = it.value().at( 1 ) / it.value().at( 2 );
|
||||
|
||||
QgsPointXY meanPoint( cx, cy );
|
||||
outFeat.setGeometry( QgsGeometry::fromPoint( meanPoint ) );
|
||||
outFeat.setGeometry( QgsGeometry::fromPointXY( meanPoint ) );
|
||||
|
||||
QgsAttributes attributes;
|
||||
attributes << cx << cy;
|
||||
|
@ -113,7 +113,7 @@ QgsKernelDensityEstimation::Result QgsKernelDensityEstimation::addFeature( const
|
||||
}
|
||||
|
||||
// convert the geometry to multipoint
|
||||
QgsMultiPoint multiPoints;
|
||||
QgsMultiPointXY multiPoints;
|
||||
if ( !featureGeometry.isMultipart() )
|
||||
{
|
||||
QgsPointXY p = featureGeometry.asPoint();
|
||||
@ -148,7 +148,7 @@ QgsKernelDensityEstimation::Result QgsKernelDensityEstimation::addFeature( const
|
||||
Result result = Success;
|
||||
|
||||
//loop through all points in multipoint
|
||||
for ( QgsMultiPoint::const_iterator pointIt = multiPoints.constBegin(); pointIt != multiPoints.constEnd(); ++pointIt )
|
||||
for ( QgsMultiPointXY::const_iterator pointIt = multiPoints.constBegin(); pointIt != multiPoints.constEnd(); ++pointIt )
|
||||
{
|
||||
// avoiding any empty points or out of extent points
|
||||
if ( !mBounds.contains( *pointIt ) )
|
||||
|
@ -197,7 +197,7 @@ namespace QgsGeometryCheckerUtils
|
||||
return geom;
|
||||
}
|
||||
|
||||
QList<const QgsLineString *> polygonRings( const QgsPolygonV2 *polygon )
|
||||
QList<const QgsLineString *> polygonRings( const QgsPolygon *polygon )
|
||||
{
|
||||
QList<const QgsLineString *> rings;
|
||||
if ( const QgsLineString *exterior = dynamic_cast<const QgsLineString *>( polygon->exteriorRing() ) )
|
||||
|
@ -100,7 +100,7 @@ namespace QgsGeometryCheckerUtils
|
||||
QgsAbstractGeometry *getGeomPart( QgsAbstractGeometry *geom, int partIdx );
|
||||
const QgsAbstractGeometry *getGeomPart( const QgsAbstractGeometry *geom, int partIdx );
|
||||
|
||||
QList<const QgsLineString *> polygonRings( const QgsPolygonV2 *polygon );
|
||||
QList<const QgsLineString *> polygonRings( const QgsPolygon *polygon );
|
||||
|
||||
void filter1DTypes( QgsAbstractGeometry *geom );
|
||||
|
||||
|
@ -50,7 +50,7 @@ void QgsGeometryLineLayerIntersectionCheck::collectErrors( QList<QgsGeometryChec
|
||||
errors.append( new QgsGeometryCheckError( this, layerFeature, inter, QgsVertexId( iPart ), checkFeature.id() ) );
|
||||
}
|
||||
}
|
||||
else if ( const QgsPolygonV2 *polygon = dynamic_cast<const QgsPolygonV2 *>( part ) )
|
||||
else if ( const QgsPolygon *polygon = dynamic_cast<const QgsPolygon *>( part ) )
|
||||
{
|
||||
for ( const QgsLineString *ring : QgsGeometryCheckerUtils::polygonRings( polygon ) )
|
||||
{
|
||||
|
@ -197,7 +197,7 @@ void QgsGeometrySelfIntersectionCheck::fixError( QgsGeometryCheckError *error, i
|
||||
poly->setExteriorRing( ringGeom1 );
|
||||
|
||||
// If original feature was a linear polygon, also create the new part as a linear polygon
|
||||
QgsCurvePolygon *poly2 = dynamic_cast<QgsPolygonV2 *>( part ) ? new QgsPolygonV2() : new QgsCurvePolygon();
|
||||
QgsCurvePolygon *poly2 = dynamic_cast<QgsPolygon *>( part ) ? new QgsPolygon() : new QgsCurvePolygon();
|
||||
poly2->setExteriorRing( ringGeom2 );
|
||||
|
||||
// Reassing interiors as necessary
|
||||
@ -231,7 +231,7 @@ void QgsGeometrySelfIntersectionCheck::fixError( QgsGeometryCheckError *error, i
|
||||
// Otherwise, create multipolygon
|
||||
else
|
||||
{
|
||||
QgsMultiPolygonV2 *multiPoly = new QgsMultiPolygonV2();
|
||||
QgsMultiPolygon *multiPoly = new QgsMultiPolygon();
|
||||
multiPoly->addGeometry( poly->clone() );
|
||||
multiPoly->addGeometry( poly2 );
|
||||
feature.setGeometry( QgsGeometry( multiPoly ) );
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user