Skip to content

Commit

Permalink
Merge branch 'master' into sirs_db_manager
Browse files Browse the repository at this point in the history
  • Loading branch information
Ailurupoda committed Jan 10, 2019
2 parents 238ea72 + fd00cd5 commit 5c0bcd9
Show file tree
Hide file tree
Showing 505 changed files with 13,927 additions and 3,738 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Expand Up @@ -480,13 +480,15 @@ IF (PEDANTIC)
ENDIF (NOT USING_NMAKE AND NOT USING_NINJA)

# disable warnings
SET(_warnings "${_warnings} /wd4091 ") # 'typedef': ignored on left of '' when no variable is declared (occurs in MS DbgHelp.h header)
SET(_warnings "${_warnings} /wd4100 ") # unused formal parameters
SET(_warnings "${_warnings} /wd4127 ") # constant conditional expressions (used in Qt template classes)
SET(_warnings "${_warnings} /wd4190 ") # 'identifier' has C-linkage specified, but returns UDT 'identifier2' which is incompatible with C
SET(_warnings "${_warnings} /wd4231 ") # nonstandard extension used : 'identifier' before template explicit instantiation (used in Qt template classes)
SET(_warnings "${_warnings} /wd4244 ") # conversion from '...' to '...' possible loss of data
SET(_warnings "${_warnings} /wd4251 ") # needs to have dll-interface to be used by clients of class (occurs in Qt template classes)
SET(_warnings "${_warnings} /wd4275 ") # non dll-interface class '...' used as base for dll-interface class '...'
SET(_warnings "${_warnings} /wd4290 ") # c++ exception specification ignored except to indicate a function is not __declspec(nothrow) (occurs in sip generated bindings)
SET(_warnings "${_warnings} /wd4456 ") # declaration of '...' hides previous local declaration
SET(_warnings "${_warnings} /wd4457 ") # declaration of '...' hides a function parameter
SET(_warnings "${_warnings} /wd4458 ") # declaration of '...' hides class member
Expand Down
8 changes: 4 additions & 4 deletions cmake/FindGRASS.cmake
Expand Up @@ -167,7 +167,7 @@ IF (UNIX)
ENDFOREACH(VERSION_MINOR)
ELSE (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
FOREACH (PATH /usr/lib64 /usr/lib)
FOREACH (VERSION grass70, grass72, grass74)
FOREACH (VERSION grass76, grass74, grass72, grass70)
LIST(APPEND GRASS_PATHS "${PATH}/${VERSION}")
ENDFOREACH (VERSION)
ENDFOREACH (PATH)
Expand All @@ -178,10 +178,10 @@ ENDIF (UNIX)
IF (APPLE)
IF (GRASS_FIND_VERSION EQUAL 7)
LIST(APPEND GRASS_PATHS
/Applications/GRASS-7.0.app/Contents/MacOS
/Applications/GRASS-7.1.app/Contents/MacOS
/Applications/GRASS-7.2.app/Contents/MacOS
/Applications/GRASS-7.6.app/Contents/MacOS
/Applications/GRASS-7.4.app/Contents/MacOS
/Applications/GRASS-7.2.app/Contents/MacOS
/Applications/GRASS-7.0.app/Contents/MacOS
)
ENDIF ()
LIST(APPEND GRASS_PATHS /Applications/GRASS.app/Contents/Resources)
Expand Down
2 changes: 2 additions & 0 deletions debian/python-qgis-common.install
@@ -1,2 +1,4 @@
usr/share/qgis/python/*
usr/lib/python*/*-packages/qgis/processing/*
usr/lib/python*/*-packages/qgis/testing/*
usr/lib/python*/*-packages/PyQt?/uic/widget-plugins/qgis_customwidgets.py
1 change: 0 additions & 1 deletion debian/python-qgis.install.in
Expand Up @@ -4,6 +4,5 @@ usr/lib/python*/*-packages/qgis/core/*
usr/lib/python*/*-packages/qgis/gui/*
usr/lib/python*/*-packages/qgis/analysis/*
usr/lib/python*/*-packages/qgis/PyQt/*
usr/lib/python*/*-packages/qgis/testing/*
usr/lib/python*/*-packages/qgis/server/*
#sid buster bionic cosmic#usr/lib/python*/*-packages/qgis/3d/*
4 changes: 4 additions & 0 deletions doc/CMakeLists.txt
Expand Up @@ -78,6 +78,7 @@ IF(WITH_APIDOC)
${CMAKE_SOURCE_DIR}/src/core/raster
${CMAKE_SOURCE_DIR}/src/core/scalebar
${CMAKE_SOURCE_DIR}/src/core/symbology
${CMAKE_SOURCE_DIR}/src/core/validity
${CMAKE_SOURCE_DIR}/src/gui
${CMAKE_SOURCE_DIR}/src/gui/auth
${CMAKE_SOURCE_DIR}/src/gui/attributetable
Expand All @@ -87,7 +88,9 @@ IF(WITH_APIDOC)
${CMAKE_SOURCE_DIR}/src/gui/layertree
${CMAKE_SOURCE_DIR}/src/gui/layout
${CMAKE_SOURCE_DIR}/src/gui/locator
${CMAKE_SOURCE_DIR}/src/gui/ogr
${CMAKE_SOURCE_DIR}/src/gui/processing
${CMAKE_SOURCE_DIR}/src/gui/processing/models
${CMAKE_SOURCE_DIR}/src/gui/raster
${CMAKE_SOURCE_DIR}/src/gui/symbology
${CMAKE_SOURCE_DIR}/src/analysis
Expand All @@ -96,6 +99,7 @@ IF(WITH_APIDOC)
${CMAKE_SOURCE_DIR}/src/analysis/processing
${CMAKE_SOURCE_DIR}/src/analysis/raster
${CMAKE_SOURCE_DIR}/src/analysis/vector
${CMAKE_SOURCE_DIR}/src/analysis/vector/geometry_checker
${CMAKE_SOURCE_DIR}/src/3d
${CMAKE_SOURCE_DIR}/src/3d/chunks
${CMAKE_SOURCE_DIR}/src/3d/symbols
Expand Down
17 changes: 9 additions & 8 deletions ms-windows/QGIS-Installer.nsi
Expand Up @@ -37,14 +37,15 @@ RequestExecutionLevel admin

!addplugindir osgeo4w/untgz
!addplugindir osgeo4w/nsis
!addplugindir osgeo4w/inetc

;----------------------------------------------------------------------------------------------------------------------------

;Publisher variables

!define PUBLISHER "QGIS Development Team"
!define WEB_SITE "http://qgis.org"
!define WIKI_PAGE "http://qgis.org/en/docs/"
!define WEB_SITE "https://qgis.org"
!define WIKI_PAGE "https://qgis.org/en/docs/"

;----------------------------------------------------------------------------------------------------------------------------

Expand Down Expand Up @@ -404,9 +405,9 @@ Function DownloadDataSet
download:
SetShellVarContext current
InitPluginsDir
NSISdl::download "$HTTP_PATH/$ARCHIVE_NAME" "$TEMP\$ARCHIVE_NAME"
Pop $0
StrCmp $0 "success" download_ok download_failed
inetc::get /caption "$ARCHIVE_NAME" /canceltext "Cancel" "$HTTP_PATH/$ARCHIVE_NAME" "$TEMP\$ARCHIVE_NAME" /end
Pop $0 # return value = exit code, "OK" means OK
StrCmp $0 "OK" download_ok download_failed

download_ok:
InitPluginsDir
Expand Down Expand Up @@ -443,7 +444,7 @@ Section /O "North Carolina Data Set" SecNorthCarolinaSDB
;Set the size (in KB) of the unpacked archive file
AddSize 293314

StrCpy $HTTP_PATH "http://grass.osgeo.org/sampledata"
StrCpy $HTTP_PATH "https://grass.osgeo.org/sampledata"
StrCpy $ARCHIVE_NAME "nc_spm_latest.tar.gz"
StrCpy $EXTENDED_ARCHIVE_NAME "North Carolina"
StrCpy $ORIGINAL_UNTAR_FOLDER "nc_spm_08"
Expand All @@ -461,7 +462,7 @@ Section /O "South Dakota (Spearfish) Data Set" SecSpearfishSDB
;Set the size (in KB) of the unpacked archive file
AddSize 42171

StrCpy $HTTP_PATH "http://grass.osgeo.org/sampledata"
StrCpy $HTTP_PATH "https://grass.osgeo.org/sampledata"
StrCpy $ARCHIVE_NAME "spearfish_grass60data-0.3.tar.gz"
StrCpy $EXTENDED_ARCHIVE_NAME "South Dakota (Spearfish)"
StrCpy $ORIGINAL_UNTAR_FOLDER "spearfish60"
Expand All @@ -479,7 +480,7 @@ Section /O "Alaska Data Set" SecAlaskaSDB
;Set the size (in KB) of the unpacked archive file
AddSize 33914

StrCpy $HTTP_PATH "http://qgis.org/downloads/data"
StrCpy $HTTP_PATH "https://qgis.org/downloads/data"
StrCpy $ARCHIVE_NAME "qgis_sample_data.tar.gz"
StrCpy $EXTENDED_ARCHIVE_NAME "Alaska"
StrCpy $ORIGINAL_UNTAR_FOLDER "qgis_sample_data"
Expand Down
9 changes: 9 additions & 0 deletions ms-windows/osgeo4w/creatensis.pl
Expand Up @@ -78,6 +78,9 @@ BEGIN
system "wget $wgetopt -c http://qgis.org/downloads/Untgz.zip" unless -f "Untgz.zip";
die "download of Untgz.zip failed" if $?;

system "wget $wgetopt -c https://qgis.org/downloads/Inetc.zip" unless -f "Inetc.zip";
die "download of Inetc.zip failed" if $?;

my %dep;
my %file;
my %lic;
Expand Down Expand Up @@ -386,6 +389,12 @@ sub getDeps {
die "unpacking Untgz.zip failed" if $?;
}

unless(-d "inetc") {
mkdir "inetc", 0755;
system "unzip -p $packages/Inetc.zip Plugins/x86-ansi/INetC.dll >inetc/INetC.dll";
die "unpacking Inetc.zip failed" if $?;
}

chdir "..";


Expand Down
1 change: 1 addition & 0 deletions python/CMakeLists.txt
Expand Up @@ -116,6 +116,7 @@ INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/src/core/raster
${CMAKE_SOURCE_DIR}/src/core/scalebar
${CMAKE_SOURCE_DIR}/src/core/symbology
${CMAKE_SOURCE_DIR}/src/core/validity
${CMAKE_SOURCE_DIR}/src/plugins

${CMAKE_BINARY_DIR} # qgsconfig.h, qgsversion.h
Expand Down
Expand Up @@ -27,12 +27,16 @@ A feature pool is based on a vector layer and caches features.
#include "qgsfeaturepool.h"
%End
public:

QgsFeaturePool( QgsVectorLayer *layer );
%Docstring
Creates a new feature pool for ``layer``.
%End
virtual ~QgsFeaturePool();

bool getFeature( QgsFeatureId id, QgsFeature &feature, QgsFeedback *feedback = 0 );
%Docstring
Retrieve the feature with the specified ``id`` into ``feature``.
Retrieves the feature with the specified ``id`` into ``feature``.
It will be retrieved from the cache or from the underlying layer if unavailable.
If the feature is neither available from the cache nor from the layer it will return false.
If ``feedback`` is specified, the call may return if the feedback is canceled.
Expand All @@ -55,7 +59,7 @@ Implementations will remove the feature from the layer or from the data provider

QgsVectorLayer *layer() const;
%Docstring
Get a pointer to the underlying layer.
Gets a pointer to the underlying layer.
May return a ``None`` if the layer has been deleted.
This must only be called from the main thread.
%End
Expand Down
Expand Up @@ -13,10 +13,90 @@
class QgsGeometryCheck
{
%Docstring
This class manages all known geometry check factories.
This class implements a geometry check.

QgsGeometryCheckRegistry is not usually directly created, but rather accessed through
:py:func:`QgsAnalysis.geometryCheckRegistry()`
Geometry checks run over a set of features and can detect errors like topological
or other issues which are reported in the geometry validation panel in QGIS and
help a user to create valid geometries.

Implementing a custom geometry check consists of the following parts

### Writing the check

A new subclass of QgsGeometryCheck needs to be written and at least the following
abstract methods need to be implemented:

- `compatibleGeometryTypes()`

A list of geometry types to which this check applies

- `resolutionMethods()`

A list of names for (automated) resolution methods that can be used to fix errors of this type

- `description()`

A description for the geometry check.

- `id()`

A unique id for this check.

- `checkType()`

One of QgsGeometryCheck.LayerCheck, QgsGeometryCheck.FeatureCheck,QgsGeometryCheck.FeatureNodeCheck

- \link collectErrors() `collectErrors(featurePools, errors, messages, feedback, ids)`\endlink

This method will be called to validate geometries. All geometries which should be validated are passed
into this method with the parameter ids and should be retrieved from the available featurePools to make
use of caching. New errors should be appended to the error list and other message strings to messages.
The method needs to return a tuple (errors, messages).

### Creating a geometry check factory

A Geometry check factory manages meta information for checks. There will always be one single
geometry check factory created per check type, but it's possible that multiple QgsGeometryCheck
instances are created and used in parallel.

A new subclass of QgsGeometryCheckFactory needs to be written and at least the following
abstract methods need to be implemented:

- \link QgsGeometryCheckFactory.createGeometryCheck() `createGeometryCheck(context, configuration)`\endlink

Needs to return a new subclassed QgsGeometryCheck object that has been written in the previous step.

- \link QgsGeometryCheckFactory.id() `id()\endlink

A unique id for this geometry check.

- \link QgsGeometryCheckFactory.description() `description()\endlink

A description for this geometry check that can be presented to the user for more explanation.

- \link QgsGeometryCheckFactory.isCompatible() `QgsGeometryCheckFactory.isCompatible(layer)`\endlink

Returns a boolean that determines if this check is available for a given layer. This often
checks for the geometry type of the layer.

- \link QgsGeometryCheckFactory.flags() `flags()`\endlink

Returns additional flags for a geometry check. If unsure return QgsGeometryCheck.AvailableInValidation.

- \link QgsGeometryCheckFactory.checkType() `checkType()`\endlink

Returns the type of this geometry check.

### Registering the geometry check

Finally the geometry check factory needs to be registered in QGIS, so the system
is aware of the available geometry checks.

.. code-block:: python

# Make sure you always keep a
checkFactory = MyGeometryCheckFactory()
QgsAnalysis.geometryCheckRegistry().registerGeometryCheck(checkFactory)

.. note::

Expand Down Expand Up @@ -164,6 +244,10 @@ Returns the context
protected:






};

/************************************************************************
Expand Down

0 comments on commit 5c0bcd9

Please sign in to comment.