2017-04-01 11:05:22 +02:00
|
|
|
|
/************************************************************************
|
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
|
* *
|
|
|
|
|
* src/core/qgsvectorlayer.h *
|
|
|
|
|
* *
|
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
|
************************************************************************/
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-12-27 21:27:01 +00:00
|
|
|
|
|
|
|
|
|
typedef QList<int> QgsAttributeList;
|
|
|
|
|
typedef QSet<int> QgsAttributeIds;
|
|
|
|
|
|
2015-08-20 23:06:05 +10:00
|
|
|
|
|
2017-11-24 12:25:37 +01:00
|
|
|
|
class QgsVectorLayer : QgsMapLayer, QgsExpressionContextGenerator, QgsExpressionContextScopeGenerator, QgsFeatureSink, QgsFeatureSource
|
2007-01-09 02:39:15 +00:00
|
|
|
|
{
|
2017-03-27 14:41:33 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Represents a vector layer which manages a vector based data sets.
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
The QgsVectorLayer is instantiated by specifying the name of a data provider,
|
|
|
|
|
such as postgres or wfs, and url defining the specific data set to connect to.
|
|
|
|
|
The vector layer constructor in turn instantiates a QgsVectorDataProvider subclass
|
|
|
|
|
corresponding to the provider type, and passes it the url. The data provider
|
|
|
|
|
connects to the data source.
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
The QgsVectorLayer provides a common interface to the different data types. It also
|
|
|
|
|
manages editing transactions.
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Sample usage of the QgsVectorLayer class:
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-19 16:36:51 -04:00
|
|
|
|
.. code-block::
|
|
|
|
|
|
|
|
|
|
QString uri = "point?crs=epsg:4326&field=id:integer";
|
|
|
|
|
QgsVectorLayer *scratchLayer = new QgsVectorLayer(uri, "Scratch point layer", "memory");
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
The main data providers supported by QGIS are listed below.
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
\section providers Vector data providers
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
\subsection memory Memory data providerType (memory)
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
The memory data provider is used to construct in memory data, for example scratch
|
|
|
|
|
data or data generated from spatial operations such as contouring. There is no
|
|
|
|
|
inherent persistent storage of the data. The data source uri is constructed. The
|
|
|
|
|
url specifies the geometry type ("point", "linestring", "polygon",
|
|
|
|
|
"multipoint","multilinestring","multipolygon"), optionally followed by url parameters
|
|
|
|
|
as follows:
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
- crs=definition
|
|
|
|
|
Defines the coordinate reference system to use for the layer.
|
2017-12-19 11:43:52 -04:00
|
|
|
|
definition is any string accepted by :py:func:`QgsCoordinateReferenceSystem.createFromString()`
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
- index=yes
|
|
|
|
|
Specifies that the layer will be constructed with a spatial index
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
- field=name:type(length,precision)
|
|
|
|
|
Defines an attribute of the layer. Multiple field parameters can be added
|
|
|
|
|
to the data provider definition. type is one of "integer", "double", "string".
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
An example url is "Point?crs=epsg:4326&field=id:integer&field=name:string(20)&index=yes"
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
\subsection ogr OGR data provider (ogr)
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Accesses data using the OGR drivers (http://www.gdal.org/ogr/ogr_formats.html). The url
|
|
|
|
|
is the OGR connection string. A wide variety of data formats can be accessed using this
|
|
|
|
|
driver, including file based formats used by many GIS systems, database formats, and
|
|
|
|
|
web services. Some of these formats are also supported by custom data providers listed
|
|
|
|
|
below.
|
|
|
|
|
|
|
|
|
|
\subsection spatialite SpatiaLite data provider (spatialite)
|
|
|
|
|
|
|
|
|
|
Access data in a SpatiaLite database. The url defines the connection parameters, table,
|
|
|
|
|
geometry column, and other attributes. The url can be constructed using the
|
|
|
|
|
QgsDataSourceUri class.
|
|
|
|
|
|
|
|
|
|
\subsection postgres PostgreSQL data provider (postgres)
|
|
|
|
|
|
|
|
|
|
Connects to a PostgreSQL database. The url defines the connection parameters, table,
|
|
|
|
|
geometry column, and other attributes. The url can be constructed using the
|
|
|
|
|
QgsDataSourceUri class.
|
|
|
|
|
|
|
|
|
|
\subsection mssql Microsoft SQL server data provider (mssql)
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Connects to a Microsoft SQL server database. The url defines the connection parameters, table,
|
|
|
|
|
geometry column, and other attributes. The url can be constructed using the
|
|
|
|
|
QgsDataSourceUri class.
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
\subsection wfs WFS (web feature service) data provider (wfs)
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Used to access data provided by a web feature service.
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
The url can be a HTTP url to a WFS server (legacy, e.g. http://foobar/wfs?TYPENAME=xxx&SRSNAME=yyy[&FILTER=zzz]), or,
|
|
|
|
|
starting with QGIS 2.16, a URI constructed using the QgsDataSourceUri class with the following parameters :
|
|
|
|
|
- url=string (mandatory): HTTP url to a WFS server endpoint. e.g http://foobar/wfs
|
|
|
|
|
- typename=string (mandatory): WFS typename
|
|
|
|
|
- srsname=string (recommended): SRS like 'EPSG:XXXX'
|
|
|
|
|
- username=string
|
|
|
|
|
- password=string
|
|
|
|
|
- authcfg=string
|
|
|
|
|
- version=auto/1.0.0/1.1.0/2.0.0
|
|
|
|
|
-sql=string: full SELECT SQL statement with optional WHERE, ORDER BY and possibly with JOIN if supported on server
|
|
|
|
|
- filter=string: QGIS expression or OGC/FES filter
|
|
|
|
|
- restrictToRequestBBOX=1: to download only features in the view extent (or more generally
|
|
|
|
|
in the bounding box of the feature iterator)
|
|
|
|
|
- maxNumFeatures=number
|
|
|
|
|
- IgnoreAxisOrientation=1: to ignore EPSG axis order for WFS 1.1 or 2.0
|
|
|
|
|
- InvertAxisOrientation=1: to invert axis order
|
|
|
|
|
- hideDownloadProgressDialog=1: to hide the download progress dialog
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
The ‘FILTER’ query string parameter can be used to filter
|
|
|
|
|
the WFS feature type. The ‘FILTER’ key value can either be a QGIS expression
|
|
|
|
|
or an OGC XML filter. If the value is set to a QGIS expression the driver will
|
|
|
|
|
turn it into OGC XML filter before passing it to the WFS server. Beware the
|
|
|
|
|
QGIS expression filter only supports” =, !=, <, >, <=, >=, AND, OR, NOT, LIKE, IS NULL”
|
|
|
|
|
attribute operators, “BBOX, Disjoint, Intersects, Touches, Crosses, Contains, Overlaps, Within”
|
|
|
|
|
spatial binary operators and the QGIS local “geomFromWKT, geomFromGML”
|
|
|
|
|
geometry constructor functions.
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Also note:
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
- You can use various functions available in the QGIS Expression list,
|
|
|
|
|
however the function must exist server side and have the same name and arguments to work.
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
- Use the special $geometry parameter to provide the layer geometry column as input
|
|
|
|
|
into the spatial binary operators e.g intersects($geometry, geomFromWKT('POINT (5 6)'))
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
\subsection delimitedtext Delimited text file data provider (delimitedtext)
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Accesses data in a delimited text file, for example CSV files generated by
|
|
|
|
|
spreadsheets. The contents of the file are split into columns based on specified
|
|
|
|
|
delimiter characters. Each record may be represented spatially either by an
|
|
|
|
|
X and Y coordinate column, or by a WKT (well known text) formatted columns.
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
The url defines the filename, the formatting options (how the
|
|
|
|
|
text in the file is divided into data fields, and which fields contain the
|
|
|
|
|
X,Y coordinates or WKT text definition. The options are specified as url query
|
|
|
|
|
items.
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
At its simplest the url can just be the filename, in which case it will be loaded
|
|
|
|
|
as a CSV formatted file.
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
The url may include the following items:
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
- encoding=UTF-8
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Defines the character encoding in the file. The default is UTF-8. To use
|
|
|
|
|
the default encoding for the operating system use "System".
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
- type=(csv|regexp|whitespace|plain)
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Defines the algorithm used to split records into columns. Records are
|
|
|
|
|
defined by new lines, except for csv format files for which quoted fields
|
|
|
|
|
may span multiple records. The default type is csv.
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
- "csv" splits the file based on three sets of characters:
|
|
|
|
|
delimiter characters, quote characters,
|
|
|
|
|
and escape characters. Delimiter characters mark the end
|
|
|
|
|
of a field. Quote characters enclose a field which can contain
|
|
|
|
|
delimiter characters, and newlines. Escape characters cause the
|
|
|
|
|
following character to be treated literally (including delimiter,
|
|
|
|
|
quote, and newline characters). Escape and quote characters must
|
|
|
|
|
be different from delimiter characters. Escape characters that are
|
|
|
|
|
also quote characters are treated specially - they can only
|
|
|
|
|
escape themselves within quotes. Elsewhere they are treated as
|
|
|
|
|
quote characters. The defaults for delimiter, quote, and escape
|
|
|
|
|
are ',', '"', '"'.
|
|
|
|
|
- "regexp" splits each record using a regular expression (see QRegExp
|
|
|
|
|
documentation for details).
|
|
|
|
|
- "whitespace" splits each record based on whitespace (on or more whitespace
|
|
|
|
|
characters. Leading whitespace in the record is ignored.
|
|
|
|
|
- "plain" is provided for backwards compatibility. It is equivalent to
|
|
|
|
|
CSV except that the default quote characters are single and double quotes,
|
|
|
|
|
and there is no escape characters.
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
- delimiter=characters
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Defines the delimiter characters used for csv and plain type files, or the
|
|
|
|
|
regular expression for regexp type files. It is a literal string of characters
|
|
|
|
|
except that "\t" may be used to represent a tab character.
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
- quote=characters
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Defines the characters that are used as quote characters for csv and plain type
|
|
|
|
|
files.
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
- escape=characters
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Defines the characters used to escape delimiter, quote, and newline characters.
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
- skipLines=n
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Defines the number of lines to ignore at the beginning of the file (default 0)
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
- useHeader=(yes|no)
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Defines whether the first record in the file (after skipped lines) contains
|
|
|
|
|
column names (default yes)
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
- trimFields=(yes|no)
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
If yes then leading and trailing whitespace will be removed from fields
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
- skipEmptyFields=(yes|no)
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
If yes then empty fields will be discarded (equivalent to concatenating consecutive
|
|
|
|
|
delimiters)
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
- maxFields=#
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Specifies the maximum number of fields to load for each record. Additional
|
|
|
|
|
fields will be discarded. Default is 0 - load all fields.
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
- decimalPoint=c
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Defines a character that is used as a decimal point in the numeric columns
|
|
|
|
|
The default is '.'.
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
- xField=column yField=column
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Defines the name of the columns holding the x and y coordinates for XY point geometries.
|
|
|
|
|
If the useHeader is no (ie there are no column names), then this is the column
|
|
|
|
|
number (with the first column as 1).
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
- xyDms=(yes|no)
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
If yes then the X and Y coordinates are interpreted as
|
|
|
|
|
degrees/minutes/seconds format (fairly permissively),
|
|
|
|
|
or degree/minutes format.
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
- wktField=column
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Defines the name of the columns holding the WKT geometry definition for WKT geometries.
|
|
|
|
|
If the useHeader is no (ie there are no column names), then this is the column
|
|
|
|
|
number (with the first column as 1).
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
- geomType=(point|line|polygon|none)
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Defines the geometry type for WKT type geometries. QGIS will only display one
|
|
|
|
|
type of geometry for the layer - any others will be ignored when the file is
|
|
|
|
|
loaded. By default the provider uses the type of the first geometry in the file.
|
|
|
|
|
Use geomType to override this type.
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
geomType can also be set to none, in which case the layer is loaded without
|
|
|
|
|
geometries.
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
- subset=expression
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Defines an expression that will identify a subset of records to display
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
- crs=crsstring
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Defines the coordinate reference system used for the layer. This can be
|
2017-12-19 11:43:52 -04:00
|
|
|
|
any string accepted by :py:func:`QgsCoordinateReferenceSystem.createFromString()`
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
-subsetIndex=(yes|no)
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Determines whether the provider generates an index to improve the efficiency
|
|
|
|
|
of subsets. The default is yes
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
-spatialIndex=(yes|no)
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Determines whether the provider generates a spatial index. The default is no.
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
-watchFile=(yes|no)
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Defines whether the file will be monitored for changes. The default is
|
|
|
|
|
to monitor for changes.
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
- quiet
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Errors encountered loading the file will not be reported in a user dialog if
|
|
|
|
|
quiet is included (They will still be shown in the output log).
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
\subsection gpx GPX data provider (gpx)
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Provider reads tracks, routes, and waypoints from a GPX file. The url
|
|
|
|
|
defines the name of the file, and the type of data to retrieve from it
|
|
|
|
|
("track", "route", or "waypoint").
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
An example url is "/home/user/data/holiday.gpx?type=route"
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
\subsection grass Grass data provider (grass)
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Provider to display vector data in a GRASS GIS layer.
|
|
|
|
|
|
|
|
|
|
TODO QGIS3: Remove virtual from non-inherited methods (like isModified)
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:class:`QgsVectorLayerUtils`
|
2017-03-27 14:41:33 +02:00
|
|
|
|
%End
|
|
|
|
|
|
2007-01-09 02:39:15 +00:00
|
|
|
|
%TypeHeaderCode
|
handling vector data geometry and attribute updates refactored
QgsVectorLayer:
- move attribute part of editing to vector layer class and unify with geometry handling:
* remove commitAttributeChanges(), addedFeatures(), deletedFeatureIds(), changedAttributes()
and replace with changeAttributeValue(), deleteFeature(), addAttribute()
and deleteAttribute()
* add pendingFields(), pendingAttributeList(), pendingFeatureCount()
* emit signals on start editing and commit, change of attribute values, adding/deleting of
attributes and layer or feature removal (currently used in the attribute table)
- new commitErrors() method to query errors from commitChanges()
- replaced featuresInRectangle with select/getNextFeature combo
- edit types added to support more input widgets and input constraints
QgsFeature:
- remove update aware ctor
- unify geometry handling in ctors
QgsVectorDataProvider:
- add QVariant::Type to supportNativeTypes()
QgisApp:
- add instance() method to query QgisApp object
- replace code at various place to use it instead of passing the pointer
arround or searching it in the widget tree.
- move toggleEditing() code from the legend here
QgsAttributeTable/QgsAttributeTableDisplay:
- move attribute table creation legend here
- make attribute table dockable (from Tim)
- most editing logic moved to QgsVectorLayer
- adding/deleting attributes moved to QgsVectorLayerProperties
QgsIdentifyResults:
- add support for attribute editing when it edit mode
QgsVectorLayerProperties:
add a new tab to show attribute list:
* start/stop editing
* add/delete attributes
* assign edit type to attributes (unique values, value map, ranges)
QgsAttributeDialog:
add support for attribute edit types:
* selection from unique value render classes (combobox)
* selection from unique values of existing features (combobox or line edits with completion)
* spinboxes for ranges
QgsPostgresProvider:
- use read-only connection for cursors and read-write connection for updates
- updated native types
QgsOgrProvider:
- remove unused references to GEOS geometry factory
- updated native types
git-svn-id: http://svn.osgeo.org/qgis/trunk@9092 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-08-20 12:15:14 +00:00
|
|
|
|
#include "qgsvectorlayer.h"
|
2007-01-09 02:39:15 +00:00
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
public:
|
2016-02-14 03:50:23 +01:00
|
|
|
|
|
2016-01-27 20:11:26 +11:00
|
|
|
|
enum EditResult
|
|
|
|
|
{
|
2017-03-27 09:23:03 +02:00
|
|
|
|
Success,
|
|
|
|
|
EmptyGeometry,
|
|
|
|
|
EditFailed,
|
|
|
|
|
FetchFeatureFailed,
|
|
|
|
|
InvalidLayer,
|
2016-01-27 20:11:26 +11:00
|
|
|
|
};
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2016-12-19 10:52:29 +01:00
|
|
|
|
enum SelectBehavior
|
2016-05-19 06:36:20 +10:00
|
|
|
|
{
|
2017-03-27 09:23:03 +02:00
|
|
|
|
SetSelection,
|
|
|
|
|
AddToSelection,
|
|
|
|
|
IntersectSelection,
|
|
|
|
|
RemoveFromSelection,
|
2016-05-19 06:36:20 +10:00
|
|
|
|
};
|
|
|
|
|
|
2017-11-04 07:54:31 +10:00
|
|
|
|
struct LayerOptions
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
explicit LayerOptions( bool loadDefaultStyle = true, bool readExtentFromXml = false );
|
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Constructor for LayerOptions.
|
2017-11-04 07:54:31 +10:00
|
|
|
|
%End
|
|
|
|
|
|
|
|
|
|
bool loadDefaultStyle;
|
|
|
|
|
|
|
|
|
|
bool readExtentFromXml;
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
explicit QgsVectorLayer( const QString &path = QString(), const QString &baseName = QString(),
|
|
|
|
|
const QString &providerLib = "ogr", const QgsVectorLayer::LayerOptions &options = QgsVectorLayer::LayerOptions() );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Constructor - creates a vector layer
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
The QgsVectorLayer is constructed by instantiating a data provider. The provider
|
|
|
|
|
interprets the supplied path (url) of the data source to connect to and access the
|
|
|
|
|
data.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param path: The path or url of the parameter. Typically this encodes
|
|
|
|
|
parameters used by the data provider as url query items.
|
|
|
|
|
:param baseName: The name used to represent the layer in the legend
|
|
|
|
|
:param providerLib: The name of the data provider, e.g., "memory", "postgres"
|
|
|
|
|
:param options: layer load options
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-12-15 08:57:22 +10:00
|
|
|
|
~QgsVectorLayer();
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2017-04-26 11:31:56 +02:00
|
|
|
|
|
2017-05-17 08:53:52 +02:00
|
|
|
|
virtual QgsVectorLayer *clone() const /Factory/;
|
2017-12-15 08:57:22 +10:00
|
|
|
|
|
2017-05-16 13:34:18 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Returns a new instance equivalent to this one. A new provider is
|
|
|
|
|
created for the same data source and renderers for features and diagrams
|
|
|
|
|
are cloned too. Moreover, each attributes (transparency, extent, selected
|
|
|
|
|
features and so on) are identicals.
|
|
|
|
|
|
|
|
|
|
:return: a new layer instance
|
|
|
|
|
|
2017-05-16 13:34:18 +02:00
|
|
|
|
.. versionadded:: 3.0
|
|
|
|
|
%End
|
|
|
|
|
|
2012-08-28 22:32:17 +02:00
|
|
|
|
QString storageType() const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Returns the permanent storage type for this layer as a friendly name.
|
|
|
|
|
This is obtained from the data provider and does not follow any standard.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
handling vector data geometry and attribute updates refactored
QgsVectorLayer:
- move attribute part of editing to vector layer class and unify with geometry handling:
* remove commitAttributeChanges(), addedFeatures(), deletedFeatureIds(), changedAttributes()
and replace with changeAttributeValue(), deleteFeature(), addAttribute()
and deleteAttribute()
* add pendingFields(), pendingAttributeList(), pendingFeatureCount()
* emit signals on start editing and commit, change of attribute values, adding/deleting of
attributes and layer or feature removal (currently used in the attribute table)
- new commitErrors() method to query errors from commitChanges()
- replaced featuresInRectangle with select/getNextFeature combo
- edit types added to support more input widgets and input constraints
QgsFeature:
- remove update aware ctor
- unify geometry handling in ctors
QgsVectorDataProvider:
- add QVariant::Type to supportNativeTypes()
QgisApp:
- add instance() method to query QgisApp object
- replace code at various place to use it instead of passing the pointer
arround or searching it in the widget tree.
- move toggleEditing() code from the legend here
QgsAttributeTable/QgsAttributeTableDisplay:
- move attribute table creation legend here
- make attribute table dockable (from Tim)
- most editing logic moved to QgsVectorLayer
- adding/deleting attributes moved to QgsVectorLayerProperties
QgsIdentifyResults:
- add support for attribute editing when it edit mode
QgsVectorLayerProperties:
add a new tab to show attribute list:
* start/stop editing
* add/delete attributes
* assign edit type to attributes (unique values, value map, ranges)
QgsAttributeDialog:
add support for attribute edit types:
* selection from unique value render classes (combobox)
* selection from unique values of existing features (combobox or line edits with completion)
* spinboxes for ranges
QgsPostgresProvider:
- use read-only connection for cursors and read-write connection for updates
- updated native types
QgsOgrProvider:
- remove unused references to GEOS geometry factory
- updated native types
git-svn-id: http://svn.osgeo.org/qgis/trunk@9092 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-08-20 12:15:14 +00:00
|
|
|
|
|
2012-08-28 22:32:17 +02:00
|
|
|
|
QString capabilitiesString() const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Capabilities for this layer, comma separated and translated.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
|
|
|
|
QString dataComment() const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Returns a description for this layer as defined in the data provider.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2016-08-02 16:58:58 +02:00
|
|
|
|
QString displayField() const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
This is a shorthand for accessing the displayExpression if it is a simple field.
|
|
|
|
|
If the displayExpression is more complex than a simple field, a null string will
|
|
|
|
|
be returned.
|
|
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
|
.. seealso:: :py:func:`displayExpression`
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
void setDisplayExpression( const QString &displayExpression );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Set the preview expression, used to create a human readable preview string.
|
2017-12-19 11:43:52 -04:00
|
|
|
|
Used e.g. in the attribute table feature list. Uses :py:class:`QgsExpression`.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param displayExpression: The expression which will be used to preview features
|
|
|
|
|
for this layer
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2016-07-11 12:06:06 +10:00
|
|
|
|
QString displayExpression() const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Get the preview expression, used to create a human readable preview string.
|
2017-12-19 11:43:52 -04:00
|
|
|
|
Uses :py:class:`QgsExpression`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
|
|
|
|
:return: The expression which will be used to preview features for this layer
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2013-05-29 21:38:33 +02:00
|
|
|
|
|
2017-04-18 11:11:36 +10:00
|
|
|
|
virtual QgsVectorDataProvider *dataProvider();
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2017-04-20 13:48:50 +02:00
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
void setProviderEncoding( const QString &encoding );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
|
|
|
|
Sets the textencoding of the data provider
|
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
|
|
|
|
void setCoordinateSystem();
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
|
|
|
|
Setup the coordinate system transformation for the layer
|
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
bool addJoin( const QgsVectorLayerJoinInfo &joinInfo );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Joins another vector layer to this layer
|
|
|
|
|
|
2017-12-15 21:36:08 -04:00
|
|
|
|
:param joinInfo: join object containing join layer id, target and source field
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2017-04-02 20:52:50 +10:00
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
|
|
since 2.6 returns bool indicating whether the join can be added *
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
bool removeJoin( const QString &joinLayerId );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Removes a vector layer join
|
|
|
|
|
|
2017-04-07 11:23:53 +10:00
|
|
|
|
:return: true if join was found and successfully removed *
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
QgsVectorLayerJoinBuffer *joinBuffer();
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Accessor to the join buffer object
|
|
|
|
|
|
2017-04-03 01:31:44 +02:00
|
|
|
|
.. versionadded:: 2.14.7
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-01-30 15:33:18 +08:00
|
|
|
|
const QList<QgsVectorLayerJoinInfo> vectorJoins() const;
|
2009-06-26 17:04:31 +00:00
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
virtual bool setDependencies( const QSet<QgsMapLayerDependency> &layers );
|
2017-12-15 08:57:22 +10:00
|
|
|
|
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Sets the list of dependencies.
|
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`dependencies`
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-12-19 11:43:52 -04:00
|
|
|
|
:param layers: set of :py:class:`QgsMapLayerDependency`. Only user-defined dependencies will be added
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
|
|
|
|
:return: false if a dependency cycle has been detected
|
|
|
|
|
|
2017-04-03 01:31:44 +02:00
|
|
|
|
.. versionadded:: 3.0
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2016-08-31 09:18:45 +02:00
|
|
|
|
virtual QSet<QgsMapLayerDependency> dependencies() const;
|
2017-12-15 08:57:22 +10:00
|
|
|
|
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2018-01-09 17:26:37 -04:00
|
|
|
|
Gets the list of dependencies. This includes data dependencies set by the user (:py:func:`setDataDependencies`)
|
2017-12-15 10:36:55 -04:00
|
|
|
|
as well as dependencies given by the provider
|
|
|
|
|
|
2017-12-19 11:43:52 -04:00
|
|
|
|
:return: a set of :py:class:`QgsMapLayerDependency`
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-04-03 01:31:44 +02:00
|
|
|
|
.. versionadded:: 3.0
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2016-07-21 11:21:28 +02:00
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
int addExpressionField( const QString &exp, const QgsField &fld );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Add a new field which is calculated by the expression specified
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param exp: The expression which calculates the field
|
|
|
|
|
:param fld: The field to calculate
|
|
|
|
|
|
|
|
|
|
:return: The index of the new field
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
|
|
|
|
|
2017-04-03 01:31:44 +02:00
|
|
|
|
.. versionadded:: 2.9
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2014-05-26 10:29:53 +02:00
|
|
|
|
void removeExpressionField( int index );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Remove an expression field
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param index: The index of the field
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-04-03 01:31:44 +02:00
|
|
|
|
.. versionadded:: 2.6
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2014-05-26 10:29:53 +02:00
|
|
|
|
|
2016-07-11 12:06:06 +10:00
|
|
|
|
QString expressionField( int index ) const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Returns the expression used for a given expression field
|
|
|
|
|
|
|
|
|
|
:param index: An index of an epxression based (virtual) field
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:return: The expression for the field at index
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
|
|
|
|
|
2017-04-03 01:31:44 +02:00
|
|
|
|
.. versionadded:: 2.9
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2015-03-24 11:37:56 +01:00
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
void updateExpressionField( int index, const QString &exp );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Changes the expression used to define an expression based (virtual) field
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param index: The index of the expression to change
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param exp: The new expression to set
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-04-03 01:31:44 +02:00
|
|
|
|
.. versionadded:: 2.9
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
|
|
|
|
QgsActionManager *actions();
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Get all layer actions defined on this layer.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
The pointer which is returned directly points to the actions object
|
|
|
|
|
which is used by the layer, so any changes are immediately applied.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2017-05-17 13:19:56 +02:00
|
|
|
|
|
2016-08-06 15:44:34 +02:00
|
|
|
|
int selectedFeatureCount() const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
The number of features that are selected in this layer
|
|
|
|
|
|
|
|
|
|
:return: See description
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2016-05-19 12:30:32 +10:00
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
void selectByRect( QgsRectangle &rect, SelectBehavior behavior = SetSelection );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Select features found within the search rectangle (in layer's coordinates)
|
2017-12-15 21:36:08 -04:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param rect: search rectangle
|
|
|
|
|
:param behavior: selection type, allows adding to current selection, removing
|
|
|
|
|
from selection, etc.
|
|
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
|
.. seealso:: :py:func:`invertSelectionInRectangle`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`selectByExpression`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`selectByIds`
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
|
|
|
|
void selectByExpression( const QString &expression, SelectBehavior behavior = SetSelection );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Select matching features using an expression.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param expression: expression to evaluate to select features
|
|
|
|
|
:param behavior: selection type, allows adding to current selection, removing
|
|
|
|
|
from selection, etc.
|
|
|
|
|
|
2017-04-03 01:31:44 +02:00
|
|
|
|
.. versionadded:: 2.16
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`selectByRect`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`selectByIds`
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2016-12-19 10:52:29 +01:00
|
|
|
|
void selectByIds( const QgsFeatureIds &ids, SelectBehavior behavior = SetSelection );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Select matching features using a list of feature IDs. Will emit the
|
|
|
|
|
selectionChanged() signal with the clearAndSelect flag set.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param ids: feature IDs to select
|
|
|
|
|
:param behavior: selection type, allows adding to current selection, removing
|
|
|
|
|
from selection, etc.
|
|
|
|
|
|
2017-04-03 01:31:44 +02:00
|
|
|
|
.. versionadded:: 2.16
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`selectByRect`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`selectByExpression`
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2016-05-19 12:30:32 +10:00
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
void modifySelection( const QgsFeatureIds &selectIds, const QgsFeatureIds &deselectIds );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Modifies the current selection on this layer
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param selectIds: Select these ids
|
|
|
|
|
:param deselectIds: Deselect these ids
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
|
.. seealso:: :py:func:`select`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
|
.. seealso:: :py:func:`select`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
|
.. seealso:: :py:func:`deselect`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
|
.. seealso:: :py:func:`deselect`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`selectByExpression`
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2012-08-28 22:32:17 +02:00
|
|
|
|
void invertSelection();
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
|
|
|
|
Select not selected features and deselect selected ones
|
|
|
|
|
%End
|
2013-05-29 21:38:33 +02:00
|
|
|
|
|
2013-05-22 11:34:25 +02:00
|
|
|
|
void selectAll();
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
|
|
|
|
Select all the features
|
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
void invertSelectionInRectangle( QgsRectangle &rect );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Invert selection of features found within the search rectangle (in layer's coordinates)
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param rect: The rectangle in which the selection of features will be inverted
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`invertSelection`
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2016-07-11 12:06:06 +10:00
|
|
|
|
QgsFeatureList selectedFeatures() const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Get a copy of the user-selected features
|
|
|
|
|
|
2017-12-19 11:43:52 -04:00
|
|
|
|
:return: A list of :py:class:`QgsFeature`
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`selectedFeatureIds`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`getSelectedFeatures`
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2017-04-27 11:16:10 +10:00
|
|
|
|
QgsFeatureIterator getSelectedFeatures( QgsFeatureRequest request = QgsFeatureRequest() ) const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Get an iterator of the selected features
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param request: You may specify a request, e.g. to limit the set of requested attributes.
|
|
|
|
|
Any filter on the request will be discarded.
|
|
|
|
|
|
|
|
|
|
:return: Iterator over the selected features
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`selectedFeatureIds`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`selectedFeatures`
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2014-09-22 18:34:37 +02:00
|
|
|
|
|
2016-12-06 09:38:05 +01:00
|
|
|
|
const QgsFeatureIds &selectedFeatureIds() const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Return reference to identifiers of selected features
|
|
|
|
|
|
2017-12-19 11:43:52 -04:00
|
|
|
|
:return: A list of :py:class:`QgsFeatureId`
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`selectedFeatures`
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2016-07-11 12:06:06 +10:00
|
|
|
|
QgsRectangle boundingBoxOfSelected() const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
|
|
|
|
Returns the bounding box of the selected features. If there is no selection, QgsRectangle(0,0,0,0) is returned
|
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2015-04-13 20:45:32 +10:00
|
|
|
|
bool labelsEnabled() const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Returns whether the layer contains labels which are enabled and should be drawn.
|
|
|
|
|
|
|
|
|
|
:return: true if layer contains enabled labels
|
|
|
|
|
|
2017-04-03 01:31:44 +02:00
|
|
|
|
.. versionadded:: 2.9
|
2018-01-19 13:41:08 +10:00
|
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`setLabelsEnabled`
|
|
|
|
|
%End
|
|
|
|
|
|
|
|
|
|
void setLabelsEnabled( bool enabled );
|
|
|
|
|
%Docstring
|
|
|
|
|
Sets whether labels should be ``enabled`` for the layer.
|
|
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
|
|
Labels will only be rendered if labelsEnabled() is true and a labeling
|
|
|
|
|
object is returned by labeling().
|
|
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`labelsEnabled`
|
|
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`labeling`
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2015-04-13 20:45:32 +10:00
|
|
|
|
|
2015-04-09 17:50:18 +10:00
|
|
|
|
bool diagramsEnabled() const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Returns whether the layer contains diagrams which are enabled and should be drawn.
|
|
|
|
|
|
|
|
|
|
:return: true if layer contains enabled diagrams
|
|
|
|
|
|
2017-04-03 01:31:44 +02:00
|
|
|
|
.. versionadded:: 2.9
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2015-04-09 17:50:18 +10:00
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
void setDiagramRenderer( QgsDiagramRenderer *r /Transfer/ );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
|
|
|
|
Sets diagram rendering object (takes ownership)
|
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
const QgsDiagramRenderer *diagramRenderer() const;
|
2012-09-24 02:28:15 +02:00
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
void setDiagramLayerSettings( const QgsDiagramLayerSettings &s );
|
2012-09-24 02:28:15 +02:00
|
|
|
|
const QgsDiagramLayerSettings *diagramLayerSettings() const;
|
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
QgsFeatureRenderer *renderer();
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
|
|
|
|
Return renderer.
|
|
|
|
|
%End
|
2016-02-14 03:50:23 +01:00
|
|
|
|
|
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
void setRenderer( QgsFeatureRenderer *r /Transfer/ );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Set renderer which will be invoked to represent this layer.
|
|
|
|
|
Ownership is transferred.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2016-08-04 09:10:08 +02:00
|
|
|
|
QgsWkbTypes::GeometryType geometryType() const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
|
|
|
|
Returns point, line or polygon
|
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2017-05-24 10:23:05 +10:00
|
|
|
|
virtual QgsWkbTypes::Type wkbType() const;
|
|
|
|
|
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
|
|
|
|
Returns the WKBType or WKBUnknown in case of error
|
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
|
|
|
|
QString providerType() const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
|
|
|
|
Return the provider type for this layer
|
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2017-05-24 10:23:05 +10:00
|
|
|
|
virtual QgsCoordinateReferenceSystem sourceCrs() const;
|
|
|
|
|
|
2017-06-26 12:09:39 +10:00
|
|
|
|
virtual QString sourceName() const;
|
|
|
|
|
|
2017-05-24 10:23:05 +10:00
|
|
|
|
|
2018-02-06 13:37:28 -04:00
|
|
|
|
virtual bool readXml( const QDomNode &layer_node, QgsReadWriteContext &context );
|
2017-12-15 08:57:22 +10:00
|
|
|
|
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Reads vector layer specific state from project file Dom node.
|
|
|
|
|
|
2017-04-02 20:52:50 +10:00
|
|
|
|
.. note::
|
|
|
|
|
|
2017-12-19 11:43:52 -04:00
|
|
|
|
Called by :py:func:`QgsMapLayer.readXml()`
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2017-05-12 17:31:01 +08:00
|
|
|
|
virtual bool writeXml( QDomNode &layer_node, QDomDocument &doc, const QgsReadWriteContext &context ) const;
|
2017-12-15 08:57:22 +10:00
|
|
|
|
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Write vector layer specific state to project file Dom node.
|
|
|
|
|
|
2017-04-02 20:52:50 +10:00
|
|
|
|
.. note::
|
|
|
|
|
|
2017-12-19 11:43:52 -04:00
|
|
|
|
Called by :py:func:`QgsMapLayer.writeXml()`
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2017-07-29 12:16:07 +02:00
|
|
|
|
virtual void resolveReferences( QgsProject *project );
|
2017-12-15 08:57:22 +10:00
|
|
|
|
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Resolve references to other layers (kept as layer IDs after reading XML) into layer objects.
|
|
|
|
|
|
2017-04-03 01:31:44 +02:00
|
|
|
|
.. versionadded:: 3.0
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
|
|
|
|
virtual void saveStyleToDatabase( const QString &name, const QString &description,
|
|
|
|
|
bool useAsDefault, const QString &uiFileContent,
|
2016-10-18 22:29:07 +02:00
|
|
|
|
QString &msgError /Out/ );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Save named and sld style of the layer to the style table in the db.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param name:
|
|
|
|
|
:param description:
|
|
|
|
|
:param useAsDefault:
|
|
|
|
|
:param uiFileContent:
|
|
|
|
|
:param msgError:
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2013-05-03 00:23:23 +02:00
|
|
|
|
|
2016-01-20 14:36:20 +02:00
|
|
|
|
virtual int listStylesInDatabase( QStringList &ids /Out/, QStringList &names /Out/,
|
|
|
|
|
QStringList &descriptions /Out/, QString &msgError /Out/ );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Lists all the style in db split into related to the layer and not related to
|
2017-12-15 21:36:08 -04:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param ids: the list in which will be stored the style db ids
|
|
|
|
|
:param names: the list in which will be stored the style names
|
|
|
|
|
:param descriptions: the list in which will be stored the style descriptions
|
|
|
|
|
:param msgError:
|
|
|
|
|
|
|
|
|
|
:return: the number of styles related to current layer
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2013-05-03 00:23:23 +02:00
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
virtual QString getStyleFromDatabase( const QString &styleId, QString &msgError /Out/ );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Will return the named style corresponding to style id provided
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
|
|
|
|
virtual bool deleteStyleFromDatabase( const QString &styleId, QString &msgError /Out/ );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Delete a style from the database
|
|
|
|
|
|
|
|
|
|
:param styleId: the provider's layer_styles table id of the style to delete
|
|
|
|
|
:param msgError: reference to string that will be updated with any error messages
|
|
|
|
|
|
|
|
|
|
:return: true in case of success
|
2017-12-16 10:38:54 -04:00
|
|
|
|
|
|
|
|
|
.. versionadded:: 3.0
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2017-02-21 18:14:58 +01:00
|
|
|
|
virtual QString loadNamedStyle( const QString &theURI, bool &resultFlag /Out/, bool loadFromLocalDb );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Load a named style from file/local db/datasource db
|
2017-12-15 21:36:08 -04:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param theURI: the URI of the style or the URI of the layer
|
|
|
|
|
:param resultFlag: will be set to true if a named style is correctly loaded
|
|
|
|
|
:param loadFromLocalDb: if true forces to load from local db instead of datasource one
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2013-05-29 21:38:33 +02:00
|
|
|
|
|
2017-02-21 18:14:58 +01:00
|
|
|
|
virtual QString loadNamedStyle( const QString &theURI, bool &resultFlag /Out/ );
|
2017-12-15 08:57:22 +10:00
|
|
|
|
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Calls loadNamedStyle( theURI, resultFlag, false );
|
|
|
|
|
Retained for backward compatibility
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2013-05-29 21:38:33 +02:00
|
|
|
|
|
2017-09-07 09:20:49 +01:00
|
|
|
|
bool loadAuxiliaryLayer( const QgsAuxiliaryStorage &storage, const QString &key = QString() );
|
2017-08-29 04:23:26 +01:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Loads the auxiliary layer for this vector layer. If there's no
|
|
|
|
|
corresponding table in the database, then nothing happens and false is
|
|
|
|
|
returned. The key is optional because if this layer has been read from
|
|
|
|
|
a XML document, then the key read in this document is used by default.
|
|
|
|
|
|
|
|
|
|
:param storage: The auxiliary storage where to look for the table
|
|
|
|
|
:param key: The key to use for joining.
|
2017-08-29 04:23:26 +01:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:return: true if the auxiliary layer is well loaded, false otherwise
|
2017-08-29 04:23:26 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. versionadded:: 3.0
|
|
|
|
|
%End
|
|
|
|
|
|
2017-08-30 14:16:45 +01:00
|
|
|
|
void setAuxiliaryLayer( QgsAuxiliaryLayer *layer /Transfer/ = 0 );
|
2017-08-29 04:23:26 +01:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Sets the current auxiliary layer. The auxiliary layer is automatically
|
|
|
|
|
put in editable mode and fields are updated. Moreover, a join is created
|
|
|
|
|
between the current layer and the auxiliary layer. Ownership is
|
|
|
|
|
transferred.
|
2017-08-29 04:23:26 +01:00
|
|
|
|
|
|
|
|
|
.. versionadded:: 3.0
|
|
|
|
|
%End
|
|
|
|
|
|
|
|
|
|
QgsAuxiliaryLayer *auxiliaryLayer();
|
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Returns the current auxiliary layer.
|
|
|
|
|
|
2017-08-29 04:23:26 +01:00
|
|
|
|
.. versionadded:: 3.0
|
|
|
|
|
%End
|
|
|
|
|
|
|
|
|
|
|
2018-02-06 13:37:28 -04:00
|
|
|
|
virtual bool readSymbology( const QDomNode &layerNode, QString &errorMessage, QgsReadWriteContext &context );
|
2017-04-20 13:48:50 +02:00
|
|
|
|
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Read the symbology for the current layer from the Dom node supplied.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param layerNode: node that will contain the symbology definition for this layer.
|
|
|
|
|
:param errorMessage: reference to string that will be updated with any error messages
|
|
|
|
|
:param context: reading context (used for transform from relative to absolute paths)
|
|
|
|
|
|
|
|
|
|
:return: true in case of success.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2018-02-06 13:37:28 -04:00
|
|
|
|
virtual bool readStyle( const QDomNode &node, QString &errorMessage, QgsReadWriteContext &context );
|
2017-04-20 13:48:50 +02:00
|
|
|
|
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Read the style for the current layer from the Dom node supplied.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param node: node that will contain the style definition for this layer.
|
|
|
|
|
:param errorMessage: reference to string that will be updated with any error messages
|
|
|
|
|
:param context: reading context (used for transform from relative to absolute paths)
|
|
|
|
|
|
|
|
|
|
:return: true in case of success.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2017-05-12 17:31:01 +08:00
|
|
|
|
virtual bool writeSymbology( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsReadWriteContext &context ) const;
|
2017-04-20 13:48:50 +02:00
|
|
|
|
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Write the symbology for the layer into the docment provided.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param node: the node that will have the style element added to it.
|
|
|
|
|
:param doc: the document that will have the QDomNode added.
|
|
|
|
|
:param errorMessage: reference to string that will be updated with any error messages
|
|
|
|
|
:param context: writing context (used for transform from absolute to relative paths)
|
|
|
|
|
|
|
|
|
|
:return: true in case of success.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2017-05-12 17:31:01 +08:00
|
|
|
|
virtual bool writeStyle( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsReadWriteContext &context ) const;
|
2017-04-20 13:48:50 +02:00
|
|
|
|
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Write just the style information for the layer into the document
|
2017-12-15 21:36:08 -04:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param node: the node that will have the style element added to it.
|
|
|
|
|
:param doc: the document that will have the QDomNode added.
|
|
|
|
|
:param errorMessage: reference to string that will be updated with any error messages
|
|
|
|
|
:param context: writing context (used for transform from absolute to relative paths)
|
|
|
|
|
|
|
|
|
|
:return: true in case of success.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2017-03-27 14:41:33 +02:00
|
|
|
|
bool writeSld( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsStringMap &props = QgsStringMap() ) const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Writes the symbology of the layer into the document provided in SLD 1.1 format
|
2017-12-15 21:36:08 -04:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param node: the node that will have the style element added to it.
|
|
|
|
|
:param doc: the document that will have the QDomNode added.
|
|
|
|
|
:param errorMessage: reference to string that will be updated with any error messages
|
|
|
|
|
:param props: a open ended set of properties that can drive/inform the SLD encoding
|
|
|
|
|
|
|
|
|
|
:return: true in case of success
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-04-18 11:00:13 +10:00
|
|
|
|
virtual bool readSld( const QDomNode &node, QString &errorMessage );
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2017-04-20 13:48:50 +02:00
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
long featureCount( const QString &legendKey ) const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Number of features rendered with specified legend key. Features must be first
|
|
|
|
|
calculated by countSymbolFeatures()
|
|
|
|
|
|
|
|
|
|
:return: number of features rendered by symbol or -1 if failed or counts are not available
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
|
|
|
|
void setDataSource( const QString &dataSource, const QString &baseName, const QString &provider, bool loadDefaultStyleFlag = false );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Update the data source of the layer. The layer's renderer and legend will be preserved only
|
|
|
|
|
if the geometry type of the new data source matches the current geometry type of the layer.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param dataSource: new layer data source
|
|
|
|
|
:param baseName: base name of the layer
|
|
|
|
|
:param provider: provider string
|
|
|
|
|
:param loadDefaultStyleFlag: set to true to reset the layer's style to the default for the
|
|
|
|
|
data source
|
|
|
|
|
|
2017-04-03 01:31:44 +02:00
|
|
|
|
.. versionadded:: 2.10
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2017-09-14 13:03:56 +02:00
|
|
|
|
QgsVectorLayerFeatureCounter *countSymbolFeatures();
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Count features for symbols.
|
|
|
|
|
The method will return the feature counter task. You will need to
|
|
|
|
|
connect to the symbolFeatureCountMapChanged() signal to be
|
|
|
|
|
notified when the freshly updated feature counts are ready.
|
|
|
|
|
|
2017-05-10 14:05:55 +02:00
|
|
|
|
.. note::
|
|
|
|
|
|
2017-09-14 13:03:56 +02:00
|
|
|
|
If the count features for symbols has been already done a
|
2018-01-12 20:51:17 -04:00
|
|
|
|
None is returned. If you need to wait for the results,
|
|
|
|
|
you can call waitForFinished() on the feature counter.
|
2017-05-10 14:05:55 +02:00
|
|
|
|
|
|
|
|
|
.. versionadded:: 3.0
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2013-01-28 01:39:58 +01:00
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
virtual bool setSubsetString( const QString &subset );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Set the string (typically sql) used to define a subset of the layer
|
2017-12-15 21:36:08 -04:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param subset: The subset string. This may be the where clause of a sql statement
|
|
|
|
|
or other definition string specific to the underlying dataprovider
|
|
|
|
|
and data store.
|
|
|
|
|
|
|
|
|
|
:return: true, when setting the subset string was successful, false otherwise
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2016-07-11 12:06:06 +10:00
|
|
|
|
virtual QString subsetString() const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Get the string (typically sql) used to define a subset of the layer
|
|
|
|
|
|
|
|
|
|
:return: The subset string or null QString if not implemented by the provider
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2017-05-24 09:12:48 +10:00
|
|
|
|
virtual QgsFeatureIterator getFeatures( const QgsFeatureRequest &request = QgsFeatureRequest() ) const;
|
|
|
|
|
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Query the layer for features specified in request.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param request: feature request describing parameters of features to return
|
|
|
|
|
|
|
|
|
|
:return: iterator for matching features from provider
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
|
|
|
|
QgsFeatureIterator getFeatures( const QString &expression );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Query the layer for features matching a given expression.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2017-07-18 10:35:55 +01:00
|
|
|
|
QgsFeature getFeature( QgsFeatureId fid ) const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Query the layer for the feature with the given id.
|
|
|
|
|
If there is no such feature, the returned feature will be invalid.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2016-07-14 12:18:04 +02:00
|
|
|
|
|
2017-03-27 14:41:33 +02:00
|
|
|
|
QgsFeatureIterator getFeatures( const QgsFeatureIds &fids );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Query the layer for the features with the given ids.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2016-07-14 12:18:04 +02:00
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
QgsFeatureIterator getFeatures( const QgsRectangle &rectangle );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Query the layer for the features which intersect the specified rectangle.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2017-06-15 12:08:43 +10:00
|
|
|
|
virtual bool addFeature( QgsFeature &feature, QgsFeatureSink::Flags flags = 0 );
|
2017-04-26 11:12:01 +10:00
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2017-09-29 16:39:47 +02:00
|
|
|
|
bool updateFeature( const QgsFeature &feature, bool skipDefaultValues = false );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2018-01-04 09:11:05 +10:00
|
|
|
|
Updates an existing ``feature`` in the layer, replacing the attributes and geometry for the feature
|
|
|
|
|
with matching QgsFeature.id() with the attributes and geometry from ``feature``.
|
|
|
|
|
Changes are not immediately committed to the layer.
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2018-01-04 09:11:05 +10:00
|
|
|
|
If ``skipDefaultValue`` is set to true, default field values will not
|
|
|
|
|
be updated. This can be used to override default field value expressions.
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2018-01-04 09:11:05 +10:00
|
|
|
|
Returns true if the feature's attribute was successfully changed.
|
|
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
|
|
Calls to updateFeature() are only valid for layers in which edits have been enabled
|
2018-01-12 20:51:17 -04:00
|
|
|
|
by a call to startEditing(). Changes made to features using this method are not committed
|
|
|
|
|
to the underlying data provider until a commitChanges() call is made. Any uncommitted
|
|
|
|
|
changes can be discarded by calling rollBack().
|
2018-01-04 09:11:05 +10:00
|
|
|
|
|
|
|
|
|
.. warning::
|
|
|
|
|
|
|
|
|
|
This method needs to query the underlying data provider to fetch the feature
|
2018-01-12 20:51:17 -04:00
|
|
|
|
with matching QgsFeature.id() on every call. Depending on the underlying data source this
|
|
|
|
|
can be slow to execute. Consider using the more efficient changeAttributeValue() or
|
|
|
|
|
changeGeometry() methods instead.
|
2018-01-04 09:11:05 +10:00
|
|
|
|
|
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`startEditing`
|
2018-01-04 09:11:05 +10:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`commitChanges`
|
2018-01-04 09:11:05 +10:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`changeGeometry`
|
2018-01-04 09:11:05 +10:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`changeAttributeValue`
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2012-10-21 13:21:35 +02:00
|
|
|
|
bool insertVertex( double x, double y, QgsFeatureId atFeatureId, int beforeVertex );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Insert a new vertex before the given vertex number,
|
|
|
|
|
in the given ring, item (first number is index 0), and feature
|
|
|
|
|
Not meaningful for Point geometries
|
2018-01-04 09:11:05 +10:00
|
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
|
|
Calls to insertVertex() are only valid for layers in which edits have been enabled
|
2018-01-12 20:51:17 -04:00
|
|
|
|
by a call to startEditing(). Changes made to features using this method are not committed
|
|
|
|
|
to the underlying data provider until a commitChanges() call is made. Any uncommitted
|
|
|
|
|
changes can be discarded by calling rollBack().
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2017-06-01 12:18:43 +02:00
|
|
|
|
bool insertVertex( const QgsPoint &point, QgsFeatureId atFeatureId, int beforeVertex );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Insert a new vertex before the given vertex number,
|
|
|
|
|
in the given ring, item (first number is index 0), and feature
|
|
|
|
|
Not meaningful for Point geometries
|
2018-01-04 09:11:05 +10:00
|
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
|
|
Calls to insertVertex() are only valid for layers in which edits have been enabled
|
2018-01-12 20:51:17 -04:00
|
|
|
|
by a call to startEditing(). Changes made to features using this method are not committed
|
|
|
|
|
to the underlying data provider until a commitChanges() call is made. Any uncommitted
|
|
|
|
|
changes can be discarded by calling rollBack().
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-01-11 09:51:38 +03:00
|
|
|
|
|
2012-10-21 13:21:35 +02:00
|
|
|
|
bool moveVertex( double x, double y, QgsFeatureId atFeatureId, int atVertex );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Moves the vertex at the given position number,
|
|
|
|
|
ring and item (first number is index 0), and feature
|
|
|
|
|
to the given coordinates
|
2018-01-04 09:11:05 +10:00
|
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
|
|
Calls to moveVertex() are only valid for layers in which edits have been enabled
|
2018-01-12 20:51:17 -04:00
|
|
|
|
by a call to startEditing(). Changes made to features using this method are not committed
|
|
|
|
|
to the underlying data provider until a commitChanges() call is made. Any uncommitted
|
|
|
|
|
changes can be discarded by calling rollBack().
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2017-06-01 12:18:43 +02:00
|
|
|
|
bool moveVertex( const QgsPoint &p, QgsFeatureId atFeatureId, int atVertex ) /PyName=moveVertexV2/;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Moves the vertex at the given position number,
|
|
|
|
|
ring and item (first number is index 0), and feature
|
|
|
|
|
to the given coordinates
|
|
|
|
|
|
2017-04-02 20:52:50 +10:00
|
|
|
|
.. note::
|
|
|
|
|
|
2017-04-03 01:06:33 +02:00
|
|
|
|
available in Python as moveVertexV2
|
2018-01-04 09:11:05 +10:00
|
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
|
|
Calls to moveVertex() are only valid for layers in which edits have been enabled
|
2018-01-12 20:51:17 -04:00
|
|
|
|
by a call to startEditing(). Changes made to features using this method are not committed
|
|
|
|
|
to the underlying data provider until a commitChanges() call is made. Any uncommitted
|
|
|
|
|
changes can be discarded by calling rollBack().
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2016-08-06 15:44:34 +02:00
|
|
|
|
EditResult deleteVertex( QgsFeatureId featureId, int vertex );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Deletes a vertex from a feature.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param featureId: ID of feature to remove vertex from
|
|
|
|
|
:param vertex: index of vertex to delete
|
|
|
|
|
|
2017-04-03 01:31:44 +02:00
|
|
|
|
.. versionadded:: 2.14
|
2018-01-04 09:11:05 +10:00
|
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
|
|
Calls to deleteVertex() are only valid for layers in which edits have been enabled
|
2018-01-12 20:51:17 -04:00
|
|
|
|
by a call to startEditing(). Changes made to features using this method are not committed
|
|
|
|
|
to the underlying data provider until a commitChanges() call is made. Any uncommitted
|
|
|
|
|
changes can be discarded by calling rollBack().
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2015-02-03 02:21:52 +01:00
|
|
|
|
bool deleteSelectedFeatures( int *deletedCount = 0 );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Deletes the selected features
|
|
|
|
|
|
|
|
|
|
:return: true in case of success and false otherwise
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2017-11-23 12:09:30 +01:00
|
|
|
|
QgsGeometry::OperationResult addRing( const QVector<QgsPointXY> &ring, QgsFeatureId *featureId = 0 );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Adds a ring to polygon/multipolygon features
|
2017-12-15 21:36:08 -04:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param ring: ring to add
|
|
|
|
|
:param featureId: if specified, feature ID for feature ring was added to will be stored in this parameter
|
|
|
|
|
|
|
|
|
|
:return: QgsGeometry.OperationResult
|
|
|
|
|
- Success
|
|
|
|
|
- LayerNotEditable
|
|
|
|
|
- AddRingNotInExistingFeature
|
|
|
|
|
- InvalidInputGeometryType
|
|
|
|
|
- AddRingNotClosed
|
|
|
|
|
- AddRingNotValid
|
|
|
|
|
- AddRingCrossesExistingRings
|
2018-01-04 09:11:05 +10:00
|
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
|
|
Calls to addRing() are only valid for layers in which edits have been enabled
|
2018-01-12 20:51:17 -04:00
|
|
|
|
by a call to startEditing(). Changes made to features using this method are not committed
|
|
|
|
|
to the underlying data provider until a commitChanges() call is made. Any uncommitted
|
|
|
|
|
changes can be discarded by calling rollBack().
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2017-11-23 12:09:30 +01:00
|
|
|
|
QgsGeometry::OperationResult addRing( QgsCurve *ring /Transfer/, QgsFeatureId *featureId = 0 ) /PyName=addCurvedRing/;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Adds a ring to polygon/multipolygon features (takes ownership)
|
2017-12-15 21:36:08 -04:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param ring: ring to add
|
|
|
|
|
:param featureId: if specified, feature ID for feature ring was added to will be stored in this parameter
|
|
|
|
|
|
|
|
|
|
:return: QgsGeometry.OperationResult
|
|
|
|
|
- Success
|
|
|
|
|
- LayerNotEditable
|
|
|
|
|
- AddRingNotInExistingFeature
|
|
|
|
|
- InvalidInputGeometryType
|
|
|
|
|
- AddRingNotClosed
|
|
|
|
|
- AddRingNotValid
|
|
|
|
|
- AddRingCrossesExistingRings
|
|
|
|
|
|
2017-11-23 12:09:30 +01:00
|
|
|
|
.. note::
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2017-11-23 12:09:30 +01:00
|
|
|
|
available in Python as addCurvedRing
|
2018-01-04 09:11:05 +10:00
|
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
|
|
Calls to addRing() are only valid for layers in which edits have been enabled
|
2018-01-12 20:51:17 -04:00
|
|
|
|
by a call to startEditing(). Changes made to features using this method are not committed
|
|
|
|
|
to the underlying data provider until a commitChanges() call is made. Any uncommitted
|
|
|
|
|
changes can be discarded by calling rollBack().
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2017-11-23 12:09:30 +01:00
|
|
|
|
QgsGeometry::OperationResult addPart( const QList<QgsPointXY> &ring );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Adds a new part polygon to a multipart feature
|
|
|
|
|
|
|
|
|
|
:return: QgsGeometry.OperationResult
|
|
|
|
|
- Success
|
|
|
|
|
- LayerNotEditable
|
|
|
|
|
- SelectionIsEmpty
|
|
|
|
|
- SelectionIsGreaterThanOne
|
|
|
|
|
- AddPartSelectedGeometryNotFound
|
|
|
|
|
- AddPartNotMultiGeometry
|
|
|
|
|
- InvalidBaseGeometry
|
|
|
|
|
- InvalidInputGeometryType
|
2018-01-04 09:11:05 +10:00
|
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
|
|
Calls to addPart() are only valid for layers in which edits have been enabled
|
2018-01-12 20:51:17 -04:00
|
|
|
|
by a call to startEditing(). Changes made to features using this method are not committed
|
|
|
|
|
to the underlying data provider until a commitChanges() call is made. Any uncommitted
|
|
|
|
|
changes can be discarded by calling rollBack().
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2017-11-23 12:09:30 +01:00
|
|
|
|
QgsGeometry::OperationResult addPart( const QgsPointSequence &ring ) /PyName=addPartV2/;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Adds a new part polygon to a multipart feature
|
|
|
|
|
|
|
|
|
|
:return: QgsGeometry.OperationResult
|
|
|
|
|
- Success
|
|
|
|
|
- LayerNotEditable
|
|
|
|
|
- SelectionIsEmpty
|
|
|
|
|
- SelectionIsGreaterThanOne
|
|
|
|
|
- AddPartSelectedGeometryNotFound
|
|
|
|
|
- AddPartNotMultiGeometry
|
|
|
|
|
- InvalidBaseGeometry
|
|
|
|
|
- InvalidInputGeometryType
|
|
|
|
|
|
2017-11-23 12:09:30 +01:00
|
|
|
|
.. note::
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2017-11-23 12:09:30 +01:00
|
|
|
|
available in Python bindings as addPartV2
|
2018-01-04 09:11:05 +10:00
|
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
|
|
Calls to addPart() are only valid for layers in which edits have been enabled
|
2018-01-12 20:51:17 -04:00
|
|
|
|
by a call to startEditing(). Changes made to features using this method are not committed
|
|
|
|
|
to the underlying data provider until a commitChanges() call is made. Any uncommitted
|
|
|
|
|
changes can be discarded by calling rollBack().
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2017-11-23 12:09:30 +01:00
|
|
|
|
QgsGeometry::OperationResult addPart( QgsCurve *ring /Transfer/ ) /PyName=addCurvedPart/;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2017-04-02 20:52:50 +10:00
|
|
|
|
.. note::
|
|
|
|
|
|
2017-04-03 01:06:33 +02:00
|
|
|
|
available in Python as addCurvedPart
|
2018-01-04 09:11:05 +10:00
|
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
|
|
Calls to addPart() are only valid for layers in which edits have been enabled
|
2018-01-12 20:51:17 -04:00
|
|
|
|
by a call to startEditing(). Changes made to features using this method are not committed
|
|
|
|
|
to the underlying data provider until a commitChanges() call is made. Any uncommitted
|
|
|
|
|
changes can be discarded by calling rollBack().
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2012-10-21 13:21:35 +02:00
|
|
|
|
int translateFeature( QgsFeatureId featureId, double dx, double dy );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Translates feature by dx, dy
|
2017-12-15 21:36:08 -04:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param featureId: id of the feature to translate
|
|
|
|
|
:param dx: translation of x-coordinate
|
|
|
|
|
:param dy: translation of y-coordinate
|
|
|
|
|
|
|
|
|
|
:return: 0 in case of success
|
2018-01-04 09:11:05 +10:00
|
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
|
|
Calls to translateFeature() are only valid for layers in which edits have been enabled
|
2018-01-12 20:51:17 -04:00
|
|
|
|
by a call to startEditing(). Changes made to features using this method are not committed
|
|
|
|
|
to the underlying data provider until a commitChanges() call is made. Any uncommitted
|
|
|
|
|
changes can be discarded by calling rollBack().
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2017-11-23 12:09:30 +01:00
|
|
|
|
QgsGeometry::OperationResult splitParts( const QVector<QgsPointXY> &splitLine, bool topologicalEditing = false );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Splits parts cut by the given line
|
2017-12-15 21:36:08 -04:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param splitLine: line that splits the layer features
|
|
|
|
|
:param topologicalEditing: true if topological editing is enabled
|
|
|
|
|
|
|
|
|
|
:return: QgsGeometry.OperationResult
|
|
|
|
|
- Success
|
|
|
|
|
- NothingHappened
|
|
|
|
|
- LayerNotEditable
|
|
|
|
|
- InvalidInputGeometryType
|
|
|
|
|
- InvalidBaseGeometry
|
|
|
|
|
- GeometryEngineError
|
|
|
|
|
- SplitCannotSplitPoint
|
2018-01-04 09:11:05 +10:00
|
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
|
|
Calls to splitParts() are only valid for layers in which edits have been enabled
|
2018-01-12 20:51:17 -04:00
|
|
|
|
by a call to startEditing(). Changes made to features using this method are not committed
|
|
|
|
|
to the underlying data provider until a commitChanges() call is made. Any uncommitted
|
|
|
|
|
changes can be discarded by calling rollBack().
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2017-11-23 12:09:30 +01:00
|
|
|
|
QgsGeometry::OperationResult splitFeatures( const QVector<QgsPointXY> &splitLine, bool topologicalEditing = false );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Splits features cut by the given line
|
2017-12-15 21:36:08 -04:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param splitLine: line that splits the layer features
|
|
|
|
|
:param topologicalEditing: true if topological editing is enabled
|
|
|
|
|
|
|
|
|
|
:return: QgsGeometry.OperationResult
|
|
|
|
|
- Success
|
|
|
|
|
- NothingHappened
|
|
|
|
|
- LayerNotEditable
|
|
|
|
|
- InvalidInputGeometryType
|
|
|
|
|
- InvalidBaseGeometry
|
|
|
|
|
- GeometryEngineError
|
|
|
|
|
- SplitCannotSplitPoint
|
2018-01-04 09:11:05 +10:00
|
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
|
|
Calls to splitFeatures() are only valid for layers in which edits have been enabled
|
2018-01-12 20:51:17 -04:00
|
|
|
|
by a call to startEditing(). Changes made to features using this method are not committed
|
|
|
|
|
to the underlying data provider until a commitChanges() call is made. Any uncommitted
|
|
|
|
|
changes can be discarded by calling rollBack().
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
|
|
|
|
int addTopologicalPoints( const QgsGeometry &geom );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Adds topological points for every vertex of the geometry.
|
|
|
|
|
|
2017-12-15 21:36:08 -04:00
|
|
|
|
:param geom: the geometry where each vertex is added to segments of other features
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2017-12-16 10:38:54 -04:00
|
|
|
|
:return: 0 in case of success
|
|
|
|
|
|
2017-04-02 20:52:50 +10:00
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
|
|
geom is not going to be modified by the function
|
2018-01-04 09:11:05 +10:00
|
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
|
|
Calls to addTopologicalPoints() are only valid for layers in which edits have been enabled
|
2018-01-12 20:51:17 -04:00
|
|
|
|
by a call to startEditing(). Changes made to features using this method are not committed
|
|
|
|
|
to the underlying data provider until a commitChanges() call is made. Any uncommitted
|
|
|
|
|
changes can be discarded by calling rollBack().
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2017-06-01 12:18:43 +02:00
|
|
|
|
int addTopologicalPoints( const QgsPointXY &p );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Adds a vertex to segments which intersect point p but don't
|
|
|
|
|
already have a vertex there. If a feature already has a vertex at position p,
|
|
|
|
|
no additional vertex is inserted. This method is useful for topological
|
|
|
|
|
editing.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param p: position of the vertex
|
|
|
|
|
|
|
|
|
|
:return: 0 in case of success
|
2018-01-04 09:11:05 +10:00
|
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
|
|
Calls to addTopologicalPoints() are only valid for layers in which edits have been enabled
|
2018-01-12 20:51:17 -04:00
|
|
|
|
by a call to startEditing(). Changes made to features using this method are not committed
|
|
|
|
|
to the underlying data provider until a commitChanges() call is made. Any uncommitted
|
|
|
|
|
changes can be discarded by calling rollBack().
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2017-09-01 09:47:05 +01:00
|
|
|
|
|
|
|
|
|
QgsAbstractVectorLayerLabeling *labeling();
|
2017-05-14 17:33:01 +08:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Access to labeling configuration. May be null if labeling is not used.
|
|
|
|
|
|
2018-01-19 13:41:08 +10:00
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
|
|
Labels will only be rendered if labelsEnabled() returns true.
|
|
|
|
|
|
2017-05-14 17:33:01 +08:00
|
|
|
|
.. versionadded:: 3.0
|
2018-01-19 13:41:08 +10:00
|
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`labelsEnabled`
|
2017-05-14 17:33:01 +08:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2017-05-14 17:33:01 +08:00
|
|
|
|
void setLabeling( QgsAbstractVectorLayerLabeling *labeling /Transfer/ );
|
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Set labeling configuration. Takes ownership of the object.
|
|
|
|
|
|
2017-05-14 17:33:01 +08:00
|
|
|
|
.. versionadded:: 3.0
|
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2012-08-28 22:32:17 +02:00
|
|
|
|
virtual bool isEditable() const;
|
2017-12-15 08:57:22 +10:00
|
|
|
|
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
|
|
|
|
Returns true if the provider is in editing mode
|
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2016-03-16 12:35:45 +11:00
|
|
|
|
virtual bool isSpatial() const;
|
2017-12-15 08:57:22 +10:00
|
|
|
|
|
2017-07-05 07:49:35 +02:00
|
|
|
|
%Docstring
|
|
|
|
|
Returns true if this is a geometry layer and false in case of NoGeometry (table only) or UnknownGeometry
|
|
|
|
|
%End
|
2016-03-16 12:35:45 +11:00
|
|
|
|
|
2012-08-28 22:32:17 +02:00
|
|
|
|
virtual bool isModified() const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
|
|
|
|
Returns true if the provider has been modified since the last commit
|
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2017-09-02 06:15:52 +01:00
|
|
|
|
bool isAuxiliaryField( int index, int &srcIndex ) const;
|
2017-08-30 15:51:27 +01:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Returns true if the field comes from the auxiliary layer,
|
|
|
|
|
false otherwise.
|
|
|
|
|
|
2017-08-30 15:51:27 +01:00
|
|
|
|
.. versionadded:: 3.0
|
|
|
|
|
%End
|
|
|
|
|
|
2012-08-28 22:32:17 +02:00
|
|
|
|
virtual void reload();
|
2017-12-15 08:57:22 +10:00
|
|
|
|
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
|
|
|
|
Synchronises with changes in the datasource
|
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
virtual QgsMapLayerRenderer *createMapRenderer( QgsRenderContext &rendererContext ) /Factory/;
|
2017-12-15 08:57:22 +10:00
|
|
|
|
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Return new instance of QgsMapLayerRenderer that will be used for rendering of given context
|
|
|
|
|
|
2017-04-03 01:31:44 +02:00
|
|
|
|
.. versionadded:: 2.4
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2013-12-05 18:27:45 +07:00
|
|
|
|
|
2017-04-18 11:00:13 +10:00
|
|
|
|
virtual QgsRectangle extent() const;
|
2017-04-20 13:48:50 +02:00
|
|
|
|
|
2017-06-06 17:26:07 +10:00
|
|
|
|
virtual QgsRectangle sourceExtent() const;
|
|
|
|
|
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2017-05-24 10:23:05 +10:00
|
|
|
|
virtual QgsFields fields() const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Returns the list of fields of this layer.
|
|
|
|
|
This also includes fields which have not yet been saved to the provider.
|
|
|
|
|
|
|
|
|
|
:return: A list of fields
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2015-08-02 09:09:01 +02:00
|
|
|
|
|
|
|
|
|
QgsAttributeList attributeList() const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Returns list of attribute indexes. i.e. a list from 0 ... fieldCount()
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2018-01-15 09:05:32 +10:00
|
|
|
|
QgsAttributeList primaryKeyAttributes() const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2018-01-12 21:45:45 +10:00
|
|
|
|
Returns the list of attributes which make up the layer's primary keys.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2013-01-28 01:39:58 +01:00
|
|
|
|
|
2017-05-24 10:23:05 +10:00
|
|
|
|
virtual long featureCount() const;
|
|
|
|
|
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Returns feature count including changes which have not yet been committed
|
|
|
|
|
If you need only the count of committed features call this method on this layer's provider.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2015-11-20 15:04:54 +01:00
|
|
|
|
bool setReadOnly( bool readonly = true );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Make layer read-only (editing disabled) or not
|
|
|
|
|
|
|
|
|
|
:return: false if the layer is in editing yet
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2018-01-04 09:11:05 +10:00
|
|
|
|
bool changeGeometry( QgsFeatureId fid, const QgsGeometry &geometry, bool skipDefaultValue = false );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2018-01-04 09:11:05 +10:00
|
|
|
|
Changes a feature's ``geometry`` within the layer's edit buffer
|
|
|
|
|
(but does not immediately commit the changes). The ``fid`` argument
|
|
|
|
|
specifies the ID of the feature to be changed.
|
|
|
|
|
|
|
|
|
|
If ``skipDefaultValue`` is set to true, default field values will not
|
|
|
|
|
be updated. This can be used to override default field value expressions.
|
|
|
|
|
|
|
|
|
|
Returns true if the feature's geometry was successfully changed.
|
|
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
|
|
Calls to changeGeometry() are only valid for layers in which edits have been enabled
|
2018-01-12 20:51:17 -04:00
|
|
|
|
by a call to startEditing(). Changes made to features using this method are not committed
|
|
|
|
|
to the underlying data provider until a commitChanges() call is made. Any uncommitted
|
|
|
|
|
changes can be discarded by calling rollBack().
|
2018-01-04 09:11:05 +10:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`startEditing`
|
2018-01-04 09:11:05 +10:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`commitChanges`
|
2018-01-04 09:11:05 +10:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`changeAttributeValue`
|
2018-01-04 09:11:05 +10:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`updateFeature`
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2017-09-26 13:35:05 +02:00
|
|
|
|
bool changeAttributeValue( QgsFeatureId fid, int field, const QVariant &newValue, const QVariant &oldValue = QVariant(), bool skipDefaultValues = false );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2018-01-04 09:11:05 +10:00
|
|
|
|
Changes an attribute value for a feature (but does not immediately commit the changes).
|
|
|
|
|
The ``fid`` argument specifies the ID of the feature to be changed.
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2018-01-04 09:11:05 +10:00
|
|
|
|
The ``field`` argument must specify a valid field index for the layer (where an index of 0
|
|
|
|
|
corresponds to the first field).
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2018-01-04 09:11:05 +10:00
|
|
|
|
The new value to be assigned to the field is given by ``newValue``.
|
|
|
|
|
|
|
|
|
|
If a valid QVariant is specified for ``oldValue``, it will be used as the field value in the
|
|
|
|
|
case of an undo operation corresponding to this attribute value change. If an invalid
|
|
|
|
|
QVariant is used (the default behavior), then the feature's current value will be automatically
|
|
|
|
|
retrieved and used. Note that this involves a feature request to the underlying data provider,
|
|
|
|
|
so it is more efficient to explicitly pass an ``oldValue`` if it is already available.
|
|
|
|
|
|
2018-01-25 08:32:05 +00:00
|
|
|
|
If ``skipDefaultValues`` is set to true, default field values will not
|
2018-01-04 09:11:05 +10:00
|
|
|
|
be updated. This can be used to override default field value expressions.
|
|
|
|
|
|
|
|
|
|
Returns true if the feature's attribute was successfully changed.
|
|
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
|
|
Calls to changeAttributeValue() are only valid for layers in which edits have been enabled
|
2018-01-12 20:51:17 -04:00
|
|
|
|
by a call to startEditing(). Changes made to features using this method are not committed
|
|
|
|
|
to the underlying data provider until a commitChanges() call is made. Any uncommitted
|
|
|
|
|
changes can be discarded by calling rollBack().
|
2018-01-04 09:11:05 +10:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`startEditing`
|
2018-01-04 09:11:05 +10:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`commitChanges`
|
2018-01-04 09:11:05 +10:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`changeGeometry`
|
2018-01-04 09:11:05 +10:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`updateFeature`
|
2018-01-23 13:07:35 +00:00
|
|
|
|
%End
|
|
|
|
|
|
2018-01-25 08:32:05 +00:00
|
|
|
|
bool changeAttributeValues( QgsFeatureId fid, const QgsAttributeMap &newValues, const QgsAttributeMap &oldValues = QgsAttributeMap(), bool skipDefaultValues = false );
|
2018-01-23 13:07:35 +00:00
|
|
|
|
%Docstring
|
|
|
|
|
Changes attributes' values for a feature (but does not immediately
|
|
|
|
|
commit the changes).
|
|
|
|
|
The ``fid`` argument specifies the ID of the feature to be changed.
|
|
|
|
|
|
|
|
|
|
The new values to be assigned to the fields are given by ``newValues``.
|
|
|
|
|
|
|
|
|
|
If a valid QVariant is specified for a field in ``oldValues``, it will be
|
|
|
|
|
used as the field value in the case of an undo operation corresponding
|
|
|
|
|
to this attribute value change. If an invalid QVariant is used (the
|
|
|
|
|
default behavior), then the feature's current value will be
|
|
|
|
|
automatically retrieved and used. Note that this involves a feature
|
|
|
|
|
request to the underlying data provider, so it is more efficient to
|
|
|
|
|
explicitly pass an oldValue if it is already available.
|
|
|
|
|
|
2018-01-25 08:32:05 +00:00
|
|
|
|
If ``skipDefaultValues`` is set to true, default field values will not
|
2018-01-23 13:07:35 +00:00
|
|
|
|
be updated. This can be used to override default field value
|
|
|
|
|
expressions.
|
|
|
|
|
|
|
|
|
|
Returns true if feature's attributes was successfully changed.
|
|
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
|
|
Calls to changeAttributeValues() are only valid for layers in
|
|
|
|
|
which edits have been enabled by a call to startEditing(). Changes made
|
|
|
|
|
to features using this method are not committed to the underlying data
|
|
|
|
|
provider until a commitChanges() call is made. Any uncommitted changes
|
|
|
|
|
can be discarded by calling rollBack().
|
|
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`startEditing`
|
|
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`commitChanges`
|
|
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`changeGeometry`
|
|
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`updateFeature`
|
|
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`changeAttributeValue`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. versionadded:: 3.0
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
|
|
|
|
bool addAttribute( const QgsField &field );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Add an attribute field (but does not commit it)
|
|
|
|
|
returns true if the field was added
|
2018-01-04 09:11:05 +10:00
|
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
|
|
Calls to addAttribute() are only valid for layers in which edits have been enabled
|
2018-01-12 20:51:17 -04:00
|
|
|
|
by a call to startEditing(). Changes made to features using this method are not committed
|
|
|
|
|
to the underlying data provider until a commitChanges() call is made. Any uncommitted
|
|
|
|
|
changes can be discarded by calling rollBack().
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
void setFieldAlias( int index, const QString &aliasString );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Sets an alias (a display name) for attributes to display in dialogs
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-04-03 01:31:44 +02:00
|
|
|
|
.. versionadded:: 3.0
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2016-09-27 18:06:42 +02:00
|
|
|
|
void removeFieldAlias( int index );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Removes an alias (a display name) for attributes to display in dialogs
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-04-03 01:31:44 +02:00
|
|
|
|
.. versionadded:: 3.0
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2014-11-21 01:17:21 +01:00
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
bool renameAttribute( int index, const QString &newName );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Renames an attribute field (but does not commit it).
|
2017-12-15 21:36:08 -04:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param index: attribute index
|
|
|
|
|
:param newName: new name of field
|
|
|
|
|
|
2017-04-03 01:31:44 +02:00
|
|
|
|
.. versionadded:: 2.16
|
2018-01-04 09:11:05 +10:00
|
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
|
|
Calls to renameAttribute() are only valid for layers in which edits have been enabled
|
2018-01-12 20:51:17 -04:00
|
|
|
|
by a call to startEditing(). Changes made to features using this method are not committed
|
|
|
|
|
to the underlying data provider until a commitChanges() call is made. Any uncommitted
|
|
|
|
|
changes can be discarded by calling rollBack().
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2016-09-27 18:06:42 +02:00
|
|
|
|
QString attributeAlias( int index ) const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Returns the alias of an attribute name or a null string if there is no alias.
|
|
|
|
|
|
|
|
|
|
\see {attributeDisplayName( int attributeIndex )} which returns the field name
|
|
|
|
|
if no alias is defined.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2009-07-03 15:42:42 +00:00
|
|
|
|
|
2016-09-27 18:06:42 +02:00
|
|
|
|
QString attributeDisplayName( int index ) const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
|
|
|
|
Convenience function that returns the attribute alias if defined or the field name else
|
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2017-03-27 14:41:33 +02:00
|
|
|
|
QgsStringMap attributeAliases() const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
|
|
|
|
Returns a map of field name to attribute alias
|
|
|
|
|
%End
|
2012-10-21 13:21:35 +02:00
|
|
|
|
|
2017-01-14 13:46:26 +10:00
|
|
|
|
QSet<QString> excludeAttributesWms() const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
A set of attributes that are not advertised in WMS requests with QGIS server.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
void setExcludeAttributesWms( const QSet<QString> &att );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
A set of attributes that are not advertised in WMS requests with QGIS server.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2012-10-21 13:21:35 +02:00
|
|
|
|
|
2017-01-14 13:46:26 +10:00
|
|
|
|
QSet<QString> excludeAttributesWfs() const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
A set of attributes that are not advertised in WFS requests with QGIS server.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
void setExcludeAttributesWfs( const QSet<QString> &att );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
A set of attributes that are not advertised in WFS requests with QGIS server.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2012-10-21 13:21:35 +02:00
|
|
|
|
|
2017-08-29 09:45:01 +01:00
|
|
|
|
virtual bool deleteAttribute( int attr );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2018-01-04 09:11:05 +10:00
|
|
|
|
Deletes an attribute field (but does not commit it).
|
|
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
|
|
Calls to deleteAttribute() are only valid for layers in which edits have been enabled
|
2018-01-12 20:51:17 -04:00
|
|
|
|
by a call to startEditing(). Changes made to features using this method are not committed
|
|
|
|
|
to the underlying data provider until a commitChanges() call is made. Any uncommitted
|
|
|
|
|
changes can be discarded by calling rollBack().
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2013-04-02 16:34:50 +02:00
|
|
|
|
bool deleteAttributes( QList<int> attrs );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Deletes a list of attribute fields (but does not commit it)
|
|
|
|
|
|
|
|
|
|
\param attrs the indices of the attributes to delete
|
|
|
|
|
|
|
|
|
|
:return: true if at least one attribute has been deleted
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2013-04-02 16:34:50 +02:00
|
|
|
|
|
2017-06-15 12:08:43 +10:00
|
|
|
|
virtual bool addFeatures( QgsFeatureList &features, QgsFeatureSink::Flags flags = 0 );
|
2017-04-26 11:12:01 +10:00
|
|
|
|
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2012-10-21 13:21:35 +02:00
|
|
|
|
bool deleteFeature( QgsFeatureId fid );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2018-01-04 09:11:05 +10:00
|
|
|
|
Deletes a feature from the layer (but does not commit it).
|
|
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
|
|
Calls to deleteFeature() are only valid for layers in which edits have been enabled
|
2018-01-12 20:51:17 -04:00
|
|
|
|
by a call to startEditing(). Changes made to features using this method are not committed
|
|
|
|
|
to the underlying data provider until a commitChanges() call is made. Any uncommitted
|
|
|
|
|
changes can be discarded by calling rollBack().
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
bool deleteFeatures( const QgsFeatureIds &fids );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Deletes a set of features from the layer (but does not commit it)
|
2017-12-15 21:36:08 -04:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param fids: The feature ids to delete
|
|
|
|
|
|
|
|
|
|
:return: false if the layer is not in edit mode or does not support deleting
|
|
|
|
|
in case of an active transaction depends on the provider implementation
|
2018-01-04 09:11:05 +10:00
|
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
|
|
Calls to deleteFeatures() are only valid for layers in which edits have been enabled
|
2018-01-12 20:51:17 -04:00
|
|
|
|
by a call to startEditing(). Changes made to features using this method are not committed
|
|
|
|
|
to the underlying data provider until a commitChanges() call is made. Any uncommitted
|
|
|
|
|
changes can be discarded by calling rollBack().
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2012-08-28 22:32:17 +02:00
|
|
|
|
bool commitChanges();
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2018-01-04 09:11:05 +10:00
|
|
|
|
Attempts to commit to the underlying data provider any buffered changes made since the
|
|
|
|
|
last to call to startEditing().
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2018-01-04 09:11:05 +10:00
|
|
|
|
Returns the result of the attempt. If a commit fails (i.e. false is returned), the
|
|
|
|
|
in-memory changes are left untouched and are not discarded. This allows editing to
|
|
|
|
|
continue if the commit failed on e.g. a disallowed value in a Postgres
|
|
|
|
|
database - the user can re-edit and try again.
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
|
|
|
|
The commits occur in distinct stages,
|
|
|
|
|
(add attributes, add features, change attribute values, change
|
|
|
|
|
geometries, delete features, delete attributes)
|
2018-01-04 09:11:05 +10:00
|
|
|
|
so if a stage fails, it can be difficult to roll back cleanly.
|
|
|
|
|
Therefore any error message returned by commitErrors() also includes which stage failed so
|
2017-12-15 10:36:55 -04:00
|
|
|
|
that the user has some chance of repairing the damage cleanly.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`startEditing`
|
2018-01-04 09:11:05 +10:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`commitErrors`
|
2018-01-04 09:11:05 +10:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`rollBack`
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2016-07-15 08:08:24 +10:00
|
|
|
|
|
2016-07-11 12:06:06 +10:00
|
|
|
|
QStringList commitErrors() const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Returns a list containing any error messages generated when attempting
|
|
|
|
|
to commit changes to the layer.
|
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`commitChanges`
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2013-03-20 13:35:56 +01:00
|
|
|
|
bool rollBack( bool deleteBuffer = true );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2018-01-04 09:11:05 +10:00
|
|
|
|
Stops a current editing operation and discards any uncommitted edits.
|
|
|
|
|
|
|
|
|
|
If ``deleteBuffer`` is true the editing buffer will be completely deleted (the default
|
|
|
|
|
behavior).
|
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`startEditing`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`commitChanges`
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2016-07-11 12:06:06 +10:00
|
|
|
|
QList<QgsRelation> referencingRelations( int idx ) const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Get relations, where the foreign key is on this layer
|
|
|
|
|
|
|
|
|
|
:param idx: Only get relations, where idx forms part of the foreign key
|
|
|
|
|
|
|
|
|
|
:return: A list of relations
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2014-01-03 23:06:49 +01:00
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
QgsVectorLayerEditBuffer *editBuffer();
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
|
|
|
|
Buffer with uncommitted editing operations. Only valid after editing has been turned on.
|
|
|
|
|
%End
|
2012-12-17 21:22:42 +01:00
|
|
|
|
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
void beginEditCommand( const QString &text );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Create edit command for undo/redo operations
|
2017-12-15 21:36:08 -04:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param text: text which is to be displayed in undo window
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
|
|
|
|
void endEditCommand();
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
|
|
|
|
Finish edit command and add it to undo/redo stack
|
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
|
|
|
|
void destroyEditCommand();
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
|
|
|
|
Destroy active command and reverts all changes in it
|
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
|
|
|
|
enum VertexMarkerType
|
|
|
|
|
{
|
|
|
|
|
SemiTransparentCircle,
|
|
|
|
|
Cross,
|
2014-11-21 01:17:21 +01:00
|
|
|
|
NoMarker
|
2012-08-28 22:32:17 +02:00
|
|
|
|
};
|
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
static void drawVertexMarker( double x, double y, QPainter &p, QgsVectorLayer::VertexMarkerType type, int vertexSize );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
|
|
|
|
Draws a vertex symbol at (screen) coordinates x, y. (Useful to assist vertex editing.)
|
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2013-04-02 16:34:50 +02:00
|
|
|
|
void updateFields();
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Will regenerate the `fields` property of this layer by obtaining all fields
|
|
|
|
|
from the dataProvider, joined fields and virtual fields. It will also
|
|
|
|
|
take any changes made to default values into consideration.
|
2017-09-20 09:21:47 +02:00
|
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
|
|
Unless the fields on the provider have directly been modified, there is
|
2018-01-12 20:51:17 -04:00
|
|
|
|
no reason to call this method.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2013-04-02 16:34:50 +02:00
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
QVariant defaultValue( int index, const QgsFeature &feature = QgsFeature(),
|
2017-03-27 14:41:33 +02:00
|
|
|
|
QgsExpressionContext *context = 0 ) const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Returns the calculated default value for the specified field index. The default
|
|
|
|
|
value may be taken from a client side default value expression (see setDefaultValueDefinition())
|
|
|
|
|
or taken from the underlying data provider.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param index: field index
|
|
|
|
|
:param feature: optional feature to use for default value evaluation. If passed,
|
|
|
|
|
then properties from the feature (such as geometry) can be used when calculating
|
|
|
|
|
the default value.
|
|
|
|
|
:param context: optional expression context to evaluate expressions again. If not
|
|
|
|
|
specified, a default context will be created
|
|
|
|
|
|
|
|
|
|
:return: calculated default value
|
|
|
|
|
|
2017-04-03 01:31:44 +02:00
|
|
|
|
.. versionadded:: 3.0
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`setDefaultValueDefinition`
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2017-09-20 09:23:41 +02:00
|
|
|
|
void setDefaultValueDefinition( int index, const QgsDefaultValue &definition );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Sets the definition of the expression to use when calculating the default value for a field.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param index: field index
|
|
|
|
|
:param definition: default value definition to use and evaluate
|
|
|
|
|
when calculating default values for field. Pass
|
|
|
|
|
an empty expression to clear the default.
|
2017-09-20 09:23:41 +02:00
|
|
|
|
|
2017-04-03 01:31:44 +02:00
|
|
|
|
.. versionadded:: 3.0
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`defaultValue`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`defaultValueDefinition`
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2017-09-20 09:23:41 +02:00
|
|
|
|
QgsDefaultValue defaultValueDefinition( int index ) const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Returns the definition of the expression used when calculating the default value for a field.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param index: field index
|
|
|
|
|
|
|
|
|
|
:return: definition of the default value with the expression evaluated
|
|
|
|
|
when calculating default values for field, or definition with an
|
|
|
|
|
empty string if no default is set
|
|
|
|
|
|
2017-04-03 01:31:44 +02:00
|
|
|
|
.. versionadded:: 3.0
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`defaultValue`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`setDefaultValueDefinition`
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2016-08-18 06:02:54 +10:00
|
|
|
|
|
2016-11-01 18:41:22 +10:00
|
|
|
|
QgsFieldConstraints::Constraints fieldConstraints( int fieldIndex ) const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Returns any constraints which are present for a specified
|
|
|
|
|
field index. These constraints may be inherited from the layer's data provider
|
|
|
|
|
or may be set manually on the vector layer from within QGIS.
|
|
|
|
|
|
2017-04-03 01:31:44 +02:00
|
|
|
|
.. versionadded:: 3.0
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`setFieldConstraint`
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2016-10-19 14:44:29 +10:00
|
|
|
|
|
2017-05-17 13:19:56 +02:00
|
|
|
|
QMap< QgsFieldConstraints::Constraint, QgsFieldConstraints::ConstraintStrength> fieldConstraintsAndStrength( int fieldIndex ) const;
|
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Returns a map of constraint with their strength for a specific field of the layer.
|
|
|
|
|
|
2017-12-15 21:36:08 -04:00
|
|
|
|
:param fieldIndex: field index
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2017-05-17 18:45:06 +02:00
|
|
|
|
.. versionadded:: 3.0
|
2017-05-17 13:19:56 +02:00
|
|
|
|
%End
|
|
|
|
|
|
2016-11-02 12:09:52 +10:00
|
|
|
|
void setFieldConstraint( int index, QgsFieldConstraints::Constraint constraint, QgsFieldConstraints::ConstraintStrength strength = QgsFieldConstraints::ConstraintStrengthHard );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Sets a constraint for a specified field index. Any constraints inherited from the layer's
|
|
|
|
|
data provider will be kept intact and cannot be modified. Ie, calling this method only allows for new
|
|
|
|
|
constraints to be added on top of the existing provider constraints.
|
|
|
|
|
|
2017-04-03 01:31:44 +02:00
|
|
|
|
.. versionadded:: 3.0
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`fieldConstraints`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`removeFieldConstraint`
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2016-11-02 12:09:52 +10:00
|
|
|
|
|
|
|
|
|
void removeFieldConstraint( int index, QgsFieldConstraints::Constraint constraint );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Removes a constraint for a specified field index. Any constraints inherited from the layer's
|
|
|
|
|
data provider will be kept intact and cannot be removed.
|
|
|
|
|
|
2017-04-03 01:31:44 +02:00
|
|
|
|
.. versionadded:: 3.0
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`fieldConstraints`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`setFieldConstraint`
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2016-10-19 14:44:29 +10:00
|
|
|
|
|
2016-10-26 09:45:45 +10:00
|
|
|
|
QString constraintExpression( int index ) const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Returns the constraint expression for for a specified field index, if set.
|
|
|
|
|
|
2017-04-03 01:31:44 +02:00
|
|
|
|
.. versionadded:: 3.0
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`fieldConstraints`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`constraintDescription`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`setConstraintExpression`
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2016-10-26 09:45:45 +10:00
|
|
|
|
|
|
|
|
|
QString constraintDescription( int index ) const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Returns the descriptive name for the constraint expression for a specified field index.
|
|
|
|
|
|
2017-04-03 01:31:44 +02:00
|
|
|
|
.. versionadded:: 3.0
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`constraints`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`constraintExpression`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`setConstraintExpression`
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2016-10-26 09:45:45 +10:00
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
void setConstraintExpression( int index, const QString &expression, const QString &description = QString() );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Set the constraint expression for the specified field index. An optional descriptive name for the constraint
|
|
|
|
|
can also be set. Setting an empty expression will clear any existing expression constraint.
|
|
|
|
|
|
2017-04-03 01:31:44 +02:00
|
|
|
|
.. versionadded:: 3.0
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`constraintExpression`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`constraintDescription`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`constraints`
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
void setEditorWidgetSetup( int index, const QgsEditorWidgetSetup &setup );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
\copydoc editorWidgetSetup
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2016-12-07 10:32:09 +01:00
|
|
|
|
QgsEditorWidgetSetup editorWidgetSetup( int index ) const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
The editor widget setup defines which QgsFieldFormatter and editor widget will be used
|
|
|
|
|
for the field at `index`.
|
|
|
|
|
|
2017-04-03 01:31:44 +02:00
|
|
|
|
.. versionadded:: 3.0
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2016-10-26 09:45:45 +10:00
|
|
|
|
|
2017-06-05 14:41:48 +10:00
|
|
|
|
virtual QSet<QVariant> uniqueValues( int fieldIndex, int limit = -1 ) const;
|
|
|
|
|
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Calculates a list of unique values contained within an attribute in the layer. Note that
|
|
|
|
|
in some circumstances when unsaved changes are present for the layer then the returned list
|
|
|
|
|
may contain outdated values (for instance when the attribute value in a saved feature has
|
|
|
|
|
been changed inside the edit buffer then the previous saved value will be included in the
|
|
|
|
|
returned list).
|
2017-12-15 21:36:08 -04:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param fieldIndex: column index for attribute
|
|
|
|
|
:param limit: maximum number of values to return (or -1 if unlimited)
|
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`minimumValue`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`maximumValue`
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
QStringList uniqueStringsMatching( int index, const QString &substring, int limit = -1,
|
2017-03-27 14:41:33 +02:00
|
|
|
|
QgsFeedback *feedback = 0 ) const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Returns unique string values of an attribute which contain a specified subset string. Subset
|
|
|
|
|
matching is done in a case-insensitive manner. Note that
|
|
|
|
|
in some circumstances when unsaved changes are present for the layer then the returned list
|
|
|
|
|
may contain outdated values (for instance when the attribute value in a saved feature has
|
|
|
|
|
been changed inside the edit buffer then the previous saved value will be included in the
|
|
|
|
|
returned list).
|
2017-12-15 21:36:08 -04:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param index: column index for attribute
|
|
|
|
|
:param substring: substring to match (case insensitive)
|
|
|
|
|
:param limit: maxmum number of the values to return, or -1 to return all unique values
|
|
|
|
|
:param feedback: optional feedback object for canceling request
|
|
|
|
|
|
|
|
|
|
:return: list of unique strings containing substring
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2017-07-13 20:03:31 +10:00
|
|
|
|
virtual QVariant minimumValue( int index ) const;
|
|
|
|
|
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Returns the minimum value for an attribute column or an invalid variant in case of error.
|
|
|
|
|
Note that in some circumstances when unsaved changes are present for the layer then the
|
|
|
|
|
returned value may be outdated (for instance when the attribute value in a saved feature has
|
|
|
|
|
been changed inside the edit buffer then the previous saved value may be returned as the minimum).
|
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`maximumValue`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`uniqueValues`
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2017-07-13 20:03:31 +10:00
|
|
|
|
virtual QVariant maximumValue( int index ) const;
|
|
|
|
|
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Returns the maximum value for an attribute column or an invalid variant in case of error.
|
|
|
|
|
Note that in some circumstances when unsaved changes are present for the layer then the
|
|
|
|
|
returned value may be outdated (for instance when the attribute value in a saved feature has
|
|
|
|
|
been changed inside the edit buffer then the previous saved value may be returned as the maximum).
|
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`minimumValue`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`uniqueValues`
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2015-05-03 17:10:32 +02:00
|
|
|
|
|
2016-05-16 14:36:04 +10:00
|
|
|
|
QVariant aggregate( QgsAggregateCalculator::Aggregate aggregate,
|
2017-03-27 09:23:03 +02:00
|
|
|
|
const QString &fieldOrExpression,
|
|
|
|
|
const QgsAggregateCalculator::AggregateParameters ¶meters = QgsAggregateCalculator::AggregateParameters(),
|
2017-03-27 14:41:33 +02:00
|
|
|
|
QgsExpressionContext *context = 0,
|
|
|
|
|
bool *ok = 0 ) const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Calculates an aggregated value from the layer's features.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param aggregate: aggregate to calculate
|
|
|
|
|
:param fieldOrExpression: source field or expression to use as basis for aggregated values.
|
|
|
|
|
:param parameters: parameters controlling aggregate calculation
|
|
|
|
|
:param context: expression context for expressions and filters
|
|
|
|
|
:param ok: if specified, will be set to true if aggregate calculation was successful
|
|
|
|
|
|
|
|
|
|
:return: calculated aggregate value
|
|
|
|
|
|
2017-04-03 01:31:44 +02:00
|
|
|
|
.. versionadded:: 2.16
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2016-02-02 19:46:18 +11:00
|
|
|
|
void setFeatureBlendMode( QPainter::CompositionMode blendMode );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
|
|
|
|
Set the blending mode used for rendering each feature
|
|
|
|
|
%End
|
2013-05-29 21:38:33 +02:00
|
|
|
|
QPainter::CompositionMode featureBlendMode() const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
|
|
|
|
Returns the current blending mode for features
|
|
|
|
|
%End
|
2013-05-29 21:38:33 +02:00
|
|
|
|
|
2017-05-29 20:57:24 +10:00
|
|
|
|
void setOpacity( double opacity );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Sets the ``opacity`` for the vector layer, where ``opacity`` is a value between 0 (totally transparent)
|
|
|
|
|
and 1.0 (fully opaque).
|
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`opacity`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`opacityChanged`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2017-05-29 20:57:24 +10:00
|
|
|
|
.. versionadded:: 3.0
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-05-29 20:57:24 +10:00
|
|
|
|
|
|
|
|
|
double opacity() const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Returns the opacity for the vector layer, where opacity is a value between 0 (totally transparent)
|
|
|
|
|
and 1.0 (fully opaque).
|
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`setOpacity`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`opacityChanged`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2017-05-29 20:57:24 +10:00
|
|
|
|
.. versionadded:: 3.0
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2013-05-29 21:38:33 +02:00
|
|
|
|
|
2017-04-18 11:00:13 +10:00
|
|
|
|
virtual QString htmlMetadata() const;
|
2014-01-03 23:06:49 +01:00
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
|
|
|
|
void setSimplifyMethod( const QgsVectorSimplifyMethod &simplifyMethod );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Set the simplification settings for fast rendering of features
|
|
|
|
|
|
2017-04-03 01:31:44 +02:00
|
|
|
|
.. versionadded:: 2.2
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
|
|
|
|
const QgsVectorSimplifyMethod &simplifyMethod() const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Returns the simplification settings for fast rendering of features
|
|
|
|
|
|
2017-04-03 01:31:44 +02:00
|
|
|
|
.. versionadded:: 2.2
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
|
|
|
|
bool simplifyDrawingCanbeApplied( const QgsRenderContext &renderContext, QgsVectorSimplifyMethod::SimplifyHint simplifyHint ) const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Returns whether the VectorLayer can apply the specified simplification hint
|
|
|
|
|
|
2017-04-02 20:52:50 +10:00
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
|
|
Do not use in 3rd party code - may be removed in future version!
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2017-04-03 01:31:44 +02:00
|
|
|
|
.. versionadded:: 2.2
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2015-08-25 21:08:52 +10:00
|
|
|
|
QgsConditionalLayerStyles *conditionalStyles() const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-04-02 21:28:20 +10:00
|
|
|
|
Return the conditional styles that are set for this layer. Style information is
|
2017-12-15 10:36:55 -04:00
|
|
|
|
used to render conditional formatting in the attribute table.
|
|
|
|
|
|
|
|
|
|
:return: Return a QgsConditionalLayerStyles object holding the conditional attribute
|
|
|
|
|
style information. Style information is generic and can be used for anything.
|
|
|
|
|
|
2017-04-03 01:31:44 +02:00
|
|
|
|
.. versionadded:: 2.12
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2015-08-21 05:45:49 +10:00
|
|
|
|
|
2016-04-28 15:47:43 +02:00
|
|
|
|
QgsAttributeTableConfig attributeTableConfig() const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Get the attribute table configuration object.
|
|
|
|
|
This defines the appearance of the attribute table.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2016-04-28 15:47:43 +02:00
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
void setAttributeTableConfig( const QgsAttributeTableConfig &attributeTableConfig );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Set the attribute table configuration object.
|
|
|
|
|
This defines the appearance of the attribute table.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2016-08-02 16:58:58 +02:00
|
|
|
|
QString mapTipTemplate() const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
The mapTip is a pretty, html representation for feature information.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
It may also contain embedded expressions.
|
|
|
|
|
|
2017-04-03 01:31:44 +02:00
|
|
|
|
.. versionadded:: 3.0
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2016-08-02 16:58:58 +02:00
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
void setMapTipTemplate( const QString &mapTipTemplate );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
The mapTip is a pretty, html representation for feature information.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
It may also contain embedded expressions.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-04-03 01:31:44 +02:00
|
|
|
|
.. versionadded:: 3.0
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2016-08-02 16:58:58 +02:00
|
|
|
|
|
2017-04-18 11:00:13 +10:00
|
|
|
|
virtual QgsExpressionContext createExpressionContext() const;
|
2016-08-10 19:44:30 +02:00
|
|
|
|
|
2017-04-20 13:48:50 +02:00
|
|
|
|
|
2017-11-24 12:25:37 +01:00
|
|
|
|
virtual QgsExpressionContextScope *createExpressionContextScope() const /Factory/;
|
|
|
|
|
|
|
|
|
|
|
2016-08-19 07:45:09 +02:00
|
|
|
|
QgsEditFormConfig editFormConfig() const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Get the configuration of the form used to represent this vector layer.
|
|
|
|
|
This is a writable configuration that can directly be changed in place.
|
|
|
|
|
|
|
|
|
|
:return: The configuration of this layers' form
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-04-03 01:31:44 +02:00
|
|
|
|
.. versionadded:: 2.14
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2016-08-19 07:45:09 +02:00
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
void setEditFormConfig( const QgsEditFormConfig &editFormConfig );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Get the configuration of the form used to represent this vector layer.
|
|
|
|
|
This is a writable configuration that can directly be changed in place.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:return: The configuration of this layers' form
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-04-03 01:31:44 +02:00
|
|
|
|
.. versionadded:: 3.0
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2016-08-19 07:45:09 +02:00
|
|
|
|
|
2017-08-29 16:21:42 +01:00
|
|
|
|
void setReadExtentFromXml( bool readExtentFromXml );
|
2017-08-21 05:48:48 +01:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Flag allowing to indicate if the extent has to be read from the XML
|
|
|
|
|
document when data source has no metadata or if the data provider has
|
|
|
|
|
to determine it.
|
2017-08-21 05:48:48 +01:00
|
|
|
|
|
|
|
|
|
.. versionadded:: 3.0
|
|
|
|
|
%End
|
|
|
|
|
|
2017-08-29 16:21:42 +01:00
|
|
|
|
bool readExtentFromXml() const;
|
2017-08-21 05:48:48 +01:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Returns true if the extent is read from the XML document when data
|
|
|
|
|
source has no metadata, false if it's the data provider which determines
|
|
|
|
|
it.
|
|
|
|
|
|
2017-10-09 10:21:35 +10:00
|
|
|
|
.. versionadded:: 3.0
|
|
|
|
|
%End
|
|
|
|
|
|
|
|
|
|
bool isEditCommandActive() const;
|
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Test if an edit command is active
|
|
|
|
|
|
2017-08-21 05:48:48 +01:00
|
|
|
|
.. versionadded:: 3.0
|
|
|
|
|
%End
|
|
|
|
|
|
2012-08-28 22:32:17 +02:00
|
|
|
|
public slots:
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2015-12-30 22:51:32 +11:00
|
|
|
|
void select( QgsFeatureId featureId );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Select feature by its ID
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param featureId: The id of the feature to select
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
|
.. seealso:: :py:func:`select`
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
void select( const QgsFeatureIds &featureIds );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Select features by their ID
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param featureIds: The ids of the features to select
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
|
.. seealso:: :py:func:`select`
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2013-05-29 21:38:33 +02:00
|
|
|
|
void deselect( const QgsFeatureId featureId );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Deselect feature by its ID
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param featureId: The id of the feature to deselect
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
|
.. seealso:: :py:func:`deselect`
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2013-04-09 11:52:43 +02:00
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
void deselect( const QgsFeatureIds &featureIds );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Deselect features by their ID
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param featureIds: The ids of the features to deselect
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
|
.. seealso:: :py:func:`deselect`
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2013-04-09 11:52:43 +02:00
|
|
|
|
void removeSelection();
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Clear selection
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`selectByIds`
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2017-08-28 11:02:48 +01:00
|
|
|
|
virtual void updateExtents( bool force = false );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Update the extents for the layer. This is necessary if features are
|
|
|
|
|
added/deleted or the layer has been subsetted.
|
2017-08-28 11:02:48 +01:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param force: true to update layer extent even if it's read from xml by default, false otherwise
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2016-01-15 09:31:19 +01:00
|
|
|
|
bool startEditing();
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2018-01-04 09:11:05 +10:00
|
|
|
|
Makes the layer editable.
|
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
This starts an edit session on this layer. Changes made in this edit session will not
|
2018-01-04 09:11:05 +10:00
|
|
|
|
be made persistent until commitChanges() is called, and can be reverted by calling
|
2017-12-15 10:36:55 -04:00
|
|
|
|
rollBack().
|
2018-01-04 09:11:05 +10:00
|
|
|
|
|
|
|
|
|
Returns true if the layer was successfully made editable, or false if the operation
|
|
|
|
|
failed (e.g. due to an underlying read-only data source, or lack of edit support
|
|
|
|
|
by the backend data provider).
|
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`commitChanges`
|
2018-01-04 09:11:05 +10:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`rollBack`
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2016-01-15 09:31:19 +01:00
|
|
|
|
|
2012-08-28 22:32:17 +02:00
|
|
|
|
signals:
|
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
void selectionChanged( const QgsFeatureIds &selected, const QgsFeatureIds &deselected, const bool clearAndSelect );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
This signal is emitted when selection was changed
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param selected: Newly selected feature ids
|
|
|
|
|
:param deselected: Ids of all features which have previously been selected but are not any more
|
|
|
|
|
:param clearAndSelect: In case this is set to true, the old selection was dismissed and the new selection corresponds to selected
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2013-05-29 21:38:33 +02:00
|
|
|
|
|
2012-12-17 21:22:42 +01:00
|
|
|
|
void layerModified();
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
|
|
|
|
This signal is emitted when modifications has been done on layer
|
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2014-05-24 03:52:19 +02:00
|
|
|
|
void beforeModifiedCheck() const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
|
|
|
|
Is emitted, when layer is checked for modifications. Use for last-minute additions
|
|
|
|
|
%End
|
2014-05-24 03:52:19 +02:00
|
|
|
|
|
2016-01-15 09:31:19 +01:00
|
|
|
|
void beforeEditingStarted();
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
|
|
|
|
Is emitted, before editing on this layer is started
|
|
|
|
|
%End
|
2016-01-15 09:31:19 +01:00
|
|
|
|
|
2012-08-28 22:32:17 +02:00
|
|
|
|
void editingStarted();
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
|
|
|
|
Is emitted, when editing on this layer has started
|
|
|
|
|
%End
|
2013-05-29 21:38:33 +02:00
|
|
|
|
|
2012-08-28 22:32:17 +02:00
|
|
|
|
void editingStopped();
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
|
|
|
|
Is emitted, when edited changes successfully have been written to the data provider
|
|
|
|
|
%End
|
2013-04-13 19:44:48 +03:00
|
|
|
|
|
2013-05-29 21:38:33 +02:00
|
|
|
|
void beforeCommitChanges();
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
|
|
|
|
Is emitted, before changes are committed to the data provider
|
|
|
|
|
%End
|
2013-05-29 21:38:33 +02:00
|
|
|
|
|
|
|
|
|
void beforeRollBack();
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
|
|
|
|
Is emitted, before changes are rolled back
|
|
|
|
|
%End
|
2013-05-29 21:38:33 +02:00
|
|
|
|
|
2012-08-28 22:32:17 +02:00
|
|
|
|
void attributeAdded( int idx );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Will be emitted, when a new attribute has been added to this vector layer.
|
|
|
|
|
Applies only to types QgsFields.OriginEdit, QgsFields.OriginProvider and QgsFields.OriginExpression
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param idx: The index of the new attribute
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`updatedFields`
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2015-11-08 19:18:00 +00:00
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
void beforeAddingExpressionField( const QString &fieldName );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Will be emitted, when an expression field is going to be added to this vector layer.
|
|
|
|
|
Applies only to types QgsFields.OriginExpression
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param fieldName: The name of the attribute to be added
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2012-08-28 22:32:17 +02:00
|
|
|
|
void attributeDeleted( int idx );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Will be emitted, when an attribute has been deleted from this vector layer.
|
|
|
|
|
Applies only to types QgsFields.OriginEdit, QgsFields.OriginProvider and QgsFields.OriginExpression
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param idx: The index of the deleted attribute
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`updatedFields`
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2015-11-08 19:18:00 +00:00
|
|
|
|
|
|
|
|
|
void beforeRemovingExpressionField( int idx );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Will be emitted, when an expression field is going to be deleted from this vector layer.
|
|
|
|
|
Applies only to types QgsFields.OriginExpression
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param idx: The index of the attribute to be deleted
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2015-11-08 19:18:00 +00:00
|
|
|
|
|
2014-11-21 01:17:21 +01:00
|
|
|
|
void featureAdded( QgsFeatureId fid );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Emitted when a new feature has been added to the layer
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param fid: The id of the new feature
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2015-11-08 19:18:00 +00:00
|
|
|
|
|
2013-05-29 21:38:33 +02:00
|
|
|
|
void featureDeleted( QgsFeatureId fid );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Emitted when a feature has been deleted.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
If you do expensive operations in a slot connected to this, you should prefer to use
|
2017-12-19 11:43:52 -04:00
|
|
|
|
featuresDeleted( const :py:class:`QgsFeatureIds`& ).
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param fid: The id of the feature which has been deleted
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2015-11-08 19:18:00 +00:00
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
void featuresDeleted( const QgsFeatureIds &fids );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Emitted when features have been deleted.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
If features are deleted within an edit command, this will only be emitted once at the end
|
|
|
|
|
to allow connected slots to minimize the overhead.
|
|
|
|
|
If features are deleted outside of an edit command, this signal will be emitted once per feature.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param fids: The feature ids that have been deleted.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2013-04-13 19:44:48 +03:00
|
|
|
|
void updatedFields();
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Is emitted, whenever the fields available from this layer have been changed.
|
|
|
|
|
This can be due to manually adding attributes or due to a join.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
void attributeValueChanged( QgsFeatureId fid, int idx, const QVariant &value );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Is emitted whenever an attribute value change is done in the edit buffer.
|
|
|
|
|
Note that at this point the attribute change is not yet saved to the provider.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param fid: The id of the changed feature
|
|
|
|
|
:param idx: The attribute index of the changed attribute
|
|
|
|
|
:param value: The new value of the attribute
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
|
|
|
|
void geometryChanged( QgsFeatureId fid, const QgsGeometry &geometry );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Is emitted whenever a geometry change is done in the edit buffer.
|
|
|
|
|
Note that at this point the geometry change is not yet saved to the provider.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param fid: The id of the changed feature
|
|
|
|
|
:param geometry: The new geometry
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
|
|
|
|
void committedAttributesDeleted( const QString &layerId, const QgsAttributeList &deletedAttributes );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
|
|
|
|
This signal is emitted, when attributes are deleted from the provider
|
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
void committedAttributesAdded( const QString &layerId, const QList<QgsField> &addedAttributes );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
|
|
|
|
This signal is emitted, when attributes are added to the provider
|
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
void committedFeaturesAdded( const QString &layerId, const QgsFeatureList &addedFeatures );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
|
|
|
|
This signal is emitted, when features are added to the provider
|
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
void committedFeaturesRemoved( const QString &layerId, const QgsFeatureIds &deletedFeatureIds );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
|
|
|
|
This signal is emitted, when features are deleted from the provider
|
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
void committedAttributeValuesChanges( const QString &layerId, const QgsChangedAttributesMap &changedAttributesValues );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
|
|
|
|
This signal is emitted, when attribute value changes are saved to the provider
|
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
void committedGeometriesChanges( const QString &layerId, const QgsGeometryMap &changedGeometries );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
|
|
|
|
This signal is emitted, when geometry changes are saved to the provider
|
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
|
|
|
|
void labelingFontNotFound( QgsVectorLayer *layer, const QString &fontfamily );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
|
|
|
|
Emitted when the font family defined for labeling layer is not found on system
|
|
|
|
|
%End
|
2016-07-02 18:01:28 +02:00
|
|
|
|
|
2016-02-02 19:46:18 +11:00
|
|
|
|
void featureBlendModeChanged( QPainter::CompositionMode blendMode );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
|
|
|
|
Signal emitted when setFeatureBlendMode() is called
|
|
|
|
|
%End
|
2013-09-09 09:47:05 +02:00
|
|
|
|
|
2017-05-29 20:57:24 +10:00
|
|
|
|
void opacityChanged( double opacity );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Emitted when the layer's opacity is changed, where ``opacity`` is a value between 0 (transparent)
|
|
|
|
|
and 1 (opaque).
|
|
|
|
|
|
2017-05-29 20:57:24 +10:00
|
|
|
|
.. versionadded:: 3.0
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`setOpacity`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
|
.. seealso:: :py:func:`opacity`
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2013-09-09 09:47:05 +02:00
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
void editCommandStarted( const QString &text );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Signal emitted when a new edit command has been started
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param text: Description for this edit command
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2014-05-24 03:52:19 +02:00
|
|
|
|
void editCommandEnded();
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Signal emitted, when an edit command successfully ended
|
|
|
|
|
|
2017-04-02 20:52:50 +10:00
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
|
|
This does not mean it is also committed, only that it is written
|
2018-01-12 20:51:17 -04:00
|
|
|
|
to the edit buffer. See beforeCommitChanges()
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2014-05-24 03:52:19 +02:00
|
|
|
|
|
|
|
|
|
void editCommandDestroyed();
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Signal emitted, whan an edit command is destroyed
|
|
|
|
|
|
2017-04-02 20:52:50 +10:00
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
|
|
This is not a rollback, it is only related to the current edit command.
|
2018-01-12 20:51:17 -04:00
|
|
|
|
See beforeRollBack()
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2014-05-24 03:52:19 +02:00
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
void readCustomSymbology( const QDomElement &element, QString &errorMessage );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Signal emitted whenever the symbology (QML-file) for this layer is being read.
|
|
|
|
|
If there is custom style information saved in the file, you can connect to this signal
|
|
|
|
|
and update the layer style accordingly.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param element: The XML layer style element.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param errorMessage: Write error messages into this string.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
|
|
|
|
void writeCustomSymbology( QDomElement &element, QDomDocument &doc, QString &errorMessage ) const;
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Signal emitted whenever the symbology (QML-file) for this layer is being written.
|
|
|
|
|
If there is custom style information you want to save to the file, you can connect
|
|
|
|
|
to this signal and update the element accordingly.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
|
:param element: The XML element where you can add additional style information to.
|
|
|
|
|
:param doc: The XML document that you can use to create new XML nodes.
|
|
|
|
|
:param errorMessage: Write error messages into this string.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2017-03-27 09:23:03 +02:00
|
|
|
|
|
2016-08-02 16:58:58 +02:00
|
|
|
|
void mapTipTemplateChanged();
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Emitted when the map tip changes
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-04-03 01:31:44 +02:00
|
|
|
|
.. versionadded:: 3.0
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2016-08-02 16:58:58 +02:00
|
|
|
|
|
|
|
|
|
void displayExpressionChanged();
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Emitted when the display expression changes
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-04-03 01:31:44 +02:00
|
|
|
|
.. versionadded:: 3.0
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2016-08-02 16:58:58 +02:00
|
|
|
|
|
2017-03-27 09:23:03 +02:00
|
|
|
|
void raiseError( const QString &msg );
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Signals an error related to this vector layer.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2014-11-21 01:17:21 +01:00
|
|
|
|
|
2016-08-19 07:45:09 +02:00
|
|
|
|
void editFormConfigChanged();
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Will be emitted whenever the edit form configuration of this layer changes.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-04-03 01:31:44 +02:00
|
|
|
|
.. versionadded:: 3.0
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2016-08-19 16:33:12 +02:00
|
|
|
|
|
|
|
|
|
void readOnlyChanged();
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Emitted when the read only state of this layer is changed.
|
|
|
|
|
Only applies to manually set readonly state, not to the edit mode.
|
2017-03-28 09:06:45 +02:00
|
|
|
|
|
2017-04-03 01:31:44 +02:00
|
|
|
|
.. versionadded:: 3.0
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2017-05-09 23:54:59 +02:00
|
|
|
|
void symbolFeatureCountMapChanged();
|
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
Emitted when the feature count for symbols on this layer has been recalculated.
|
2017-05-09 23:54:59 +02:00
|
|
|
|
|
|
|
|
|
.. versionadded:: 3.0
|
|
|
|
|
%End
|
2012-08-28 22:32:17 +02:00
|
|
|
|
|
2017-03-27 14:41:33 +02:00
|
|
|
|
protected:
|
2017-04-18 11:00:13 +10:00
|
|
|
|
virtual void setExtent( const QgsRectangle &rect );
|
2017-04-20 13:48:50 +02:00
|
|
|
|
|
2017-03-28 09:06:45 +02:00
|
|
|
|
%Docstring
|
|
|
|
|
Set the extent
|
|
|
|
|
%End
|
handling vector data geometry and attribute updates refactored
QgsVectorLayer:
- move attribute part of editing to vector layer class and unify with geometry handling:
* remove commitAttributeChanges(), addedFeatures(), deletedFeatureIds(), changedAttributes()
and replace with changeAttributeValue(), deleteFeature(), addAttribute()
and deleteAttribute()
* add pendingFields(), pendingAttributeList(), pendingFeatureCount()
* emit signals on start editing and commit, change of attribute values, adding/deleting of
attributes and layer or feature removal (currently used in the attribute table)
- new commitErrors() method to query errors from commitChanges()
- replaced featuresInRectangle with select/getNextFeature combo
- edit types added to support more input widgets and input constraints
QgsFeature:
- remove update aware ctor
- unify geometry handling in ctors
QgsVectorDataProvider:
- add QVariant::Type to supportNativeTypes()
QgisApp:
- add instance() method to query QgisApp object
- replace code at various place to use it instead of passing the pointer
arround or searching it in the widget tree.
- move toggleEditing() code from the legend here
QgsAttributeTable/QgsAttributeTableDisplay:
- move attribute table creation legend here
- make attribute table dockable (from Tim)
- most editing logic moved to QgsVectorLayer
- adding/deleting attributes moved to QgsVectorLayerProperties
QgsIdentifyResults:
- add support for attribute editing when it edit mode
QgsVectorLayerProperties:
add a new tab to show attribute list:
* start/stop editing
* add/delete attributes
* assign edit type to attributes (unique values, value map, ranges)
QgsAttributeDialog:
add support for attribute edit types:
* selection from unique value render classes (combobox)
* selection from unique values of existing features (combobox or line edits with completion)
* spinboxes for ranges
QgsPostgresProvider:
- use read-only connection for cursors and read-write connection for updates
- updated native types
QgsOgrProvider:
- remove unused references to GEOS geometry factory
- updated native types
git-svn-id: http://svn.osgeo.org/qgis/trunk@9092 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-08-20 12:15:14 +00:00
|
|
|
|
|
2017-03-27 14:41:33 +02:00
|
|
|
|
private: // Private methods
|
|
|
|
|
QgsVectorLayer( const QgsVectorLayer &rhs );
|
2007-01-09 02:39:15 +00:00
|
|
|
|
};
|
2017-03-27 14:41:33 +02:00
|
|
|
|
|
2017-09-25 14:20:39 +10:00
|
|
|
|
|
2017-04-01 11:05:22 +02:00
|
|
|
|
/************************************************************************
|
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
|
* *
|
|
|
|
|
* src/core/qgsvectorlayer.h *
|
|
|
|
|
* *
|
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
|
************************************************************************/
|