|
Quantum GIS API Documentation
master-693a1fe
|
Represents a vector layer which manages a vector based data sets. More...
#include <qgsvectorlayer.h>
Inheritance diagram for QgsVectorLayer:
Collaboration diagram for QgsVectorLayer:Classes | |
| struct | GroupData |
| struct | RangeData |
| struct | TabData |
| struct | ValueRelationData |
Public Types | |
| enum | EditorLayout { GeneratedLayout = 0, TabLayout = 1, UiFileLayout = 2 } |
| The different types to layout the attribute editor. More... | |
| enum | EditType { LineEdit, UniqueValues, UniqueValuesEditable, ValueMap, Classification, EditRange, SliderRange, CheckBox, FileName, Enumeration, Immutable, Hidden, TextEdit, Calendar, DialRange, ValueRelation, UuidGenerator, Photo, WebView, Color } |
| enum | VertexMarkerType { SemiTransparentCircle, Cross, NoMarker } |
| Editing vertex markers. More... | |
Public Slots | |
| QgsGeometryCache * | cache () |
| void | checkJoinLayerRemove (QString theLayerId) |
| Check if there is a join with a layer that will be removed. | |
| void | deselect (const QgsFeatureId featureId) |
| Deselect feature by its ID. | |
| void | deselect (const QgsFeatureIds &featureIds) |
| Deselect features by their ID. | |
| QString | metadata () |
| Obtain Metadata for this layer. | |
| virtual void | onCacheImageDelete () |
| Is called when the cache image is being deleted. | |
| void | removeSelection () |
| Clear selection. | |
| void | select (const QgsFeatureId &featureId) |
| Select feature by its ID. | |
| void | select (const QgsFeatureIds &featureIds) |
| Select features by their ID. | |
| void | triggerRepaint () |
| virtual void | updateExtents () |
| Update the extents for the layer. | |
Signals | |
| void | attributeAdded (int idx) |
| Will be emitted, when a new attribute has been added to this vector layer. | |
| void | attributeDeleted (int idx) |
| Will be emitted, when an attribute has been deleted from this vector layer. | |
| void | attributeValueChanged (QgsFeatureId fid, int idx, const QVariant &) |
| void | beforeCommitChanges () |
| Is emitted, before changes are commited to the data provider. | |
| void | committedAttributesAdded (const QString &layerId, const QList< QgsField > &addedAttributes) |
| void | committedAttributesDeleted (const QString &layerId, const QgsAttributeList &deletedAttributes) |
| Signals emitted after committing changes. | |
| void | committedAttributeValuesChanges (const QString &layerId, const QgsChangedAttributesMap &changedAttributesValues) |
| void | committedFeaturesAdded (const QString &layerId, const QgsFeatureList &addedFeatures) |
| void | committedFeaturesRemoved (const QString &layerId, const QgsFeatureIds &deletedFeatureIds) |
| void | committedGeometriesChanges (const QString &layerId, const QgsGeometryMap &changedGeometries) |
| void | editingStarted () |
| Is emitted, when editing on this layer has started. | |
| void | editingStopped () |
| Is emitted, when edited changes successfully have been written to the data provider. | |
| void | featureAdded (QgsFeatureId fid) |
| void | featureDeleted (QgsFeatureId fid) |
| void | geometryChanged (QgsFeatureId fid, QgsGeometry &geom) |
| void | layerDeleted () |
| void | layerModified () |
| This signal is emitted when modifications has been done on layer. | |
| void | selectionChanged (const QgsFeatureIds selected, const QgsFeatureIds deselected, const bool clearAndSelect) |
| This signal is emitted when selection was changed. | |
| void | selectionChanged () |
| This signal is emitted when selection was changed. | |
| void | updatedFields () |
| Is emitted, whenever the fields available from this layer have been changed. | |
Public Member Functions | |
| QgsVectorLayer (QString path=QString::null, QString baseName=QString::null, QString providerLib=QString::null, bool loadDefaultStyleFlag=true) | |
| Constructor - creates a vector layer. | |
| virtual | ~QgsVectorLayer () |
| Destructor. | |
| QgsAttributeAction * | actions () |
| bool | addAttribute (const QgsField &field) |
| add an attribute field (but does not commit it) returns true if the field was added | |
| void | addAttributeAlias (int attIndex, QString aliasString) |
| Sets an alias (a display name) for attributes to display in dialogs. | |
| void | addAttributeEditorWidget (QgsAttributeEditorElement *data) |
| Adds a tab (for the attribute editor form) holding groups and fields. | |
| bool | addFeature (QgsFeature &f, bool alsoUpdateExtent=true) |
| Adds a feature. | |
| bool | addFeatures (QgsFeatureList features, bool makeSelected=true) |
| Insert a copy of the given features into the layer (but does not commit it) | |
| void | addJoin (const QgsVectorJoinInfo &joinInfo) |
| Joins another vector layer to this layer. | |
| void | addOverlay (QgsVectorOverlay *overlay) |
| Adds a new overlay to this class. | |
| int | addPart (const QList< QgsPoint > &ring) |
| Adds a new part polygon to a multipart feature. | |
| int | addRing (const QList< QgsPoint > &ring) |
| Adds a ring to polygon/multipolygon features. | |
| int | addTopologicalPoints (QgsGeometry *geom) |
| Adds topological points for every vertex of the geometry. | |
| int | addTopologicalPoints (const QgsPoint &p) |
| Adds a vertex to segments which intersect point p but don't already have a vertex there. | |
| QString | annotationForm () const |
| get annotation form (added in 1.5) | |
| virtual bool | applyNamedStyle (QString namedStyle, QString errorMsg) |
| QString | attributeAlias (int attributeIndex) const |
| Returns the alias of an attribute name or an empty string if there is no alias. | |
| const QMap< QString, QString > & | attributeAliases () const |
| QString | attributeDisplayName (int attributeIndex) const |
| Convenience function that returns the attribute alias if defined or the field name else. | |
| QgsAttributeEditorElement * | attributeEditorElementFromDomElement (QDomElement &elem, QObject *parent) |
| convert a saved attribute editor element into a AttributeEditor structure as it's used internally. | |
| QList < QgsAttributeEditorElement * > & | attributeEditorElements () |
| Returns a list of tabs holding groups and fields. | |
| void | beginEditCommand (QString text) |
| Create edit command for undo/redo operations. | |
| QgsRectangle | boundingBoxOfSelected () |
| Returns the bounding box of the selected features. | |
| QString | capabilitiesString () const |
| Capabilities for this layer in a friendly format. | |
| bool | changeAttributeValue (QgsFeatureId fid, int field, QVariant value, bool emitSignal=true) |
| changed an attribute value (but does not commit it) | |
| bool | changeGeometry (QgsFeatureId fid, QgsGeometry *geom) |
| change feature's geometry | |
| QPair< QString, QString > | checkedState (int idx) |
| return string representing 'true' for a checkbox (added in 1.4) | |
| void | clearAttributeEditorWidgets () |
| Clears all the tabs for the attribute editor form. | |
| bool | commitChanges () |
| Attempts to commit any changes to disk. | |
| const QStringList & | commitErrors () |
| bool | countSymbolFeatures (bool showProgress=true) |
| Count features for symbols. | |
| void | createJoinCaches () |
| Caches joined attributes if required (and not already done) | |
| QString | dataComment () const |
| Returns a comment for the data in the layer. | |
| QgsVectorDataProvider * | dataProvider () |
| Returns the data provider. | |
| const QgsVectorDataProvider * | dataProvider () const |
| Returns the data provider in a const-correct manner. | |
| QString & | dateFormat (int idx) |
| access date format | |
| bool | deleteAttribute (int attr) |
| delete an attribute field (but does not commit it) | |
| bool | deleteAttributes (QList< int > attrs) |
| Deletes a list of attribute fields (but does not commit it) | |
| bool | deleteFeature (QgsFeatureId fid) |
| delete a feature from the layer (but does not commit it) | |
| bool | deleteSelectedFeatures () |
| Deletes the selected features. | |
| bool | deleteVertex (QgsFeatureId atFeatureId, int atVertex) |
| Deletes a vertex from a feature. | |
| void | destroyEditCommand () |
| Destroy active command and reverts all changes in it. | |
| const QgsDiagramLayerSettings * | diagramLayerSettings () const |
| const QgsDiagramRendererV2 * | diagramRenderer () const |
| const QString | displayExpression () |
| Get the preview expression, used to create a human readable preview string. | |
| const QString | displayField () const |
| Returns the primary display field name used in the identify results dialog. | |
| bool | draw (QgsRenderContext &rendererContext) |
| Draws the layer. | |
| void | drawLabels (QgsRenderContext &rendererContext) |
| Draws the layer labels using coordinate transformation. | |
| void | drawRendererV2 (QgsFeatureIterator &fit, QgsRenderContext &rendererContext, bool labeling) |
| Draw layer with renderer V2. | |
| void | drawRendererV2Levels (QgsFeatureIterator &fit, QgsRenderContext &rendererContext, bool labeling) |
| Draw layer with renderer V2 using symbol levels. | |
| QgsVectorLayerEditBuffer * | editBuffer () |
| Buffer with uncommitted editing operations. Only valid after editing has been turned on. | |
| QString | editForm () |
| get edit form (added in 1.4) | |
| QString | editFormInit () |
| get python function for edit form initialization (added in 1.4) | |
| EditorLayout | editorLayout () |
| get the active layout for the attribute editor for this layer (added in 1.9) | |
| EditType | editType (int idx) |
| get edit type | |
| void | enableLabels (bool on) |
| Set labels on. | |
| void | endEditCommand () |
| Finish edit command and add it to undo/redo stack. | |
| const QSet< QString > & | excludeAttributesWFS () const |
| const QSet< QString > & | excludeAttributesWMS () const |
| QgsRectangle | extent () |
| Return the extent of the layer as a QRect. | |
| QPainter::CompositionMode | featureBlendMode () const |
| Read blend mode for layer. | |
| virtual long | featureCount () const |
| Number of features in the layer. | |
| long | featureCount (QgsSymbolV2 *symbol) |
| Number of features rendered with specified symbol. | |
| bool | fieldEditable (int idx) |
| is edit widget editable | |
| int | fieldNameIndex (const QString &fieldName) const |
| Returns the index of a field name or -1 if the field does not exist. | |
| QgsVectorOverlay * | findOverlayByType (const QString &typeName) |
| Returns the (first) overlay of a type, e.g. | |
| QGis::GeometryType | geometryType () const |
| Returns point, line or polygon. | |
| QgsFeatureIterator | getFeatures (const QgsFeatureRequest &request=QgsFeatureRequest()) |
| Query the provider for features specified in request. | |
| virtual QString | getStyleFromDatabase (QString styleId, QString &msgError) |
| Will return the named style corresponding to style id provided. | |
| bool | hasGeometryType () const |
| Returns true if this is a geometry layer and false in case of NoGeometry (table only) or UnknownGeometry. | |
| bool | hasLabelsEnabled () const |
| Label is on. | |
| int | insertSegmentVerticesForSnap (const QList< QgsSnappingResult > &snapResults) |
| Inserts vertices to the snapped segments. | |
| bool | insertVertex (double x, double y, QgsFeatureId atFeatureId, int beforeVertex) |
| 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. | |
| void | invertSelection () |
| Select not selected features and deselect selected ones. | |
| void | invertSelectionInRectangle (QgsRectangle &rect) |
| Invert selection of features found within the search rectangle (in layer's coordinates) | |
| virtual bool | isEditable () const |
| Returns true if the provider is in editing mode. | |
| virtual bool | isModified () const |
| Returns true if the provider has been modified since the last commit. | |
| virtual bool | isReadOnly () const |
| Returns true if the provider is in read-only mode. | |
| QgsLabel * | label () |
| Get the label object associated with this layer. | |
| const QgsLabel * | label () const |
| int | layerTransparency () const |
| Read transparency for layer. | |
| virtual int | listStylesInDatabase (QStringList &ids, QStringList &names, QStringList &descriptions, QString &msgError) |
| Lists all the style in db split into related to the layer and not related to. | |
| virtual QString | loadNamedStyle (const QString theURI, bool &theResultFlag, bool loadFromLocalDb) |
| Load a named style from file/local db/datasource db. | |
| virtual QString | loadNamedStyle (const QString theURI, bool &theResultFlag) |
| Calls loadNamedStyle( theURI, theResultFlag, false ); Retained for backward compatibility. | |
| QVariant | maximumValue (int index) |
| Returns maximum value for an attribute column or invalid variant in case of error. | |
| QVariant | minimumValue (int index) |
| Returns minimum value for an attribute column or invalid variant in case of error. | |
| void | modifySelection (QgsFeatureIds selectIds, QgsFeatureIds deselectIds) |
| Modifies the current selection on this layer. | |
| bool | moveVertex (double x, double y, QgsFeatureId atFeatureId, int atVertex) |
| Moves the vertex at the given position number, ring and item (first number is index 0), and feature to the given coordinates. | |
| QgsAttributeList | pendingAllAttributesList () |
| returns list of attributes | |
| int | pendingFeatureCount () |
| returns feature count after commit | |
| const QgsFields & | pendingFields () const |
| returns field list in the to-be-committed state | |
| QgsAttributeList | pendingPkAttributesList () |
| returns list of attribute making up the primary key | |
| QString | providerType () const |
| Return the provider type for this layer. | |
| RangeData & | range (int idx) |
| access range | |
| bool | readSld (const QDomNode &node, QString &errorMessage) |
| bool | readSymbology (const QDomNode &node, QString &errorMessage) |
| Read the symbology for the current layer from the Dom node supplied. | |
| virtual bool | readXml (const QDomNode &layer_node) |
| reads vector layer specific state from project file Dom node. | |
| virtual void | reload () |
| Synchronises with changes in the datasource. | |
| void | removeJoin (const QString &joinLayerId) |
| Removes a vector layer join. | |
| void | removeOverlay (const QString &typeName) |
| Removes all overlays of a given type. | |
| int | removePolygonIntersections (QgsGeometry *geom, QgsFeatureIds ignoreFeatures=QgsFeatureIds()) |
| Changes the specified geometry such that it has no intersections with other polygon (or multipolygon) geometries in this vector layer. | |
| QgsFeatureRendererV2 * | rendererV2 () |
| Return renderer V2. | |
| bool | rollBack (bool deleteBuffer=true) |
| Stop editing and discard the edits. | |
| virtual void | saveStyleToDatabase (QString name, QString description, bool useAsDefault, QString uiFileContent, QString &msgError) |
| Save named and sld style of the layer to the style table in the db. | |
| void | select (QgsRectangle &rect, bool addToSelection) |
| Select features found within the search rectangle (in layer's coordinates) | |
| int | selectedFeatureCount () |
| The number of features that are selected in this layer. | |
| QgsFeatureList | selectedFeatures () |
| Get a copy of the user-selected features. | |
| const QgsFeatureIds & | selectedFeaturesIds () const |
| Return reference to identifiers of selected features. | |
| void | setAnnotationForm (const QString &ui) |
| set annotation form for layer (added in 1.5) | |
| void | setCheckedState (int idx, QString checked, QString notChecked) |
| set string representing 'true' for a checkbox (added in 1.4) | |
| void | setCoordinateSystem () |
| Setup the coordinate system tranformation for the layer. | |
| void | setDiagramLayerSettings (const QgsDiagramLayerSettings &s) |
| void | setDiagramRenderer (QgsDiagramRendererV2 *r) |
| Sets diagram rendering object (takes ownership) | |
| void | setDisplayExpression (const QString displayExpression) |
| Set the preview expression, used to create a human readable preview string. | |
| void | setDisplayField (QString fldName="") |
| Set the primary display field to be used in the identify results dialog. | |
| void | setEditForm (QString ui) |
| set edit form (added in 1.4) | |
| void | setEditFormInit (QString function) |
| set python function for edit form initialization (added in 1.4) | |
| void | setEditorLayout (EditorLayout editorLayout) |
| set the active layout for the attribute editor for this layer (added in 1.9) | |
| void | setEditType (int idx, EditType edit) |
| set edit type | |
| void | setExcludeAttributesWFS (const QSet< QString > &att) |
| void | setExcludeAttributesWMS (const QSet< QString > &att) |
| void | setFeatureBlendMode (const QPainter::CompositionMode blendMode) |
| Write blend mode for features. | |
| void | setFieldEditable (int idx, bool editable) |
| set edit widget editable | |
| void | setLayerTransparency (int layerTransparency) |
| Write transparency for layer. | |
| void | setProviderEncoding (const QString &encoding) |
| Sets the textencoding of the data provider. | |
| bool | setReadOnly (bool readonly=true) |
| Make layer read-only (editing disabled) or not. | |
| void | setRendererV2 (QgsFeatureRendererV2 *r) |
| Set renderer V2. | |
| void | setSelectedFeatures (const QgsFeatureIds &ids) |
| Change selection to the new set of features. | |
| virtual bool | setSubsetString (QString subset) |
| Set the string (typically sql) used to define a subset of the layer. | |
| bool | snapPoint (QgsPoint &point, double tolerance) |
| Snaps a point to the closest vertex if there is one within the snapping tolerance. | |
| int | snapWithContext (const QgsPoint &startPoint, double snappingTolerance, QMultiMap< double, QgsSnappingResult > &snappingResults, QgsSnapper::SnappingType snap_to) |
| Snaps to segment or vertex within given tolerance. | |
| int | splitFeatures (const QList< QgsPoint > &splitLine, bool topologicalEditing=false) |
| Splits features cut by the given line. | |
| bool | startEditing () |
| Make layer editable. | |
| QString | storageType () const |
| Returns the permanent storage type for this layer as a friendly name. | |
| virtual QString | subsetString () |
| Get the string (typically sql) used to define a subset of the layer. | |
| int | translateFeature (QgsFeatureId featureId, double dx, double dy) |
| Translates feature by dx, dy. | |
| void | uniqueValues (int index, QList< QVariant > &uniqueValues, int limit=-1) |
| Returns unique values for column. | |
| bool | updateFeature (QgsFeature &f) |
| Updates an existing feature. | |
| void | updateFields () |
| Assembles mUpdatedFields considering provider fields, joined fields and added fields. | |
| QMap< QString, QVariant > & | valueMap (int idx) |
| access value map | |
| ValueRelationData & | valueRelation (int idx) |
| access relations | |
| const QList< QgsVectorJoinInfo > & | vectorJoins () const |
| void | vectorOverlays (QList< QgsVectorOverlay * > &overlayList) |
| Returns pointers to the overlays of this layer. | |
| QSize & | widgetSize (int idx) |
| access widget size for photo and webview widget | |
| QGis::WkbType | wkbType () const |
| Returns the WKBType or WKBUnknown in case of error. | |
| bool | writeSld (QDomNode &node, QDomDocument &doc, QString &errorMessage) const |
| bool | writeSymbology (QDomNode &node, QDomDocument &doc, QString &errorMessage) const |
| Write the symbology for the layer into the docment provided. | |
| virtual bool | writeXml (QDomNode &layer_node, QDomDocument &doc) |
| write vector layer specific state to project file Dom node. | |
Static Public Member Functions | |
| static void | drawVertexMarker (double x, double y, QPainter &p, QgsVectorLayer::VertexMarkerType type, int vertexSize) |
| Draws a vertex symbol at (screen) coordinates x, y. | |
Protected Member Functions | |
| void | setExtent (const QgsRectangle &rect) |
| Set the extent. | |
Private Member Functions | |
| QgsVectorLayer (const QgsVectorLayer &rhs) | |
| vector layers are not copyable | |
| QgsFeatureId | findFreeId () |
| Goes through all features and finds a free id (e.g. | |
| QgsVectorLayer & | operator= (QgsVectorLayer const &rhs) |
| vector layers are not copyable | |
| void | prepareLabelingAndDiagrams (QgsRenderContext &rendererContext, QgsAttributeList &attributes, bool &labeling) |
| Registers label and diagram layer. | |
| bool | setDataProvider (QString const &provider) |
| bind layer to a specific data provider | |
| void | snapToGeometry (const QgsPoint &startPoint, QgsFeatureId featureId, QgsGeometry *geom, double sqrSnappingTolerance, QMultiMap< double, QgsSnappingResult > &snappingResults, QgsSnapper::SnappingType snap_to) const |
| Snaps to a geometry and adds the result to the multimap if it is within the snapping result. | |
| void | stopRendererV2 (QgsRenderContext &rendererContext, QgsSingleSymbolRendererV2 *selRenderer) |
| Add joined attributes to a feature. | |
Static Private Member Functions | |
| static int | currentVertexMarkerSize () |
| Reads vertex marker size from settings. | |
| static QgsVectorLayer::VertexMarkerType | currentVertexMarkerType () |
| Reads vertex marker type from settings. | |
Private Attributes | |
| QgsAttributeAction * | mActions |
| The user-defined actions that are accessed from the Identify Results dialog box. | |
| QString | mAnnotationForm |
| QMap< QString, QString > | mAttributeAliasMap |
| Map that stores the aliases for attributes. | |
| QList < QgsAttributeEditorElement * > | mAttributeEditorElements |
| Stores a list of attribute editor elements (Each holding a tree structure for a tab in the attribute editor) | |
| QgsGeometryCache * | mCache |
| cache for some vector layer data - currently only geometries for faster editing | |
| QMap< QString, QPair< QString, QString > > | mCheckedStates |
| QStringList | mCommitErrors |
| QgsRenderContext * | mCurrentRendererContext |
| int | mCurrentVertexMarkerSize |
| The current size of editing marker. | |
| QgsVectorLayer::VertexMarkerType | mCurrentVertexMarkerType |
| The current type of editing marker. | |
| QgsVectorDataProvider * | mDataProvider |
| Pointer to data provider derived from the abastract base class QgsDataProvider. | |
| QMap< QString, QString > | mDateFormats |
| QgsDiagramLayerSettings * | mDiagramLayerSettings |
| QgsDiagramRendererV2 * | mDiagramRenderer |
| QString | mDisplayExpression |
| the preview expression used to generate a human readable preview string for features | |
| QString | mDisplayField |
| index of the primary label field | |
| QgsVectorLayerEditBuffer * | mEditBuffer |
| stores information about uncommitted changes to layer | |
| QString | mEditForm |
| QString | mEditFormInit |
| EditorLayout | mEditorLayout |
| Defines the default layout to use for the attribute editor (Drag and drop, UI File, Generated) | |
| QMap< QString, EditType > | mEditTypes |
| bool | mEnableBackbuffer |
| Enables backbuffering for the map window. | |
| QSet< QString > | mExcludeAttributesWFS |
| Attributes which are not published in WFS. | |
| QSet< QString > | mExcludeAttributesWMS |
| Attributes which are not published in WMS. | |
| QPainter::CompositionMode | mFeatureBlendMode |
| Blend mode for features. | |
| QMap< QString, bool > | mFieldEditables |
| QgsVectorLayerJoinBuffer * | mJoinBuffer |
| QgsLabel * | mLabel |
| Label. | |
| bool | mLabelOn |
| Display labels. | |
| int | mLayerTransparency |
| Layer transparency. | |
| QList< QgsVectorOverlay * > | mOverlays |
| List of overlays. | |
| QgsFeatureIterator | mProviderIterator |
| QString | mProviderKey |
| Data provider key. | |
| QMap< QString, RangeData > | mRanges |
| bool | mReadOnly |
| Flag indicating whether the layer is in read-only mode (editing disabled) or not. | |
| QgsFeatureRendererV2 * | mRendererV2 |
| Renderer object which holds the information about how to display the features. | |
| QgsFeatureIds | mSelectedFeatureIds |
| Set holding the feature IDs that are activated. | |
| bool | mSymbolFeatureCounted |
| QMap< QgsSymbolV2 *, long > | mSymbolFeatureCountMap |
| QList< TabData > | mTabs |
| Map that stores the tab for attributes in the edit form. | |
| QgsFields | mUpdatedFields |
| field map to commit | |
| int | mUpdateThreshold |
| Update threshold for drawing features as they are read. | |
| bool | mValidExtent |
| QMap< QString, QMap< QString, QVariant > > | mValueMaps |
| QMap< QString, ValueRelationData > | mValueRelations |
| bool | mVertexMarkerOnlyForSelection |
| Flag if the vertex markers should be drawn only for selection (true) or for all features (false) | |
| QMap< QString, QSize > | mWidgetSize |
| int | mWkbType |
| Geometry type as defined in enum WkbType (qgis.h) | |
Friends | |
| class | QgsVectorLayerEditBuffer |
| class | QgsVectorLayerFeatureIterator |
Represents a vector layer which manages a vector based data sets.
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.
The QgsVectorLayer provides a common interface to the different data types. It also manages editing transactions.
Sample usage of the QgsVectorLayer class:
QString uri = "point?crs=epsg:4326&field=id:integer"; QgsVectorLayer *scratchLayer = new QgsVectorLayer(uri, "Scratch point layer", "memory");
The main data providers supported by QGIS are listed below.
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:
An example url is "Point?crs=epsg:4326&field=id:integer&field=name:string(20)&index=yes"
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.
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.
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.
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.
Connects to an SQLanywhere database. The url defines the connection parameters, table, geometry column, and other attributes. The url can be constructed using the QgsDataSourceURI class.
Used to access data provided by a web feature service.
The url can be a HTTP url to a WFS 1.0.0 server or a GML2 data file path. Examples are http://foobar/wfs or /foo/bar/file.gml
If a GML2 file path is provided the driver will attempt to read the schema from a file in the same directory with the same basename + “.xsd”. This xsd file must be in the same format as a WFS describe feature type response. If no xsd file is provide then the driver will attempt to guess the attribute types from the file.
In the case of a HTTP URL 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.
Also note:
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.
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.
At its simplest the url can just be the filename, in which case it will be loaded as a CSV formatted file.
The url may include the following items:
Defines the character encoding in the file. The default is UTF-8. To use the default encoding for the operating system use "System".
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.
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.
Defines the characters that are used as quote characters for csv and plain type files.
Defines the characters used to escape delimiter, quote, and newline characters.
Defines the number of lines to ignore at the beginning of the file (default 0)
Defines whether the first record in the file (after skipped lines) contains column names (default yes)
If yes then leading and trailing whitespace will be removed from fields
If yes then empty fields will be discarded (eqivalent to concatenating consecutive delimiters)
Specifies the maximum number of fields to load for each record. Additional fields will be discarded. Default is 0 - load all fields.
Defines a character that is used as a decimal point in the numeric columns The default is '.'.
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).
If yes then the X and Y coordinates are interpreted as degrees/minutes/seconds format (fairly permissively), or degree/minutes format.
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).
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.
geomType can also be set to none, in which case the layer is loaded without geometries.
Defines an expression that will identify a subset of records to display
Defines the coordinate reference system used for the layer. This can be any string accepted by QgsCoordinateReferenceSystem::createFromString()
-subsetIndex=(yes|no)
Determines whether the provider generates an index to improve the efficiency of subsets. The default is yes
-spatialIndex=(yes|no)
Determines whether the provider generates a spatial index. The default is no.
-watchFile=(yes|no)
Defines whether the file will be monitored for changes. The default is to monitor for changes.
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).
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").
An example url is "/home/user/data/holiday.gpx?type=route"
Provider to display vector data in a GRASS GIS layer.
Definition at line 412 of file qgsvectorlayer.h.
The different types to layout the attribute editor.
Definition at line 418 of file qgsvectorlayer.h.
Definition at line 425 of file qgsvectorlayer.h.
Editing vertex markers.
Definition at line 1195 of file qgsvectorlayer.h.
| QgsVectorLayer::QgsVectorLayer | ( | QString | path = QString::null, |
| QString | baseName = QString::null, |
||
| QString | providerLib = QString::null, |
||
| bool | loadDefaultStyleFlag = true |
||
| ) |
Constructor - creates a vector layer.
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.
| path | The path or url of the parameter. Typically this encodes parameters used by the data provider as url query items. |
| baseName | The name used to represent the layer in the legend |
| providerLib | The name of the data provider, eg "memory", "postgres" |
| loadDefaultStyleFlag | whether to load the default style |
Definition at line 113 of file qgsvectorlayer.cpp.
References checkJoinLayerRemove(), QgsFeatureRendererV2::defaultRenderer(), geometryType(), hasGeometryType(), QgsMapLayerRegistry::instance(), QgsMapLayer::loadDefaultStyle(), mActions, mJoinBuffer, mProviderKey, QgsMapLayer::mValid, selectionChanged(), setCoordinateSystem(), setDataProvider(), setRendererV2(), and updateFields().
| QgsVectorLayer::~QgsVectorLayer | ( | ) | [virtual] |
Destructor.
Definition at line 186 of file qgsvectorlayer.cpp.
References layerDeleted(), mActions, mCache, mDataProvider, mDiagramLayerSettings, mEditBuffer, mJoinBuffer, mLabel, mOverlays, QgsMapLayer::mValid, and QgsDebugMsg.
| QgsVectorLayer::QgsVectorLayer | ( | const QgsVectorLayer & | rhs | ) | [private] |
vector layers are not copyable
| QgsAttributeAction* QgsVectorLayer::actions | ( | ) | [inline] |
Definition at line 587 of file qgsvectorlayer.h.
Referenced by QgsAttributeTableModel::executeAction(), and QgsDualView::viewWillShowContextMenu().
| bool QgsVectorLayer::addAttribute | ( | const QgsField & | field | ) |
add an attribute field (but does not commit it) returns true if the field was added
Definition at line 2420 of file qgsvectorlayer.cpp.
References QgsVectorLayerEditBuffer::addAttribute(), mDataProvider, and mEditBuffer.
Referenced by QgsOfflineEditing::applyAttributesAdded().
| void QgsVectorLayer::addAttributeAlias | ( | int | attIndex, |
| QString | aliasString | ||
| ) |
Sets an alias (a display name) for attributes to display in dialogs.
Definition at line 2428 of file qgsvectorlayer.cpp.
References layerModified(), mAttributeAliasMap, QgsMapLayer::name(), and pendingFields().
Adds a tab (for the attribute editor form) holding groups and fields.
Definition at line 2439 of file qgsvectorlayer.cpp.
References mAttributeEditorElements.
| bool QgsVectorLayer::addFeature | ( | QgsFeature & | f, |
| bool | alsoUpdateExtent = true |
||
| ) |
Adds a feature.
| f | feature to add |
| alsoUpdateExtent | If True, will also go to the effort of e.g. updating the extents. |
Definition at line 1206 of file qgsvectorlayer.cpp.
References QgsVectorLayerEditBuffer::addFeature(), mDataProvider, and mEditBuffer.
Referenced by QgsOfflineEditing::applyFeaturesAdded(), and QgsOfflineEditing::copyVectorLayer().
| bool QgsVectorLayer::addFeatures | ( | QgsFeatureList | features, |
| bool | makeSelected = true |
||
| ) |
Insert a copy of the given features into the layer (but does not commit it)
Definition at line 2660 of file qgsvectorlayer.cpp.
References QgsVectorLayerEditBuffer::addFeatures(), mDataProvider, mEditBuffer, and setSelectedFeatures().
| void QgsVectorLayer::addJoin | ( | const QgsVectorJoinInfo & | joinInfo | ) |
Joins another vector layer to this layer.
| joinInfo | join object containing join layer id, target and source field |
Definition at line 3147 of file qgsvectorlayer.cpp.
References QgsVectorLayerJoinBuffer::addJoin(), mJoinBuffer, and updateFields().
| void QgsVectorLayer::addOverlay | ( | QgsVectorOverlay * | overlay | ) |
Adds a new overlay to this class.
QgsVectorLayer takes ownership of the object
Definition at line 3044 of file qgsvectorlayer.cpp.
References mOverlays.
| int QgsVectorLayer::addPart | ( | const QList< QgsPoint > & | ring | ) |
Adds a new part polygon to a multipart feature.
Definition at line 1327 of file qgsvectorlayer.cpp.
References QgsVectorLayerEditUtils::addPart(), mDataProvider, mEditBuffer, mSelectedFeatureIds, and QgsDebugMsg.
| int QgsVectorLayer::addRing | ( | const QList< QgsPoint > & | ring | ) |
Adds a ring to polygon/multipolygon features.
Definition at line 1318 of file qgsvectorlayer.cpp.
References QgsVectorLayerEditUtils::addRing(), mDataProvider, and mEditBuffer.
| int QgsVectorLayer::addTopologicalPoints | ( | QgsGeometry * | geom | ) |
Adds topological points for every vertex of the geometry.
| geom | the geometry where each vertex is added to segments of other features |
Definition at line 1412 of file qgsvectorlayer.cpp.
References QgsVectorLayerEditUtils::addTopologicalPoints(), mDataProvider, and mEditBuffer.
| int QgsVectorLayer::addTopologicalPoints | ( | const QgsPoint & | p | ) |
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.
| p | position of the vertex |
Definition at line 1421 of file qgsvectorlayer.cpp.
References QgsVectorLayerEditUtils::addTopologicalPoints(), mDataProvider, and mEditBuffer.
| QString QgsVectorLayer::annotationForm | ( | ) | const [inline] |
get annotation form (added in 1.5)
Definition at line 1111 of file qgsvectorlayer.h.
Referenced by QgsFormAnnotationItem::QgsFormAnnotationItem().
| bool QgsVectorLayer::applyNamedStyle | ( | QString | namedStyle, |
| QString | errorMsg | ||
| ) | [virtual] |
Definition at line 3910 of file qgsvectorlayer.cpp.
References readSymbology(), QgsMapLayer::setMaximumScale(), QgsMapLayer::setMinimumScale(), QgsMapLayer::toggleScaleBasedVisibility(), and tr.
Referenced by loadNamedStyle().
| void QgsVectorLayer::attributeAdded | ( | int | idx | ) | [signal] |
Will be emitted, when a new attribute has been added to this vector layer.
Applies only to types QgsFields::OriginEdit and QgsFields::OriginProvider
| idx | The index of the new attribute |
Referenced by startEditing().
| QString QgsVectorLayer::attributeAlias | ( | int | attributeIndex | ) | const |
Returns the alias of an attribute name or an empty string if there is no alias.
Definition at line 2444 of file qgsvectorlayer.cpp.
References mAttributeAliasMap, QgsMapLayer::name(), and pendingFields().
Referenced by attributeDisplayName(), QgsAttributeTableModel::headerData(), and QgsComposerAttributeTable::initializeAliasMap().
| const QMap< QString, QString >& QgsVectorLayer::attributeAliases | ( | ) | const [inline] |
Definition at line 1035 of file qgsvectorlayer.h.
| void QgsVectorLayer::attributeDeleted | ( | int | idx | ) | [signal] |
Will be emitted, when an attribute has been deleted from this vector layer.
Applies only to types QgsFields::OriginEdit and QgsFields::OriginProvider
| idx | The index of the deleted attribute |
Referenced by startEditing().
| QString QgsVectorLayer::attributeDisplayName | ( | int | attributeIndex | ) | const |
Convenience function that returns the attribute alias if defined or the field name else.
Definition at line 2454 of file qgsvectorlayer.cpp.
References attributeAlias(), QgsFields::count(), and pendingFields().
Referenced by QgsAttributeEditor::createWidgetFromDef(), QgsAttributeAction::expandAction(), and QgsAttributeDialog::QgsAttributeDialog().
| QgsAttributeEditorElement * QgsVectorLayer::attributeEditorElementFromDomElement | ( | QDomElement & | elem, |
| QObject * | parent | ||
| ) |
convert a saved attribute editor element into a AttributeEditor structure as it's used internally.
| elem | the DOM element |
| parent | the QObject which will own this object |
Definition at line 2052 of file qgsvectorlayer.cpp.
References QgsAttributeEditorContainer::addChildElement(), dataProvider(), QgsVectorDataProvider::fieldNameMap(), and QgsMapLayer::name().
Referenced by readSymbology().
| QList< QgsAttributeEditorElement * > & QgsVectorLayer::attributeEditorElements | ( | ) |
Returns a list of tabs holding groups and fields.
Definition at line 3756 of file qgsvectorlayer.cpp.
References mAttributeEditorElements.
Referenced by QgsAttributeDialog::QgsAttributeDialog().
| void QgsVectorLayer::attributeValueChanged | ( | QgsFeatureId | fid, |
| int | idx, | ||
| const QVariant & | |||
| ) | [signal] |
Referenced by startEditing().
| void QgsVectorLayer::beforeCommitChanges | ( | ) | [signal] |
Is emitted, before changes are commited to the data provider.
Referenced by commitChanges().
| void QgsVectorLayer::beginEditCommand | ( | QString | text | ) |
Create edit command for undo/redo operations.
| text | text which is to be displayed in undo window |
Definition at line 3100 of file qgsvectorlayer.cpp.
References QgsMapLayer::undoStack().
Referenced by QgsDualView::saveEditChanges(), and QgsAttributeTableDelegate::setModelData().
Returns the bounding box of the selected features.
If there is no selection, QgsRectangle(0,0,0,0) is returned
Definition at line 944 of file qgsvectorlayer.cpp.
References QgsGeometry::boundingBox(), QgsVectorDataProvider::capabilities(), QgsRectangle::combineExtentWith(), QgsFeature::geometry(), getFeatures(), QgsRectangle::height(), QgsFeature::id(), mDataProvider, mSelectedFeatureIds, QgsFeatureIterator::nextFeature(), QgsVectorDataProvider::SelectAtId, QgsRectangle::set(), QgsRectangle::setMinimal(), QgsRectangle::width(), QgsRectangle::xMaximum(), QgsRectangle::xMinimum(), QgsRectangle::yMaximum(), and QgsRectangle::yMinimum().
Referenced by QgsGeometryAnalyzer::extent(), QgsMapCanvas::panToSelected(), and QgsMapCanvas::zoomToSelected().
| QgsGeometryCache* QgsVectorLayer::cache | ( | ) | [inline, slot] |
Definition at line 1304 of file qgsvectorlayer.h.
Referenced by QgsVectorLayerUndoCommand::cache().
| QString QgsVectorLayer::capabilitiesString | ( | ) | const |
Capabilities for this layer in a friendly format.
Definition at line 222 of file qgsvectorlayer.cpp.
References QgsVectorDataProvider::capabilitiesString(), and mDataProvider.
Referenced by metadata().
| bool QgsVectorLayer::changeAttributeValue | ( | QgsFeatureId | fid, |
| int | field, | ||
| QVariant | value, | ||
| bool | emitSignal = true |
||
| ) |
changed an attribute value (but does not commit it)
Definition at line 2411 of file qgsvectorlayer.cpp.
References QgsVectorLayerEditBuffer::changeAttributeValue(), mDataProvider, and mEditBuffer.
Referenced by QgsOfflineEditing::applyAttributeValueChanges(), QgsDualView::saveEditChanges(), QgsAttributeTableDelegate::setModelData(), and updateFeature().
| bool QgsVectorLayer::changeGeometry | ( | QgsFeatureId | fid, |
| QgsGeometry * | geom | ||
| ) |
change feature's geometry
Definition at line 2400 of file qgsvectorlayer.cpp.
References QgsVectorLayerEditBuffer::changeGeometry(), mDataProvider, and mEditBuffer.
Referenced by QgsOfflineEditing::applyGeometryChanges(), and updateFeature().
| QPair< QString, QString > QgsVectorLayer::checkedState | ( | int | idx | ) |
return string representing 'true' for a checkbox (added in 1.4)
Definition at line 3124 of file qgsvectorlayer.cpp.
References QgsFields::count(), mCheckedStates, QgsMapLayer::name(), and pendingFields().
Referenced by QgsAttributeEditor::retrieveValue(), and QgsAttributeEditor::setValue().
| void QgsVectorLayer::checkJoinLayerRemove | ( | QString | theLayerId | ) | [slot] |
Check if there is a join with a layer that will be removed.
Definition at line 3153 of file qgsvectorlayer.cpp.
References removeJoin().
Referenced by QgsVectorLayer(), and readXml().
Clears all the tabs for the attribute editor form.
Definition at line 3761 of file qgsvectorlayer.cpp.
References mAttributeEditorElements.
| bool QgsVectorLayer::commitChanges | ( | ) |
Attempts to commit any changes to disk.
Returns the result of the attempt. If a commit fails, the in-memory changes are left alone.
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.
The commits occur in distinct stages, (add attributes, add features, change attribute values, change geometries, delete features, delete attributes) so if a stage fails, it's difficult to roll back cleanly. Therefore any error message also includes which stage failed so that the user has some chance of repairing the damage cleanly.
Definition at line 2542 of file qgsvectorlayer.cpp.
References beforeCommitChanges(), QgsVectorLayerEditBuffer::commitChanges(), editingStopped(), QgsMessageLog::logMessage(), mCommitErrors, mDataProvider, mEditBuffer, QgsMapLayer::setCacheImage(), tr, QgsMapLayer::undoStack(), QgsDataProvider::updateExtents(), and updateFields().
Referenced by QgsOfflineEditing::copyVectorLayer(), and QgsOfflineEditing::synchronize().
| const QStringList & QgsVectorLayer::commitErrors | ( | ) |
Definition at line 2583 of file qgsvectorlayer.cpp.
References mCommitErrors.
Referenced by QgsOfflineEditing::copyVectorLayer(), and QgsOfflineEditing::synchronize().
| void QgsVectorLayer::committedAttributesAdded | ( | const QString & | layerId, |
| const QList< QgsField > & | addedAttributes | ||
| ) | [signal] |
| void QgsVectorLayer::committedAttributesDeleted | ( | const QString & | layerId, |
| const QgsAttributeList & | deletedAttributes | ||
| ) | [signal] |
Signals emitted after committing changes.
| void QgsVectorLayer::committedAttributeValuesChanges | ( | const QString & | layerId, |
| const QgsChangedAttributesMap & | changedAttributesValues | ||
| ) | [signal] |
| void QgsVectorLayer::committedFeaturesAdded | ( | const QString & | layerId, |
| const QgsFeatureList & | addedFeatures | ||
| ) | [signal] |
Referenced by startEditing().
| void QgsVectorLayer::committedFeaturesRemoved | ( | const QString & | layerId, |
| const QgsFeatureIds & | deletedFeatureIds | ||
| ) | [signal] |
Referenced by startEditing().
| void QgsVectorLayer::committedGeometriesChanges | ( | const QString & | layerId, |
| const QgsGeometryMap & | changedGeometries | ||
| ) | [signal] |
| bool QgsVectorLayer::countSymbolFeatures | ( | bool | showProgress = true | ) |
Count features for symbols.
Feature counts may be get by featureCount( QgsSymbolV2*).
| showProgress | show progress dialog |
Definition at line 1021 of file qgsvectorlayer.cpp.
References getFeatures(), QgsFeatureRendererV2::legendSymbolItems(), mDataProvider, mRendererV2, mSymbolFeatureCounted, mSymbolFeatureCountMap, QgsMapLayer::name(), QgsFeatureIterator::nextFeature(), QgsFeatureRequest::NoGeometry, pendingFeatureCount(), QgsDebugMsg, QgsRenderContext::setRendererScale(), QgsFeatureRendererV2::startRender(), QgsFeatureRendererV2::stopRender(), QgsFeatureRendererV2::symbolsForFeature(), and tr.
Referenced by QgsLegendModel::addVectorLayerItemsV2(), and QgsLegendModel::updateSymbolV2ItemText().
| void QgsVectorLayer::createJoinCaches | ( | ) |
Caches joined attributes if required (and not already done)
Definition at line 3188 of file qgsvectorlayer.cpp.
References QgsVectorLayerJoinBuffer::containsJoins(), QgsVectorLayerJoinBuffer::createJoinCaches(), and mJoinBuffer.
| int QgsVectorLayer::currentVertexMarkerSize | ( | ) | [static, private] |
Reads vertex marker size from settings.
Definition at line 2846 of file qgsvectorlayer.cpp.
Referenced by draw(), and drawRendererV2Levels().
| QgsVectorLayer::VertexMarkerType QgsVectorLayer::currentVertexMarkerType | ( | ) | [static, private] |
Reads vertex marker type from settings.
Definition at line 2828 of file qgsvectorlayer.cpp.
References Cross, NoMarker, and SemiTransparentCircle.
Referenced by draw(), and drawRendererV2Levels().
| QString QgsVectorLayer::dataComment | ( | ) | const |
Returns a comment for the data in the layer.
Definition at line 231 of file qgsvectorlayer.cpp.
References QgsVectorDataProvider::dataComment(), and mDataProvider.
Referenced by metadata().
Returns the data provider.
Definition at line 857 of file qgsvectorlayer.cpp.
References mDataProvider.
Referenced by QgsQueryBuilder::accept(), QgsVectorLayerEditBuffer::addAttribute(), QgsVectorLayerEditBuffer::addFeature(), QgsVectorLayerEditBuffer::addFeatures(), QgsOfflineEditing::applyAttributesAdded(), attributeEditorElementFromDomElement(), QgsGeometryAnalyzer::buffer(), QgsZonalStatistics::calculateStatistics(), QgsGeometryAnalyzer::centroids(), QgsVectorLayerEditBuffer::changeAttributeValue(), QgsVectorLayerEditBuffer::changeGeometry(), QgsVectorLayerEditBuffer::commitChanges(), QgsGeometryAnalyzer::convexHull(), QgsOfflineEditing::copyVectorLayer(), QgsAttributeEditor::createAttributeEditor(), QgsVectorLayerEditBuffer::deleteAttribute(), QgsVectorLayerEditBuffer::deleteFeature(), QgsGeometryAnalyzer::dissolve(), QgsGeometryAnalyzer::eventLayer(), QgsGeometryAnalyzer::extent(), QgsVectorLayerCache::getFeatures(), QgsOverlayAnalyzer::intersection(), QgsVectorLayerFeatureIterator::nextFeatureFid(), QgsAttributeDialog::QgsAttributeDialog(), QgsVectorLayerFeatureIterator::QgsVectorLayerFeatureIterator(), QgsPalLayerSettings::readDataDefinedProperty(), QgsFeatureListModel::setDisplayExpression(), QgsGeometryAnalyzer::simplify(), QgsVectorLayerEditUtils::splitFeatures(), QgsQueryBuilder::test(), QgsProjectFileTransform::transform0110to1000(), uniqueValues(), and QgsVectorLayerFeatureIterator::useChangedAttributeFeature().
| const QgsVectorDataProvider * QgsVectorLayer::dataProvider | ( | ) | const |
Returns the data provider in a const-correct manner.
Definition at line 862 of file qgsvectorlayer.cpp.
References mDataProvider.
| QString & QgsVectorLayer::dateFormat | ( | int | idx | ) |
access date format
Definition at line 3004 of file qgsvectorlayer.cpp.
References mDateFormats, and pendingFields().
Referenced by QgsAttributeEditor::createAttributeEditor(), QgsAttributeEditor::retrieveValue(), and QgsAttributeEditor::setValue().
| bool QgsVectorLayer::deleteAttribute | ( | int | attr | ) |
delete an attribute field (but does not commit it)
Definition at line 2468 of file qgsvectorlayer.cpp.
References QgsVectorLayerEditBuffer::deleteAttribute(), mDataProvider, and mEditBuffer.
Referenced by deleteAttributes().
| bool QgsVectorLayer::deleteAttributes | ( | QList< int > | attrs | ) |
Deletes a list of attribute fields (but does not commit it)
| attrs | the indices of the attributes to delete |
Definition at line 2476 of file qgsvectorlayer.cpp.
References deleteAttribute().
| bool QgsVectorLayer::deleteFeature | ( | QgsFeatureId | fid | ) |
delete a feature from the layer (but does not commit it)
Definition at line 2496 of file qgsvectorlayer.cpp.
References QgsVectorLayerEditBuffer::deleteFeature(), mEditBuffer, and mSelectedFeatureIds.
Referenced by QgsOfflineEditing::applyFeaturesRemoved(), and deleteSelectedFeatures().
Deletes the selected features.
Definition at line 1289 of file qgsvectorlayer.cpp.
References QgsVectorDataProvider::capabilities(), deleteFeature(), QgsVectorDataProvider::DeleteFeatures, isEditable(), mDataProvider, mSelectedFeatureIds, QgsMapLayer::setCacheImage(), triggerRepaint(), and updateExtents().
| bool QgsVectorLayer::deleteVertex | ( | QgsFeatureId | atFeatureId, |
| int | atVertex | ||
| ) |
Deletes a vertex from a feature.
Definition at line 1279 of file qgsvectorlayer.cpp.
References QgsVectorLayerEditUtils::deleteVertex(), mDataProvider, and mEditBuffer.
| void QgsVectorLayer::deselect | ( | const QgsFeatureId | featureId | ) | [slot] |
Deselect feature by its ID.
| featureId | The id of the feature to deselect |
Definition at line 734 of file qgsvectorlayer.cpp.
References mSelectedFeatureIds, selectionChanged(), and QgsMapLayer::setCacheImage().
Referenced by QgsFeatureSelectionModel::enableSync(), and QgsFeatureSelectionModel::selectFeatures().
| void QgsVectorLayer::deselect | ( | const QgsFeatureIds & | featureIds | ) | [slot] |
Deselect features by their ID.
| featureIds | The ids of the features to deselect |
Definition at line 742 of file qgsvectorlayer.cpp.
References mSelectedFeatureIds, selectionChanged(), and QgsMapLayer::setCacheImage().
| void QgsVectorLayer::destroyEditCommand | ( | ) |
Destroy active command and reverts all changes in it.
Definition at line 3110 of file qgsvectorlayer.cpp.
References QgsMapLayer::undoStack().
| const QgsDiagramLayerSettings* QgsVectorLayer::diagramLayerSettings | ( | ) | const [inline] |
Definition at line 665 of file qgsvectorlayer.h.
| const QgsDiagramRendererV2* QgsVectorLayer::diagramRenderer | ( | ) | const [inline] |
Definition at line 662 of file qgsvectorlayer.h.
| const QString QgsVectorLayer::displayExpression | ( | ) |
Get the preview expression, used to create a human readable preview string.
Uses QgsExpression
Definition at line 2885 of file qgsvectorlayer.cpp.
References mDisplayExpression.
Referenced by QgsDualView::columnBoxInit(), QgsDualView::previewExpressionBuilder(), and setDisplayExpression().
| const QString QgsVectorLayer::displayField | ( | ) | const |
Returns the primary display field name used in the identify results dialog.
Definition at line 2875 of file qgsvectorlayer.cpp.
References mDisplayField.
Referenced by QgsDualView::columnBoxInit(), QgsMapTip::fetchFeature(), and writeSymbology().
| bool QgsVectorLayer::draw | ( | QgsRenderContext & | rendererContext | ) | [virtual] |
Draws the layer.
Reimplemented from QgsMapLayer.
Definition at line 647 of file qgsvectorlayer.cpp.
References QgsFeatureRendererV2::capabilities(), currentVertexMarkerSize(), currentVertexMarkerType(), QgsGeometryCache::deleteCachedGeometries(), drawRendererV2(), drawRendererV2Levels(), QgsFeatureRendererV2::dump(), QgsRenderContext::extent(), fieldNameIndex(), getFeatures(), hasGeometryType(), mCache, mEditBuffer, mEnableBackbuffer, mRendererV2, mUpdateThreshold, prepareLabelingAndDiagrams(), QgsDebugMsg, QgsGeometryCache::setCachedGeometriesRect(), QgsFeatureRendererV2::setVertexMarkerAppearance(), QgsFeatureRendererV2::startRender(), QgsFeatureRendererV2::SymbolLevels, QgsFeatureRendererV2::usedAttributes(), and QgsFeatureRendererV2::usingSymbolLevels().
| void QgsVectorLayer::drawLabels | ( | QgsRenderContext & | rendererContext | ) | [virtual] |
Draws the layer labels using coordinate transformation.
Reimplemented from QgsMapLayer.
Definition at line 329 of file qgsvectorlayer.cpp.
References QgsLabel::addRequiredFields(), QgsRenderContext::extent(), featureCount(), fieldNameIndex(), getFeatures(), hasGeometryType(), QgsLabel::maxScale(), QgsLabel::minScale(), mLabel, mLabelOn, mRendererV2, mSelectedFeatureIds, QgsFeatureIterator::nextFeature(), QgsDebugMsg, QgsRenderContext::rendererScale(), QgsLabel::renderLabel(), QgsLabel::scaleBasedVisibility(), QgsFeatureRendererV2::startRender(), QgsFeatureRendererV2::stopRender(), QgsFeatureRendererV2::usedAttributes(), and QgsFeatureRendererV2::willRenderFeature().
| void QgsVectorLayer::drawRendererV2 | ( | QgsFeatureIterator & | fit, |
| QgsRenderContext & | rendererContext, | ||
| bool | labeling | ||
| ) |
Draw layer with renderer V2.
QgsFeatureRenderer::startRender() needs to be called before using this method
Definition at line 398 of file qgsvectorlayer.cpp.
References QgsGeometryCache::cacheGeometry(), featureCount(), QgsFeature::geometry(), hasGeometryType(), QgsFeature::id(), QgsRenderContext::labelingEngine(), mCache, mCurrentRendererContext, mDiagramRenderer, mEditBuffer, mEnableBackbuffer, mRendererV2, mSelectedFeatureIds, mUpdateThreshold, QgsFeatureIterator::nextFeature(), QgsDebugMsg, QgsLabelingEngineInterface::registerDiagramFeature(), QgsLabelingEngineInterface::registerFeature(), QgsFeatureRendererV2::renderFeature(), QgsRenderContext::renderingStopped(), QgsMapLayer::screenUpdateRequested(), stopRendererV2(), and QgsException::what().
Referenced by draw().
| void QgsVectorLayer::drawRendererV2Levels | ( | QgsFeatureIterator & | fit, |
| QgsRenderContext & | rendererContext, | ||
| bool | labeling | ||
| ) |
Draw layer with renderer V2 using symbol levels.
QgsFeatureRenderer::startRender() needs to be called before using this method
Definition at line 491 of file qgsvectorlayer.cpp.
References QgsGeometryCache::cacheGeometry(), currentVertexMarkerSize(), currentVertexMarkerType(), QgsSymbolV2::defaultSymbol(), featureCount(), QgsFeature::geometry(), geometryType(), hasGeometryType(), QgsFeature::id(), QgsRenderContext::labelingEngine(), QgsSymbolV2LevelItem::layer(), mCache, mDiagramRenderer, mEditBuffer, mRendererV2, mSelectedFeatureIds, QgsFeatureIterator::nextFeature(), QgsDebugMsg, QgsLabelingEngineInterface::registerDiagramFeature(), QgsLabelingEngineInterface::registerFeature(), QgsFeatureRendererV2::renderFeature(), QgsSymbolLayerV2::renderingPass(), QgsRenderContext::renderingStopped(), QgsRenderContext::selectionColor(), QgsSymbolV2::setColor(), QgsFeatureRendererV2::setVertexMarkerAppearance(), QgsSingleSymbolRendererV2::startRender(), stopRendererV2(), QgsSingleSymbolRendererV2::symbol(), QgsSymbolV2LevelItem::symbol(), QgsFeatureRendererV2::symbolForFeature(), QgsSymbolV2::symbolLayer(), QgsSymbolV2::symbolLayerCount(), QgsFeatureRendererV2::symbols(), and QgsException::what().
Referenced by draw().
| void QgsVectorLayer::drawVertexMarker | ( | double | x, |
| double | y, | ||
| QPainter & | p, | ||
| QgsVectorLayer::VertexMarkerType | type, | ||
| int | vertexSize | ||
| ) | [static] |
Draws a vertex symbol at (screen) coordinates x, y.
(Useful to assist vertex editing.)
Definition at line 702 of file qgsvectorlayer.cpp.
References Cross, and SemiTransparentCircle.
Referenced by QgsFeatureRendererV2::renderVertexMarker().
| QgsVectorLayerEditBuffer* QgsVectorLayer::editBuffer | ( | ) | [inline] |
Buffer with uncommitted editing operations. Only valid after editing has been turned on.
Definition at line 1174 of file qgsvectorlayer.h.
Referenced by QgsVectorLayerEditUtils::addPart(), QgsVectorLayerEditUtils::addRing(), QgsFeatureListModel::data(), QgsVectorLayerEditUtils::deleteVertex(), QgsGeometryCache::editBuffer(), QgsVectorLayerFeatureIterator::fetchNextAddedFeature(), QgsVectorLayerFeatureIterator::fetchNextChangedGeomFeature(), QgsAttributeTableFilterModel::filterAcceptsRow(), QgsVectorLayerEditUtils::insertVertex(), QgsVectorLayerEditUtils::moveVertex(), QgsVectorLayerFeatureIterator::nextFeature(), QgsVectorLayerFeatureIterator::nextFeatureFid(), QgsVectorLayerFeatureIterator::rewindEditBuffer(), QgsVectorLayerEditUtils::splitFeatures(), QgsVectorLayerEditUtils::translateFeature(), and QgsVectorLayerFeatureIterator::useChangedAttributeFeature().
| QString QgsVectorLayer::editForm | ( | ) |
get edit form (added in 1.4)
Definition at line 2941 of file qgsvectorlayer.cpp.
References mEditForm.
Referenced by QgsAttributeDialog::QgsAttributeDialog().
| QString QgsVectorLayer::editFormInit | ( | ) |
get python function for edit form initialization (added in 1.4)
Definition at line 2956 of file qgsvectorlayer.cpp.
References mEditFormInit.
Referenced by QgsAttributeDialog::QgsAttributeDialog().
| void QgsVectorLayer::editingStarted | ( | ) | [signal] |
Is emitted, when editing on this layer has started.
Referenced by startEditing().
| void QgsVectorLayer::editingStopped | ( | ) | [signal] |
Is emitted, when edited changes successfully have been written to the data provider.
Referenced by commitChanges(), and rollBack().
get the active layout for the attribute editor for this layer (added in 1.9)
Definition at line 2931 of file qgsvectorlayer.cpp.
References mEditorLayout.
Referenced by QgsAttributeDialog::QgsAttributeDialog(), and setEditorLayout().
| QgsVectorLayer::EditType QgsVectorLayer::editType | ( | int | idx | ) |
get edit type
Definition at line 2915 of file qgsvectorlayer.cpp.
References QgsFields::count(), LineEdit, mEditTypes, QgsMapLayer::name(), and pendingFields().
Referenced by QgsDualView::columnBoxInit(), QgsAttributeEditor::createAttributeEditor(), QgsAttributeTableDelegate::createEditor(), QgsAttributeEditor::createWidgetFromDef(), QgsAttributeTableModel::data(), QgsAttributeTableModel::loadAttributes(), QgsAttributeDialog::QgsAttributeDialog(), readSymbology(), QgsAttributeEditor::retrieveValue(), and QgsAttributeEditor::setValue().
| void QgsVectorLayer::enableLabels | ( | bool | on | ) |
Set labels on.
Definition at line 1440 of file qgsvectorlayer.cpp.
References mLabelOn.
Referenced by readSymbology().
| void QgsVectorLayer::endEditCommand | ( | ) |
Finish edit command and add it to undo/redo stack.
Definition at line 3105 of file qgsvectorlayer.cpp.
References QgsMapLayer::undoStack().
Referenced by QgsDualView::saveEditChanges(), and QgsAttributeTableDelegate::setModelData().
| const QSet<QString>& QgsVectorLayer::excludeAttributesWFS | ( | ) | const [inline] |
Definition at line 1040 of file qgsvectorlayer.h.
| const QSet<QString>& QgsVectorLayer::excludeAttributesWMS | ( | ) | const [inline] |
Definition at line 1037 of file qgsvectorlayer.h.
| QgsRectangle QgsVectorLayer::extent | ( | ) | [virtual] |
Return the extent of the layer as a QRect.
Reimplemented from QgsMapLayer.
Definition at line 1102 of file qgsvectorlayer.cpp.
References QgsGeometry::boundingBox(), QgsRectangle::combineExtentWith(), QgsDataProvider::extent(), QgsVectorDataProvider::featureCount(), QgsFeature::geometry(), getFeatures(), hasGeometryType(), QgsVectorLayerEditBuffer::mAddedFeatures, QgsVectorLayerEditBuffer::mChangedGeometries, mDataProvider, QgsVectorLayerEditBuffer::mDeletedFeatureIds, mEditBuffer, mValidExtent, QgsFeatureIterator::nextFeature(), QgsDebugMsg, QgsMapLayer::recalculateExtents(), setExtent(), QgsRectangle::setMinimal(), QgsDataProvider::updateExtents(), QgsRectangle::xMaximum(), QgsRectangle::xMinimum(), QgsRectangle::yMaximum(), and QgsRectangle::yMinimum().
Referenced by QgsGeometryAnalyzer::extent(), and metadata().
| void QgsVectorLayer::featureAdded | ( | QgsFeatureId | fid | ) | [signal] |
Referenced by startEditing().
| QPainter::CompositionMode QgsVectorLayer::featureBlendMode | ( | ) | const |
Read blend mode for layer.
Definition at line 3383 of file qgsvectorlayer.cpp.
References mFeatureBlendMode.
Referenced by QgsComposerMap::containsAdvancedEffects(), QgsRendererV2PropertiesDialog::QgsRendererV2PropertiesDialog(), QgsMapRenderer::render(), setFeatureBlendMode(), and writeSymbology().
| long QgsVectorLayer::featureCount | ( | ) | const [virtual] |
Number of features in the layer.
This is necessary if features are added/deleted or the layer has been subsetted. If the data provider chooses not to support this feature, the total number of features can be returned.
Definition at line 1004 of file qgsvectorlayer.cpp.
References QgsVectorDataProvider::featureCount(), mDataProvider, and QgsDebugMsg.
Referenced by QgsGeometryAnalyzer::buffer(), QgsGeometryAnalyzer::centroids(), QgsGeometryAnalyzer::convexHull(), QgsOfflineEditing::copyVectorLayer(), QgsGeometryAnalyzer::dissolve(), drawLabels(), drawRendererV2(), drawRendererV2Levels(), QgsVectorLayerCache::featureAdded(), QgsVectorLayerImport::importLayer(), QgsOverlayAnalyzer::intersection(), QgsLineVectorLayerDirector::makeGraph(), metadata(), QgsVectorLayerCache::setFullCache(), QgsGeometryAnalyzer::simplify(), QgsQueryBuilder::test(), QgsOfflineEditing::updateFidLookup(), QgsLegendModel::updateLayerItemText(), and QgsLegendModel::updateSymbolV2ItemText().
| long QgsVectorLayer::featureCount | ( | QgsSymbolV2 * | symbol | ) |
Number of features rendered with specified symbol.
Features must be first calculated by countSymbolFeatures()
| symbol | the symbol |
Definition at line 1015 of file qgsvectorlayer.cpp.
References mSymbolFeatureCounted, and mSymbolFeatureCountMap.
| void QgsVectorLayer::featureDeleted | ( | QgsFeatureId | fid | ) | [signal] |
Referenced by startEditing().
| bool QgsVectorLayer::fieldEditable | ( | int | idx | ) |
is edit widget editable
Definition at line 3028 of file qgsvectorlayer.cpp.
References QgsFields::count(), mFieldEditables, and pendingFields().
Referenced by QgsAttributeDialog::QgsAttributeDialog().
| int QgsVectorLayer::fieldNameIndex | ( | const QString & | fieldName | ) | const |
Returns the index of a field name or -1 if the field does not exist.
Definition at line 3133 of file qgsvectorlayer.cpp.
References QgsFields::count(), QgsMapLayer::name(), and pendingFields().
Referenced by QgsCategorizedSymbolRendererV2Widget::addCategories(), QgsVectorFileWriter::addRendererAttributes(), QgsDualView::columnBoxInit(), QgsAttributeEditor::createAttributeEditor(), QgsPointDisplacementRenderer::createDisplacementGroups(), QgsGraduatedSymbolRendererV2::createRenderer(), draw(), drawLabels(), QgsMapTip::fetchFeature(), QgsExpressionBuilderWidget::loadAllValues(), QgsAttributeTableModel::loadAttributes(), QgsExpressionBuilderWidget::loadSampleValues(), QgsPalLabeling::prepareLayer(), readSymbology(), QgsSingleSymbolRendererV2::startRender(), QgsPointDisplacementRenderer::startRender(), QgsVectorFieldSymbolLayer::startRender(), QgsGraduatedSymbolRendererV2::startRender(), QgsCategorizedSymbolRendererV2::startRender(), and writeSymbology().
| QgsFeatureId QgsVectorLayer::findFreeId | ( | ) | [private] |
Goes through all features and finds a free id (e.g.
to give it temporarily to a not-commited feature)
| QgsVectorOverlay * QgsVectorLayer::findOverlayByType | ( | const QString & | typeName | ) |
Returns the (first) overlay of a type, e.g.
diagram or label
Definition at line 3065 of file qgsvectorlayer.cpp.
References mOverlays.
| void QgsVectorLayer::geometryChanged | ( | QgsFeatureId | fid, |
| QgsGeometry & | geom | ||
| ) | [signal] |
Referenced by startEditing().
Returns point, line or polygon.
Definition at line 882 of file qgsvectorlayer.cpp.
References QgsVectorDataProvider::geometryType(), QGis::Line, mDataProvider, QGis::NoGeometry, QGis::Point, QGis::Polygon, QgsDebugMsg, QgsMapLayer::type(), QGis::UnknownGeometry, QGis::WKBLineString, QGis::WKBLineString25D, QGis::WKBMultiLineString, QGis::WKBMultiLineString25D, QGis::WKBMultiPoint, QGis::WKBMultiPoint25D, QGis::WKBMultiPolygon, QGis::WKBMultiPolygon25D, QGis::WKBNoGeometry, QGis::WKBPoint, QGis::WKBPoint25D, QGis::WKBPolygon, and QGis::WKBPolygon25D.
Referenced by QgsCategorizedSymbolRendererV2Widget::addCategory(), QgsPALObjectPositionManager::addLayer(), QgsRuleBasedRendererV2Widget::addRule(), QgsZonalStatistics::calculateStatistics(), QgsCategorizedSymbolRendererV2Widget::changeCategorySymbol(), drawRendererV2Levels(), hasGeometryType(), metadata(), QgsExpressionBuilderWidget::on_txtExpressionString_textChanged(), QgsAttributeTableModel::QgsAttributeTableModel(), QgsCategorizedSymbolRendererV2Widget::QgsCategorizedSymbolRendererV2Widget(), QgsGraduatedSymbolRendererV2Widget::QgsGraduatedSymbolRendererV2Widget(), QgsRendererRulePropsDialog::QgsRendererRulePropsDialog(), QgsRendererV2Widget::QgsRendererV2Widget(), QgsRuleBasedRendererV2Widget::QgsRuleBasedRendererV2Widget(), QgsSingleSymbolRendererV2Widget::QgsSingleSymbolRendererV2Widget(), QgsVectorLayer(), readSld(), readSymbology(), selectedFeatures(), snapToGeometry(), and writeXml().
| QgsFeatureIterator QgsVectorLayer::getFeatures | ( | const QgsFeatureRequest & | request = QgsFeatureRequest() | ) |
Query the provider for features specified in request.
Definition at line 1197 of file qgsvectorlayer.cpp.
References mDataProvider, and QgsVectorLayerFeatureIterator.
Referenced by QgsVectorLayerEditUtils::addPart(), QgsVectorLayerEditUtils::addRing(), QgsOfflineEditing::applyFeaturesAdded(), QgsAtlasComposition::beginRender(), boundingBoxOfSelected(), QgsGeometryAnalyzer::buffer(), QgsInterpolator::cacheBaseData(), QgsVectorLayerJoinBuffer::cacheJoinLayer(), QgsGeometryAnalyzer::centroids(), QgsGeometryAnalyzer::convexHull(), QgsOfflineEditing::copyVectorLayer(), QgsRuleBasedRendererV2Widget::countFeatures(), QgsSearchQueryBuilder::countRecords(), countSymbolFeatures(), QgsAttributeEditor::createAttributeEditor(), QgsFormAnnotationItem::createDesignerWidget(), QgsPointDisplacementRenderer::createDisplacementGroups(), QgsGraduatedSymbolRendererV2::createRenderer(), QgsGeometryAnalyzer::dissolve(), draw(), drawLabels(), QgsGeometryAnalyzer::eventLayer(), extent(), QgsVectorLayerCache::featureAtId(), QgsMapTip::fetchFeature(), QgsComposerAttributeTable::getFeatureAttributes(), QgsVectorLayerCache::getFeatures(), QgsSearchQueryBuilder::getFieldValues(), QgsMapToolIdentify::identifyVectorLayer(), QgsVectorLayerImport::importLayer(), QgsOverlayAnalyzer::intersectFeature(), QgsOverlayAnalyzer::intersection(), invertSelection(), invertSelectionInRectangle(), QgsAttributeTableModel::loadAttributes(), QgsLineVectorLayerDirector::makeGraph(), maximumValue(), minimumValue(), QgsExpressionSelectionDialog::on_mActionAddToSelection_triggered(), QgsExpressionSelectionDialog::on_mActionRemoveFromSelection_triggered(), QgsExpressionSelectionDialog::on_mActionSelect_triggered(), QgsExpressionSelectionDialog::on_mActionSelectInstersect_triggered(), QgsExpressionBuilderWidget::on_txtExpressionString_textChanged(), QgsAtlasComposition::prepareForFeature(), prepareLabelingAndDiagrams(), QgsAttributeDialog::QgsAttributeDialog(), QgsCachedFeatureWriterIterator::QgsCachedFeatureWriterIterator(), removePolygonIntersections(), select(), selectedFeatures(), QgsHtmlAnnotationItem::setFeatureForMapPosition(), QgsFormAnnotationItem::setFeatureForMapPosition(), QgsGeometryAnalyzer::simplify(), snapWithContext(), QgsVectorLayerEditUtils::splitFeatures(), QgsRendererRulePropsDialog::testFilter(), QgsVectorLayerEditUtils::translateFeature(), QgsVectorLayerUndoCommandChangeAttribute::undo(), uniqueValues(), updateFeature(), QgsOfflineEditing::updateFidLookup(), and QgsVectorFileWriter::writeAsVectorFormat().
| QString QgsVectorLayer::getStyleFromDatabase | ( | QString | styleId, |
| QString & | msgError | ||
| ) | [virtual] |
Will return the named style corresponding to style id provided.
Definition at line 3812 of file qgsvectorlayer.cpp.
References cast_to_fptr, QgsProviderRegistry::instance(), QgsMapLayer::mDataSource, mProviderKey, QgsProviderRegistry::providerLibrary(), and tr.
| bool QgsVectorLayer::hasGeometryType | ( | ) | const |
Returns true if this is a geometry layer and false in case of NoGeometry (table only) or UnknownGeometry.
Definition at line 933 of file qgsvectorlayer.cpp.
References geometryType(), QGis::NoGeometry, and QGis::UnknownGeometry.
Referenced by QgsVectorLayerEditUtils::addPart(), QgsVectorLayerEditUtils::addRing(), QgsVectorLayerEditUtils::addTopologicalPoints(), QgsVectorLayerEditBuffer::changeGeometry(), QgsVectorLayerEditUtils::deleteVertex(), draw(), drawLabels(), drawRendererV2(), drawRendererV2Levels(), extent(), QgsVectorLayerCache::getFeatures(), QgsVectorLayerEditUtils::insertSegmentVerticesForSnap(), QgsVectorLayerEditUtils::insertVertex(), QgsVectorLayerEditUtils::moveVertex(), QgsVectorLayer(), readSld(), readSymbology(), removePolygonIntersections(), QgsVectorLayerCache::setCacheGeometry(), setCoordinateSystem(), setDisplayField(), setRendererV2(), snapPoint(), snapWithContext(), QgsVectorLayerEditUtils::splitFeatures(), QgsVectorLayerEditUtils::translateFeature(), writeSld(), and writeSymbology().
| bool QgsVectorLayer::hasLabelsEnabled | ( | void | ) | const |
Label is on.
Definition at line 1445 of file qgsvectorlayer.cpp.
References mLabelOn.
Referenced by QgsOfflineEditing::copyVectorLayer(), readSymbology(), and writeSymbology().
| int QgsVectorLayer::insertSegmentVerticesForSnap | ( | const QList< QgsSnappingResult > & | snapResults | ) |
Inserts vertices to the snapped segments.
This is useful for topological editing if snap to segment is enabled.
| snapResults | results collected from the snapping operation |
Definition at line 2821 of file qgsvectorlayer.cpp.
References QgsVectorLayerEditUtils::insertSegmentVerticesForSnap().
| bool QgsVectorLayer::insertVertex | ( | double | x, |
| double | y, | ||
| QgsFeatureId | atFeatureId, | ||
| int | beforeVertex | ||
| ) |
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.
Definition at line 1259 of file qgsvectorlayer.cpp.
References QgsVectorLayerEditUtils::insertVertex(), mDataProvider, and mEditBuffer.
| void QgsVectorLayer::invertSelection | ( | ) |
Select not selected features and deselect selected ones.
Definition at line 793 of file qgsvectorlayer.cpp.
References getFeatures(), QgsFeature::id(), mSelectedFeatureIds, QgsFeatureIterator::nextFeature(), QgsFeatureRequest::NoGeometry, and setSelectedFeatures().
| void QgsVectorLayer::invertSelectionInRectangle | ( | QgsRectangle & | rect | ) |
Invert selection of features found within the search rectangle (in layer's coordinates)
| rect | The rectangle in which the selection of features will be inverted |
Definition at line 815 of file qgsvectorlayer.cpp.
References QgsFeatureRequest::ExactIntersect, getFeatures(), QgsFeature::id(), modifySelection(), mSelectedFeatureIds, QgsFeatureIterator::nextFeature(), QgsFeatureRequest::NoGeometry, and QgsRectangle::normalize().
| bool QgsVectorLayer::isEditable | ( | ) | const [virtual] |
Returns true if the provider is in editing mode.
Reimplemented from QgsMapLayer.
Definition at line 2890 of file qgsvectorlayer.cpp.
References mDataProvider, and mEditBuffer.
Referenced by QgsAttributeDialog::accept(), QgsAttributeEditor::createWidgetFromDef(), deleteSelectedFeatures(), QgsMapCanvas::mouseReleaseEvent(), QgsAttributeDialog::QgsAttributeDialog(), QgsMapRenderer::render(), QgsDualView::saveEditChanges(), and QgsAttributeTableModel::setData().
| bool QgsVectorLayer::isModified | ( | ) | const [virtual] |
Returns true if the provider has been modified since the last commit.
Definition at line 2910 of file qgsvectorlayer.cpp.
References QgsVectorLayerEditBuffer::isModified(), and mEditBuffer.
Referenced by rollBack(), and QgsAttributeTableModel::setData().
| bool QgsVectorLayer::isReadOnly | ( | ) | const [virtual] |
Returns true if the provider is in read-only mode.
Definition at line 2895 of file qgsvectorlayer.cpp.
References mReadOnly.
Get the label object associated with this layer.
Definition at line 1430 of file qgsvectorlayer.cpp.
References mLabel.
| const QgsLabel * QgsVectorLayer::label | ( | ) | const |
Definition at line 1435 of file qgsvectorlayer.cpp.
References mLabel.
| void QgsVectorLayer::layerDeleted | ( | ) | [signal] |
Referenced by ~QgsVectorLayer().
| void QgsVectorLayer::layerModified | ( | ) | [signal] |
This signal is emitted when modifications has been done on layer.
Referenced by addAttributeAlias(), and startEditing().
| int QgsVectorLayer::layerTransparency | ( | ) | const |
Read transparency for layer.
Definition at line 3395 of file qgsvectorlayer.cpp.
References mLayerTransparency.
Referenced by QgsComposerMap::containsAdvancedEffects(), QgsRendererV2PropertiesDialog::QgsRendererV2PropertiesDialog(), QgsMapRenderer::render(), setLayerTransparency(), and writeSymbology().
| int QgsVectorLayer::listStylesInDatabase | ( | QStringList & | ids, |
| QStringList & | names, | ||
| QStringList & | descriptions, | ||
| QString & | msgError | ||
| ) | [virtual] |
Lists all the style in db split into related to the layer and not related to.
| ids | the list in which will be stored the style db ids |
| names | the list in which will be stored the style names |
| descriptions | the list in which will be stored the style descriptions |
| msgError |
Definition at line 3791 of file qgsvectorlayer.cpp.
References cast_to_fptr, QgsProviderRegistry::instance(), QgsMapLayer::mDataSource, mProviderKey, QgsProviderRegistry::providerLibrary(), and tr.
| QString QgsVectorLayer::loadNamedStyle | ( | const QString | theURI, |
| bool & | theResultFlag, | ||
| bool | loadFromLocalDb | ||
| ) | [virtual] |
Load a named style from file/local db/datasource db.
| theURI | the URI of the style or the URI of the layer |
| theResultFlag | will be set to true if a named style is correctly loaded |
| loadFromLocalDb | if true forces to load from local db instead of datasource one |
Definition at line 3881 of file qgsvectorlayer.cpp.
References applyNamedStyle(), cast_to_fptr, QgsDataSourceURI::database(), QgsProviderRegistry::instance(), QgsMapLayer::mDataSource, mProviderKey, QgsProviderRegistry::providerLibrary(), and tr.
Referenced by loadNamedStyle().
| QString QgsVectorLayer::loadNamedStyle | ( | const QString | theURI, |
| bool & | theResultFlag | ||
| ) | [virtual] |
Calls loadNamedStyle( theURI, theResultFlag, false ); Retained for backward compatibility.
Reimplemented from QgsMapLayer.
Definition at line 3876 of file qgsvectorlayer.cpp.
References loadNamedStyle().
| QVariant QgsVectorLayer::maximumValue | ( | int | index | ) |
Returns maximum value for an attribute column or invalid variant in case of error.
Definition at line 3315 of file qgsvectorlayer.cpp.
References QgsFeature::attribute(), QgsFields::fieldOrigin(), getFeatures(), QgsMapLayerRegistry::instance(), QgsVectorLayerJoinBuffer::joinForFieldIndex(), QgsVectorJoinInfo::joinLayerId, QgsVectorLayerEditBuffer::mAddedFeatures, QgsMapLayerRegistry::mapLayer(), MathUtils::max(), QgsVectorDataProvider::maximumValue(), maximumValue(), QgsVectorLayerEditBuffer::mChangedAttributeValues, mDataProvider, QgsVectorLayerEditBuffer::mDeletedAttributeIds, QgsVectorLayerEditBuffer::mDeletedFeatureIds, mEditBuffer, mJoinBuffer, mUpdatedFields, QgsFeatureIterator::nextFeature(), QgsFeatureRequest::NoGeometry, QgsFields::OriginEdit, QgsFields::OriginJoin, and QgsFields::OriginProvider.
Referenced by QgsGraduatedSymbolRendererV2::createRenderer(), and maximumValue().
| QString QgsVectorLayer::metadata | ( | ) | [virtual, slot] |
Obtain Metadata for this layer.
Reimplemented from QgsMapLayer.
Definition at line 3484 of file qgsvectorlayer.cpp.
References capabilitiesString(), QgsField::comment(), QgsMapLayer::crs(), dataComment(), extent(), featureCount(), geometryType(), QgsRectangle::isEmpty(), QgsField::length(), QgsField::name(), QGis::NoGeometry, pendingFields(), pendingPkAttributesList(), QgsField::precision(), QgsMapLayer::publicSource(), QgsDebugMsg, storageType(), QgsCoordinateReferenceSystem::toProj4(), tr, QgsMapLayer::type(), QgsField::typeName(), QGis::vectorGeometryType(), QgsException::what(), QgsRectangle::xMaximum(), QgsRectangle::xMinimum(), QgsRectangle::yMaximum(), and QgsRectangle::yMinimum().
| QVariant QgsVectorLayer::minimumValue | ( | int | index | ) |
Returns minimum value for an attribute column or invalid variant in case of error.
Definition at line 3257 of file qgsvectorlayer.cpp.
References QgsFeature::attribute(), QgsFields::fieldOrigin(), getFeatures(), QgsMapLayerRegistry::instance(), QgsVectorLayerJoinBuffer::joinForFieldIndex(), QgsVectorJoinInfo::joinLayerId, QgsVectorLayerEditBuffer::mAddedFeatures, QgsMapLayerRegistry::mapLayer(), MathUtils::max(), QgsVectorLayerEditBuffer::mChangedAttributeValues, mDataProvider, QgsVectorLayerEditBuffer::mDeletedAttributeIds, QgsVectorLayerEditBuffer::mDeletedFeatureIds, mEditBuffer, QgsVectorDataProvider::minimumValue(), minimumValue(), mJoinBuffer, mUpdatedFields, QgsFeatureIterator::nextFeature(), QgsFeatureRequest::NoGeometry, QgsFields::OriginEdit, QgsFields::OriginJoin, and QgsFields::OriginProvider.
Referenced by QgsGraduatedSymbolRendererV2::createRenderer(), and minimumValue().
| void QgsVectorLayer::modifySelection | ( | QgsFeatureIds | selectIds, |
| QgsFeatureIds | deselectIds | ||
| ) |
Modifies the current selection on this layer.
| selectIds | Select these ids |
| deselectIds | Deselect these ids |
Definition at line 779 of file qgsvectorlayer.cpp.
References mSelectedFeatureIds, QgsDebugMsg, and selectionChanged().
Referenced by invertSelectionInRectangle().
| bool QgsVectorLayer::moveVertex | ( | double | x, |
| double | y, | ||
| QgsFeatureId | atFeatureId, | ||
| int | atVertex | ||
| ) |
Moves the vertex at the given position number, ring and item (first number is index 0), and feature to the given coordinates.
Definition at line 1269 of file qgsvectorlayer.cpp.
References mDataProvider, mEditBuffer, and QgsVectorLayerEditUtils::moveVertex().
| void QgsVectorLayer::onCacheImageDelete | ( | ) | [virtual, slot] |
Is called when the cache image is being deleted.
Overwrite and use to clean up.
Reimplemented from QgsMapLayer.
Definition at line 3729 of file qgsvectorlayer.cpp.
References mCurrentRendererContext, and QgsRenderContext::setRenderingStopped().
| QgsVectorLayer& QgsVectorLayer::operator= | ( | QgsVectorLayer const & | rhs | ) | [private] |
vector layers are not copyable
returns list of attributes
Definition at line 2513 of file qgsvectorlayer.cpp.
References QgsFields::count(), and mUpdatedFields.
Referenced by QgsOfflineEditing::attributeLookup(), QgsVectorLayerCache::checkInformationCovered(), QgsVectorLayerImport::importLayer(), QgsVectorLayerFeatureIterator::prepareJoins(), QgsVectorLayerCache::QgsVectorLayerCache(), and QgsVectorFileWriter::writeAsVectorFormat().
returns feature count after commit
Definition at line 2536 of file qgsvectorlayer.cpp.
References QgsVectorDataProvider::featureCount(), QgsVectorLayerEditBuffer::mAddedFeatures, mDataProvider, QgsVectorLayerEditBuffer::mDeletedFeatureIds, and mEditBuffer.
Referenced by QgsRuleBasedRendererV2Widget::countFeatures(), countSymbolFeatures(), and QgsGeometryAnalyzer::eventLayer().
| const QgsFields & QgsVectorLayer::pendingFields | ( | ) | const |
returns field list in the to-be-committed state
Definition at line 2508 of file qgsvectorlayer.cpp.
References mUpdatedFields.
Referenced by QgsAttributeDialog::accept(), QgsVectorLayerEditBuffer::addAttribute(), addAttributeAlias(), QgsVectorLayerFeatureIterator::addJoinedAttributes(), QgsOfflineEditing::applyFeaturesAdded(), attributeAlias(), attributeDisplayName(), QgsAtlasComposition::beginRender(), QgsGeometryAnalyzer::buffer(), QgsVectorLayerJoinBuffer::cacheJoinLayer(), QgsGeometryAnalyzer::centroids(), QgsVectorLayerEditBuffer::changeAttributeValue(), checkedState(), QgsDualView::columnBoxInit(), QgsVectorLayerEditBuffer::commitChanges(), QgsSearchQueryBuilder::countRecords(), QgsAttributeEditor::createAttributeEditor(), QgsFormAnnotationItem::createDesignerWidget(), QgsFeatureListModel::data(), QgsAttributeTableModel::data(), dateFormat(), QgsVectorLayerEditBuffer::deleteAttribute(), QgsGeometryAnalyzer::dissolve(), editType(), QgsGeometryAnalyzer::eventLayer(), QgsAttributeAction::expandAction(), fieldEditable(), fieldNameIndex(), QgsSearchQueryBuilder::getFieldValues(), QgsComposerAttributeTable::getHeaderLabels(), QgsAttributeTableModel::headerData(), QgsVectorLayerImport::importLayer(), QgsComposerAttributeTable::initializeAliasMap(), QgsOverlayAnalyzer::intersection(), QgsAttributeTableModel::loadAttributes(), QgsExpressionBuilderWidget::loadFieldNames(), metadata(), QgsQueryBuilder::on_lstFields_doubleClicked(), QgsExpressionSelectionDialog::on_mActionAddToSelection_triggered(), QgsExpressionSelectionDialog::on_mActionRemoveFromSelection_triggered(), QgsExpressionSelectionDialog::on_mActionSelect_triggered(), QgsExpressionSelectionDialog::on_mActionSelectInstersect_triggered(), QgsExpressionBuilderWidget::on_txtExpressionString_textChanged(), QgsCategorizedSymbolRendererV2Widget::populateColumns(), QgsGraduatedSymbolRendererV2Widget::populateColumns(), QgsSearchQueryBuilder::populateFields(), QgsQueryBuilder::populateFields(), QgsAttributeTableModel::prefetchColumnData(), QgsSymbolLayerV2::prepareExpressions(), QgsAtlasComposition::prepareForFeature(), QgsVectorLayerFeatureIterator::prepareJoins(), QgsAttributeDialog::QgsAttributeDialog(), QgsCategorizedSymbolRendererV2Widget::QgsCategorizedSymbolRendererV2Widget(), QgsDataDefinedSymbolDialog::QgsDataDefinedSymbolDialog(), QgsGraduatedSymbolRendererV2Widget::QgsGraduatedSymbolRendererV2Widget(), QgsPointDisplacementRendererWidget::QgsPointDisplacementRendererWidget(), QgsSingleSymbolRendererV2Widget::QgsSingleSymbolRendererV2Widget(), QgsVectorFieldSymbolLayerWidget::QgsVectorFieldSymbolLayerWidget(), QgsVectorLayerFeatureIterator::QgsVectorLayerFeatureIterator(), QgsVectorLayerUndoCommandAddAttribute::QgsVectorLayerUndoCommandAddAttribute(), QgsVectorLayerUndoCommandDeleteAttribute::QgsVectorLayerUndoCommandDeleteAttribute(), range(), readSymbology(), QgsPalLayerSettings::registerFeature(), QgsExpression::replaceExpressionText(), QgsAttributeEditor::retrieveValue(), setCheckedState(), setDisplayField(), setEditType(), setFieldEditable(), QgsAttributeEditor::setValue(), QgsGeometryAnalyzer::simplify(), QgsRuleBasedRendererV2::Rule::startRender(), QgsRendererRulePropsDialog::testFilter(), QgsVectorLayerUndoCommandAddAttribute::undo(), QgsVectorLayerJoinBuffer::updateFields(), valueMap(), valueRelation(), widgetSize(), and QgsVectorFileWriter::writeAsVectorFormat().
returns list of attribute making up the primary key
Definition at line 2521 of file qgsvectorlayer.cpp.
References QgsFields::count(), QgsFields::fieldOrigin(), QgsFields::fieldOriginIndex(), mDataProvider, mUpdatedFields, QgsFields::OriginProvider, and QgsVectorDataProvider::pkAttributeIndexes().
Referenced by QgsDualView::columnBoxInit(), and metadata().
| void QgsVectorLayer::prepareLabelingAndDiagrams | ( | QgsRenderContext & | rendererContext, |
| QgsAttributeList & | attributes, | ||
| bool & | labeling | ||
| ) | [private] |
Registers label and diagram layer.
| rendererContext | render context |
| attributes | attributes needed for labeling and diagrams will be added to the list |
| labeling | out: true if there will be labeling (ng) for this layer |
Definition at line 3410 of file qgsvectorlayer.cpp.
References QgsLabelingEngineInterface::addDiagramLayer(), QgsDiagramRendererV2::diagramAttributes(), QgsRenderContext::extent(), getFeatures(), QgsRenderContext::labelingEngine(), QgsLabelingEngineInterface::layer(), QgsPalLayerSettings::limitNumLabels, QgsPalLayerSettings::maxNumLabels, mDiagramLayerSettings, mDiagramRenderer, QgsPalLayerSettings::mFeaturesToLabel, QgsFeatureIterator::nextFeature(), QgsLabelingEngineInterface::prepareLayer(), QgsDiagramLayerSettings::renderer, QgsDiagramLayerSettings::xPosColumn, and QgsDiagramLayerSettings::yPosColumn.
Referenced by draw().
| QString QgsVectorLayer::providerType | ( | ) | const |
Return the provider type for this layer.
Definition at line 241 of file qgsvectorlayer.cpp.
References mProviderKey.
Referenced by QgsOfflineEditing::copyVectorLayer(), QgsVectorLayerImport::importLayer(), QgsMapLayer::saveNamedStyle(), QgsMapLayer::saveSldStyle(), QgsMapLayer::writeLayerXML(), and writeXml().
| QgsVectorLayer::RangeData & QgsVectorLayer::range | ( | int | idx | ) |
access range
Definition at line 2985 of file qgsvectorlayer.cpp.
References QgsFields::count(), mRanges, pendingFields(), and QgsDebugMsg.
Referenced by QgsAttributeEditor::createAttributeEditor().
| bool QgsVectorLayer::readSld | ( | const QDomNode & | node, |
| QString & | errorMessage | ||
| ) | [virtual] |
Reimplemented from QgsMapLayer.
Definition at line 2362 of file qgsvectorlayer.cpp.
References geometryType(), hasGeometryType(), QgsFeatureRendererV2::loadSld(), and setRendererV2().
| bool QgsVectorLayer::readSymbology | ( | const QDomNode & | node, |
| QString & | errorMessage | ||
| ) | [virtual] |
Read the symbology for the current layer from the Dom node supplied.
| node | node that will contain the symbology definition for this layer. |
| errorMessage | reference to string that will be updated with any error messages |
Implements QgsMapLayer.
Definition at line 1724 of file qgsvectorlayer.cpp.
References attributeEditorElementFromDomElement(), Calendar, CheckBox, Classification, Color, QgsFeatureRendererV2::defaultRenderer(), DialRange, EditRange, editType(), enableLabels(), Enumeration, fieldNameIndex(), FileName, GeneratedLayout, geometryType(), QgsMapRenderer::getCompositionMode(), hasGeometryType(), hasLabelsEnabled(), Hidden, Immutable, QgsProject::instance(), LineEdit, QgsFeatureRendererV2::load(), mActions, mAnnotationForm, mAttributeAliasMap, mAttributeEditorElements, MathUtils::max(), mCheckedStates, mDateFormats, mDiagramLayerSettings, mDiagramRenderer, mEditForm, mEditFormInit, mEditorLayout, mEditTypes, mExcludeAttributesWFS, mExcludeAttributesWMS, mFieldEditables, MathUtils::min(), mLabel, mRanges, mValueMaps, mValueRelations, mWidgetSize, QgsMapLayer::name(), pendingFields(), Photo, QgsDebugMsg, QgsMapLayer::readCustomProperties(), QgsSymbologyV2Conversion::readOldRenderer(), QgsProject::readPath(), QgsDiagramLayerSettings::readXML(), QgsLabel::readXML(), QgsAttributeAction::readXML(), QgsDiagramRendererV2::readXML(), RENDERER_TAG_NAME, QgsMapLayer::setBlendMode(), setDisplayField(), setFeatureBlendMode(), setLayerTransparency(), QgsLabel::setMaxScale(), QgsLabel::setMinScale(), setRendererV2(), QgsLabel::setScaleBasedVisibility(), SliderRange, TabLayout, TextEdit, UiFileLayout, UniqueValues, UniqueValuesEditable, UuidGenerator, ValueMap, ValueRelation, and WebView.
Referenced by applyNamedStyle(), QgsOfflineEditing::copySymbology(), and readXml().
| bool QgsVectorLayer::readXml | ( | const QDomNode & | layer_node | ) | [virtual] |
reads vector layer specific state from project file Dom node.
Reimplemented from QgsMapLayer.
Definition at line 1494 of file qgsvectorlayer.cpp.
References checkJoinLayerRemove(), QgsMapLayerRegistry::instance(), mDataProvider, QgsMapLayer::mDataSource, mDisplayExpression, mJoinBuffer, mProviderKey, QgsMapLayer::mValid, QgsDebugMsg, readSymbology(), QgsVectorLayerJoinBuffer::readXml(), setDataProvider(), QgsVectorDataProvider::setEncoding(), and updateFields().
| void QgsVectorLayer::reload | ( | ) | [virtual] |
Synchronises with changes in the datasource.
Reimplemented from QgsMapLayer.
Definition at line 639 of file qgsvectorlayer.cpp.
References mDataProvider, and QgsDataProvider::reloadData().
Referenced by QgsOfflineEditing::synchronize().
| void QgsVectorLayer::removeJoin | ( | const QString & | joinLayerId | ) |
Removes a vector layer join.
Definition at line 3158 of file qgsvectorlayer.cpp.
References mJoinBuffer, QgsVectorLayerJoinBuffer::removeJoin(), and updateFields().
Referenced by checkJoinLayerRemove().
| void QgsVectorLayer::removeOverlay | ( | const QString & | typeName | ) |
Removes all overlays of a given type.
Definition at line 3049 of file qgsvectorlayer.cpp.
References mOverlays.
| int QgsVectorLayer::removePolygonIntersections | ( | QgsGeometry * | geom, |
| QgsFeatureIds | ignoreFeatures = QgsFeatureIds() |
||
| ) |
Changes the specified geometry such that it has no intersections with other polygon (or multipolygon) geometries in this vector layer.
| geom | geometry to modify |
| ignoreFeatures | list of feature ids where intersections should be ignored |
Definition at line 1368 of file qgsvectorlayer.cpp.
References QgsGeometry::boundingBox(), QgsFeatureRequest::ExactIntersect, QgsFeature::geometry(), getFeatures(), hasGeometryType(), QgsFeature::id(), QgsGeometry::makeDifference(), QgsFeatureIterator::nextFeature(), QGis::Polygon, and QgsGeometry::type().
Referenced by QgsGeometry::avoidIntersections().
| void QgsVectorLayer::removeSelection | ( | ) | [slot] |
Clear selection.
Definition at line 844 of file qgsvectorlayer.cpp.
References mSelectedFeatureIds, and setSelectedFeatures().
Return renderer V2.
Definition at line 3079 of file qgsvectorlayer.cpp.
References mRendererV2.
Referenced by QgsLegendModel::addVectorLayerItemsV2(), QgsAttributeEditor::createAttributeEditor(), QgsVectorFileWriter::createSymbolLayerTable(), QgsVectorFileWriter::exportFeaturesSymbolLevels(), QgsAttributeTableFilterModel::generateListOfVisibleFeatures(), QgsMapToolIdentify::identifyVectorLayer(), QgsRendererV2PropertiesDialog::QgsRendererV2PropertiesDialog(), QgsRendererV2PropertiesDialog::rendererChanged(), QgsComposerLayerItem::setDefaultStyle(), QgsVectorFileWriter::symbologyRenderer(), QgsLegendModel::updateSymbolV2ItemText(), and QgsVectorFileWriter::writeAsVectorFormat().
| bool QgsVectorLayer::rollBack | ( | bool | deleteBuffer = true | ) |
Stop editing and discard the edits.
| deleteBuffer | whether to delete editing buffer (added in 1.9) |
Definition at line 2588 of file qgsvectorlayer.cpp.
References editingStopped(), isModified(), mEditBuffer, QgsVectorLayerEditBuffer::rollBack(), QgsMapLayer::setCacheImage(), QgsMapLayer::undoStack(), and updateFields().
| void QgsVectorLayer::saveStyleToDatabase | ( | QString | name, |
| QString | description, | ||
| bool | useAsDefault, | ||
| QString | uiFileContent, | ||
| QString & | msgError | ||
| ) | [virtual] |
Save named and sld style of the layer to the style table in the db.
| name | |
| description | |
| useAsDefault | |
| uiFileContent | |
| msgError |
Definition at line 3834 of file qgsvectorlayer.cpp.
References cast_to_fptr, QgsMapLayer::exportNamedStyle(), QgsMapLayer::exportSldStyle(), QgsProviderRegistry::instance(), QgsMapLayer::mDataSource, mProviderKey, QgsProviderRegistry::providerLibrary(), and tr.
| void QgsVectorLayer::select | ( | QgsRectangle & | rect, |
| bool | addToSelection | ||
| ) |
Select features found within the search rectangle (in layer's coordinates)
| rect | The search rectangle |
| addToSelection | If set to true will not clear before selecting |
Definition at line 750 of file qgsvectorlayer.cpp.
References QgsFeatureRequest::ExactIntersect, getFeatures(), QgsFeature::id(), mSelectedFeatureIds, QgsFeatureIterator::nextFeature(), QgsFeatureRequest::NoGeometry, QgsRectangle::normalize(), and setSelectedFeatures().
Referenced by QgsFeatureSelectionModel::enableSync(), and QgsFeatureSelectionModel::selectFeatures().
| void QgsVectorLayer::select | ( | const QgsFeatureId & | featureId | ) | [slot] |
Select feature by its ID.
| featureId | The id of the feature to select |
Definition at line 718 of file qgsvectorlayer.cpp.
References mSelectedFeatureIds, selectionChanged(), and QgsMapLayer::setCacheImage().
| void QgsVectorLayer::select | ( | const QgsFeatureIds & | featureIds | ) | [slot] |
Select features by their ID.
| featureIds | The ids of the features to select |
Definition at line 726 of file qgsvectorlayer.cpp.
References mSelectedFeatureIds, selectionChanged(), and QgsMapLayer::setCacheImage().
The number of features that are selected in this layer.
Definition at line 2632 of file qgsvectorlayer.cpp.
References mSelectedFeatureIds.
Referenced by QgsMapCanvas::panToSelected(), and QgsMapCanvas::zoomToSelected().
Get a copy of the user-selected features.
Definition at line 2643 of file qgsvectorlayer.cpp.
References geometryType(), getFeatures(), mSelectedFeatureIds, QgsFeatureRequest::NoGeometry, QGis::NoGeometry, QgsFeatureRequest::setFilterFid(), and QgsFeatureRequest::setFlags().
Referenced by QgsVectorLayerEditUtils::splitFeatures().
| const QgsFeatureIds & QgsVectorLayer::selectedFeaturesIds | ( | ) | const |
Return reference to identifiers of selected features.
Definition at line 2637 of file qgsvectorlayer.cpp.
References mSelectedFeatureIds.
Referenced by QgsGeometryAnalyzer::buffer(), QgsGeometryAnalyzer::centroids(), QgsGeometryAnalyzer::convexHull(), QgsGeometryAnalyzer::dissolve(), QgsAttributeTableFilterModel::filterAcceptsRow(), QgsVectorLayerImport::importLayer(), QgsOverlayAnalyzer::intersection(), QgsFeatureSelectionModel::isSelected(), QgsAttributeTableFilterModel::lessThan(), QgsExpressionSelectionDialog::on_mActionAddToSelection_triggered(), QgsExpressionSelectionDialog::on_mActionRemoveFromSelection_triggered(), QgsExpressionSelectionDialog::on_mActionSelectInstersect_triggered(), QgsGeometryAnalyzer::simplify(), QgsVectorLayerEditUtils::splitFeatures(), and QgsVectorFileWriter::writeAsVectorFormat().
| void QgsVectorLayer::selectionChanged | ( | const QgsFeatureIds | selected, |
| const QgsFeatureIds | deselected, | ||
| const bool | clearAndSelect | ||
| ) | [signal] |
This signal is emitted when selection was changed.
| selected | Newly selected feature ids |
| deselected | Ids of all features which have previously been selected but are not any more |
| clearAndSelect | In case this is set to true, the old selection was dismissed and the new selection corresponds to selected |
| void QgsVectorLayer::selectionChanged | ( | ) | [signal] |
This signal is emitted when selection was changed.
Referenced by deselect(), modifySelection(), QgsVectorLayer(), select(), and setSelectedFeatures().
| void QgsVectorLayer::setAnnotationForm | ( | const QString & | ui | ) |
set annotation form for layer (added in 1.5)
Definition at line 2951 of file qgsvectorlayer.cpp.
References mAnnotationForm.
| void QgsVectorLayer::setCheckedState | ( | int | idx, |
| QString | checked, | ||
| QString | notChecked | ||
| ) |
set string representing 'true' for a checkbox (added in 1.4)
Definition at line 3117 of file qgsvectorlayer.cpp.
References QgsFields::count(), mCheckedStates, QgsMapLayer::name(), and pendingFields().
| void QgsVectorLayer::setCoordinateSystem | ( | ) |
Setup the coordinate system tranformation for the layer.
Definition at line 2854 of file qgsvectorlayer.cpp.
References QgsDataProvider::crs(), GEO_EPSG_CRS_AUTHID, hasGeometryType(), mDataProvider, QgsDebugMsg, and QgsMapLayer::setCrs().
Referenced by QgsVectorLayer().
| bool QgsVectorLayer::setDataProvider | ( | QString const & | provider | ) | [private] |
bind layer to a specific data provider
| provider | should be "postgres", "ogr", or ?? |
Definition at line 1574 of file qgsvectorlayer.cpp.
References QgsDataProvider::dataSourceUri(), QgsDataProvider::extent(), QgsVectorDataProvider::fields(), QgsVectorDataProvider::geometryType(), QgsMapLayerRegistry::instance(), QgsProviderRegistry::instance(), QgsDataProvider::isValid(), QgsMapLayerRegistry::mapLayers(), mDataProvider, QgsMapLayer::mDataSource, mLabel, mLabelOn, mProviderKey, QgsMapLayer::mValid, mWkbType, QgsMapLayer::name(), QgsProviderRegistry::provider(), QgsDebugMsg, setDisplayField(), setExtent(), QgsMapLayer::setLayerName(), QgsRectangle::toString(), and updateExtents().
Referenced by QgsVectorLayer(), and readXml().
| void QgsVectorLayer::setDiagramLayerSettings | ( | const QgsDiagramLayerSettings & | s | ) |
Definition at line 3477 of file qgsvectorlayer.cpp.
References mDiagramLayerSettings.
Sets diagram rendering object (takes ownership)
Definition at line 876 of file qgsvectorlayer.cpp.
References mDiagramRenderer.
| void QgsVectorLayer::setDisplayExpression | ( | const QString | displayExpression | ) |
Set the preview expression, used to create a human readable preview string.
Used e.g. in the attribute table feature list. Uses QgsExpression.
| displayExpression | The expression which will be used to preview features for this layer |
Definition at line 2880 of file qgsvectorlayer.cpp.
References displayExpression(), and mDisplayExpression.
Referenced by QgsDualView::previewExpressionChanged().
| void QgsVectorLayer::setDisplayField | ( | QString | fldName = "" | ) |
Set the primary display field to be used in the identify results dialog.
sets the preferred display field based on some fuzzy logic
Definition at line 249 of file qgsvectorlayer.cpp.
References QgsFields::count(), hasGeometryType(), mDisplayField, pendingFields(), QgsDebugMsg, and QgsFields::size().
Referenced by readSymbology(), and setDataProvider().
| void QgsVectorLayer::setEditForm | ( | QString | ui | ) |
set edit form (added in 1.4)
Definition at line 2946 of file qgsvectorlayer.cpp.
References mEditForm.
| void QgsVectorLayer::setEditFormInit | ( | QString | function | ) |
set python function for edit form initialization (added in 1.4)
Definition at line 2961 of file qgsvectorlayer.cpp.
References mEditFormInit.
| void QgsVectorLayer::setEditorLayout | ( | EditorLayout | editorLayout | ) |
set the active layout for the attribute editor for this layer (added in 1.9)
Definition at line 2936 of file qgsvectorlayer.cpp.
References editorLayout(), and mEditorLayout.
| void QgsVectorLayer::setEditType | ( | int | idx, |
| EditType | edit | ||
| ) |
set edit type
Definition at line 2924 of file qgsvectorlayer.cpp.
References QgsFields::count(), mEditTypes, QgsMapLayer::name(), pendingFields(), and QgsMapLayer::type().
| void QgsVectorLayer::setExcludeAttributesWFS | ( | const QSet< QString > & | att | ) | [inline] |
Definition at line 1041 of file qgsvectorlayer.h.
| void QgsVectorLayer::setExcludeAttributesWMS | ( | const QSet< QString > & | att | ) | [inline] |
Definition at line 1038 of file qgsvectorlayer.h.
| void QgsVectorLayer::setExtent | ( | const QgsRectangle & | rect | ) | [protected, virtual] |
Set the extent.
Reimplemented from QgsMapLayer.
Definition at line 1096 of file qgsvectorlayer.cpp.
References mValidExtent.
Referenced by extent(), and setDataProvider().
| void QgsVectorLayer::setFeatureBlendMode | ( | const QPainter::CompositionMode | blendMode | ) |
Write blend mode for features.
Definition at line 3377 of file qgsvectorlayer.cpp.
References featureBlendMode(), and mFeatureBlendMode.
Referenced by QgsRendererV2PropertiesDialog::apply(), and readSymbology().
| void QgsVectorLayer::setFieldEditable | ( | int | idx, |
| bool | editable | ||
| ) |
set edit widget editable
Definition at line 3037 of file qgsvectorlayer.cpp.
References QgsFields::count(), mFieldEditables, QgsMapLayer::name(), and pendingFields().
| void QgsVectorLayer::setLayerTransparency | ( | int | layerTransparency | ) |
Write transparency for layer.
Definition at line 3389 of file qgsvectorlayer.cpp.
References layerTransparency(), and mLayerTransparency.
Referenced by QgsRendererV2PropertiesDialog::apply(), and readSymbology().
| void QgsVectorLayer::setProviderEncoding | ( | const QString & | encoding | ) |
Sets the textencoding of the data provider.
Definition at line 867 of file qgsvectorlayer.cpp.
References mDataProvider, QgsVectorDataProvider::setEncoding(), and updateFields().
| bool QgsVectorLayer::setReadOnly | ( | bool | readonly = true | ) |
Make layer read-only (editing disabled) or not.
Definition at line 2900 of file qgsvectorlayer.cpp.
References mEditBuffer, and mReadOnly.
| void QgsVectorLayer::setRendererV2 | ( | QgsFeatureRendererV2 * | r | ) |
Set renderer V2.
Definition at line 3084 of file qgsvectorlayer.cpp.
References hasGeometryType(), mRendererV2, mSymbolFeatureCounted, and mSymbolFeatureCountMap.
Referenced by QgsRendererV2PropertiesDialog::apply(), QgsVectorLayer(), readSld(), and readSymbology().
| void QgsVectorLayer::setSelectedFeatures | ( | const QgsFeatureIds & | ids | ) |
Change selection to the new set of features.
Dismisses the current selection. Will emit the selectionChanged( QgsFeatureIds, QgsFeatureIds, bool ) signal with the clearAndSelect flag set.
| ids | The ids which will be the new selection |
Definition at line 2620 of file qgsvectorlayer.cpp.
References mSelectedFeatureIds, selectionChanged(), and QgsMapLayer::setCacheImage().
Referenced by addFeatures(), QgsFeatureSelectionModel::enableSync(), invertSelection(), QgsExpressionSelectionDialog::on_mActionAddToSelection_triggered(), QgsExpressionSelectionDialog::on_mActionRemoveFromSelection_triggered(), QgsExpressionSelectionDialog::on_mActionSelect_triggered(), QgsExpressionSelectionDialog::on_mActionSelectInstersect_triggered(), removeSelection(), select(), and QgsFeatureSelectionModel::selectFeatures().
| bool QgsVectorLayer::setSubsetString | ( | QString | subset | ) | [virtual] |
Set the string (typically sql) used to define a subset of the layer.
| subset | The subset string. This may be the where clause of a sql statement or other defintion string specific to the underlying dataprovider and data store. |
Definition at line 1176 of file qgsvectorlayer.cpp.
References QgsDataProvider::dataSourceUri(), mDataProvider, QgsMapLayer::mDataSource, QgsDebugMsg, QgsMapLayer::setCacheImage(), QgsDataProvider::setSubsetString(), and updateExtents().
Referenced by QgsQueryBuilder::accept(), QgsQueryBuilder::clear(), QgsOfflineEditing::copyVectorLayer(), QgsQueryBuilder::on_btnGetAllValues_clicked(), QgsQueryBuilder::on_btnSampleValues_clicked(), QgsQueryBuilder::reject(), and QgsQueryBuilder::test().
| bool QgsVectorLayer::snapPoint | ( | QgsPoint & | point, |
| double | tolerance | ||
| ) |
Snaps a point to the closest vertex if there is one within the snapping tolerance.
| point | The point which is set to the position of a vertex if there is one within the snapping tolerance. If there is no point within this tolerance, point is left unchanged. |
| tolerance | The snapping tolerance |
Definition at line 2681 of file qgsvectorlayer.cpp.
References hasGeometryType(), QgsPoint::setX(), QgsPoint::setY(), QgsSnapper::SnapToVertex, and snapWithContext().
| void QgsVectorLayer::snapToGeometry | ( | const QgsPoint & | startPoint, |
| QgsFeatureId | featureId, | ||
| QgsGeometry * | geom, | ||
| double | sqrSnappingTolerance, | ||
| QMultiMap< double, QgsSnappingResult > & | snappingResults, | ||
| QgsSnapper::SnappingType | snap_to | ||
| ) | const [private] |
Snaps to a geometry and adds the result to the multimap if it is within the snapping result.
| startPoint | start point of the snap |
| featureId | id of feature |
| geom | geometry to snap |
| sqrSnappingTolerance | squared search tolerance of the snap |
| snappingResults | list to which the result is appended |
| snap_to | snap to vertex or to segment |
Definition at line 2758 of file qgsvectorlayer.cpp.
References QgsSnappingResult::afterVertex, QgsSnappingResult::afterVertexNr, QgsSnappingResult::beforeVertex, QgsSnappingResult::beforeVertexNr, QgsGeometry::closestSegmentWithContext(), QgsGeometry::closestVertex(), QgsMapLayer::crs(), geometryType(), QgsSnappingResult::layer, QGis::Point, QgsSnappingResult::snappedAtGeometry, QgsSnappingResult::snappedVertex, QgsSnappingResult::snappedVertexNr, QgsSnapper::SnapToSegment, QgsSnapper::SnapToVertex, QgsSnapper::SnapToVertexAndSegment, and QgsGeometry::vertexAt().
Referenced by snapWithContext().
| int QgsVectorLayer::snapWithContext | ( | const QgsPoint & | startPoint, |
| double | snappingTolerance, | ||
| QMultiMap< double, QgsSnappingResult > & | snappingResults, | ||
| QgsSnapper::SnappingType | snap_to | ||
| ) |
Snaps to segment or vertex within given tolerance.
| startPoint | point to snap (in layer coordinates) |
| snappingTolerance | distance tolerance for snapping |
| snappingResults | snapping results. Key is the distance between startPoint and snapping target |
| snap_to | to segment / to vertex |
Definition at line 2706 of file qgsvectorlayer.cpp.
References QgsGeometry::boundingBox(), QgsGeometryCache::cachedGeometries(), QgsGeometryCache::cachedGeometriesRect(), QgsRectangle::contains(), QgsFeatureRequest::ExactIntersect, QgsFeature::geometry(), getFeatures(), hasGeometryType(), QgsFeature::id(), QgsRectangle::intersects(), mCache, mDataProvider, QgsFeatureIterator::nextFeature(), snapToGeometry(), QgsPoint::x(), and QgsPoint::y().
Referenced by QgsVectorLayerEditUtils::addTopologicalPoints(), and snapPoint().
| int QgsVectorLayer::splitFeatures | ( | const QList< QgsPoint > & | splitLine, |
| bool | topologicalEditing = false |
||
| ) |
Splits features cut by the given line.
| splitLine | line that splits the layer features |
| topologicalEditing | true if topological editing is enabled |
Definition at line 1359 of file qgsvectorlayer.cpp.
References mDataProvider, mEditBuffer, and QgsVectorLayerEditUtils::splitFeatures().
| bool QgsVectorLayer::startEditing | ( | ) |
Make layer editable.
Definition at line 1450 of file qgsvectorlayer.cpp.
References attributeAdded(), attributeDeleted(), attributeValueChanged(), QgsVectorDataProvider::capabilities(), committedFeaturesAdded(), committedFeaturesRemoved(), QgsVectorDataProvider::EditingCapabilities, editingStarted(), featureAdded(), featureDeleted(), geometryChanged(), layerModified(), mDataProvider, mEditBuffer, mReadOnly, QgsVectorLayerEditBuffer, and updateFields().
Referenced by QgsOfflineEditing::copyVectorLayer(), and QgsOfflineEditing::synchronize().
| void QgsVectorLayer::stopRendererV2 | ( | QgsRenderContext & | rendererContext, |
| QgsSingleSymbolRendererV2 * | selRenderer | ||
| ) | [private] |
Add joined attributes to a feature.
Stop version 2 renderer and selected renderer (if required)
Definition at line 3400 of file qgsvectorlayer.cpp.
References mRendererV2, QgsSingleSymbolRendererV2::stopRender(), and QgsFeatureRendererV2::stopRender().
Referenced by drawRendererV2(), and drawRendererV2Levels().
| QString QgsVectorLayer::storageType | ( | ) | const |
Returns the permanent storage type for this layer as a friendly name.
Definition at line 212 of file qgsvectorlayer.cpp.
References mDataProvider, and QgsVectorDataProvider::storageType().
Referenced by QgsVectorLayerImport::importLayer(), and metadata().
| QString QgsVectorLayer::subsetString | ( | ) | [virtual] |
Get the string (typically sql) used to define a subset of the layer.
Definition at line 1166 of file qgsvectorlayer.cpp.
References mDataProvider, QgsDebugMsg, and QgsDataProvider::subsetString().
Referenced by QgsQueryBuilder::on_btnGetAllValues_clicked(), QgsQueryBuilder::on_btnSampleValues_clicked(), QgsQueryBuilder::QgsQueryBuilder(), QgsQueryBuilder::reject(), and QgsQueryBuilder::test().
| int QgsVectorLayer::translateFeature | ( | QgsFeatureId | featureId, |
| double | dx, | ||
| double | dy | ||
| ) |
Translates feature by dx, dy.
| featureId | id of the feature to translate |
| dx | translation of x-coordinate |
| dy | translation of y-coordinate |
Definition at line 1350 of file qgsvectorlayer.cpp.
References mDataProvider, mEditBuffer, and QgsVectorLayerEditUtils::translateFeature().
| void QgsVectorLayer::triggerRepaint | ( | ) | [slot] |
Definition at line 852 of file qgsvectorlayer.cpp.
References QgsMapLayer::repaintRequested().
Referenced by deleteSelectedFeatures().
| void QgsVectorLayer::uniqueValues | ( | int | index, |
| QList< QVariant > & | uniqueValues, | ||
| int | limit = -1 |
||
| ) |
Returns unique values for column.
| index | column index for attribute |
| uniqueValues | out: result list |
| limit | maximum number of values to return (-1 if unlimited) |
Definition at line 3196 of file qgsvectorlayer.cpp.
References QgsFeature::attribute(), dataProvider(), QgsFields::fieldOrigin(), getFeatures(), QgsMapLayerRegistry::instance(), QgsVectorLayerJoinBuffer::joinForFieldIndex(), QgsVectorJoinInfo::joinLayerId, QgsVectorLayerEditBuffer::mAddedFeatures, QgsMapLayerRegistry::mapLayer(), QgsVectorLayerEditBuffer::mChangedAttributeValues, mDataProvider, QgsVectorLayerEditBuffer::mDeletedAttributeIds, QgsVectorLayerEditBuffer::mDeletedFeatureIds, mEditBuffer, mJoinBuffer, mUpdatedFields, QgsFeatureIterator::nextFeature(), QgsFeatureRequest::NoGeometry, QgsFields::OriginEdit, QgsFields::OriginJoin, QgsFields::OriginProvider, and QgsVectorDataProvider::uniqueValues().
Referenced by QgsCategorizedSymbolRendererV2Widget::addCategories(), QgsExpressionBuilderWidget::fillFieldValues(), and QgsQueryBuilder::fillValues().
| void QgsVectorLayer::updatedFields | ( | ) | [signal] |
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.
Referenced by updateFields().
| void QgsVectorLayer::updateExtents | ( | ) | [virtual, slot] |
Update the extents for the layer.
This is necessary if features are added/deleted or the layer has been subsetted.
Definition at line 1091 of file qgsvectorlayer.cpp.
References mValidExtent.
Referenced by QgsVectorLayerEditBuffer::addFeatures(), deleteSelectedFeatures(), setDataProvider(), and setSubsetString().
| bool QgsVectorLayer::updateFeature | ( | QgsFeature & | f | ) |
Updates an existing feature.
| f | feature to update |
Definition at line 1215 of file qgsvectorlayer.cpp.
References QgsFeature::attributes(), changeAttributeValue(), changeGeometry(), QgsFeature::geometry(), getFeatures(), QgsFeature::id(), QgsGeometry::isGeosEqual(), QgsFeatureRequest::NoGeometry, QgsDebugMsg, QgsFeatureRequest::setFilterFid(), QgsFeatureRequest::setFlags(), and QgsFeatureRequest::setSubsetOfAttributes().
| void QgsVectorLayer::updateFields | ( | ) |
Assembles mUpdatedFields considering provider fields, joined fields and added fields.
Definition at line 3169 of file qgsvectorlayer.cpp.
References QgsVectorLayerJoinBuffer::containsJoins(), QgsVectorDataProvider::fields(), mDataProvider, mEditBuffer, mJoinBuffer, mUpdatedFields, updatedFields(), QgsVectorLayerJoinBuffer::updateFields(), and QgsVectorLayerEditBuffer::updateFields().
Referenced by addJoin(), QgsVectorLayerEditBuffer::commitChanges(), commitChanges(), QgsVectorLayer(), readXml(), removeJoin(), rollBack(), setProviderEncoding(), startEditing(), and QgsVectorLayerEditBuffer::updateLayerFields().
| QMap< QString, QVariant > & QgsVectorLayer::valueMap | ( | int | idx | ) |
access value map
Definition at line 2966 of file qgsvectorlayer.cpp.
References QgsFields::count(), mValueMaps, pendingFields(), and QgsDebugMsg.
Referenced by QgsAttributeEditor::createAttributeEditor().
access relations
Definition at line 3735 of file qgsvectorlayer.cpp.
References QgsFields::count(), mValueRelations, pendingFields(), and QgsDebugMsg.
Referenced by QgsAttributeEditor::createAttributeEditor(), and QgsAttributeTableModel::loadAttributes().
| const QList< QgsVectorJoinInfo > & QgsVectorLayer::vectorJoins | ( | ) | const |
Definition at line 3164 of file qgsvectorlayer.cpp.
References mJoinBuffer, and QgsVectorLayerJoinBuffer::vectorJoins().
Referenced by QgsProject::addLayer().
| void QgsVectorLayer::vectorOverlays | ( | QList< QgsVectorOverlay * > & | overlayList | ) |
Returns pointers to the overlays of this layer.
Definition at line 3060 of file qgsvectorlayer.cpp.
References mOverlays.
Referenced by QgsMapRenderer::render().
| QSize & QgsVectorLayer::widgetSize | ( | int | idx | ) |
access widget size for photo and webview widget
Definition at line 3016 of file qgsvectorlayer.cpp.
References mWidgetSize, and pendingFields().
Referenced by QgsAttributeEditor::loadPixmap().
| QGis::WkbType QgsVectorLayer::wkbType | ( | ) | const |
Returns the WKBType or WKBUnknown in case of error.
Definition at line 939 of file qgsvectorlayer.cpp.
References mWkbType.
Referenced by QgsOfflineEditing::copyVectorLayer(), QgsPointDisplacementRenderer::createDisplacementGroups(), QgsVectorLayerImport::importLayer(), QgsPointDisplacementRendererWidget::QgsPointDisplacementRendererWidget(), and QgsVectorFileWriter::writeAsVectorFormat().
| bool QgsVectorLayer::writeSld | ( | QDomNode & | node, |
| QDomDocument & | doc, | ||
| QString & | errorMessage | ||
| ) | const |
Definition at line 2383 of file qgsvectorlayer.cpp.
References hasGeometryType(), mRendererV2, QgsMapLayer::name(), and QgsFeatureRendererV2::writeSld().
Referenced by QgsMapLayer::exportSldStyle().
| bool QgsVectorLayer::writeSymbology | ( | QDomNode & | node, |
| QDomDocument & | doc, | ||
| QString & | errorMessage | ||
| ) | const [virtual] |
Write the symbology for the layer into the docment provided.
| node | the node that will have the style element added to it. |
| doc | the document that will have the QDomNode added. |
| errorMessage | reference to string that will be updated with any error messages |
Implements QgsMapLayer.
Definition at line 2081 of file qgsvectorlayer.cpp.
References QgsMapLayer::blendMode(), Calendar, CheckBox, Classification, Color, DialRange, displayField(), EditRange, Enumeration, featureBlendMode(), fieldNameIndex(), FileName, GeneratedLayout, QgsMapRenderer::getBlendModeEnum(), hasGeometryType(), hasLabelsEnabled(), Hidden, Immutable, QgsProject::instance(), QgsLabel::labelField(), layerTransparency(), LineEdit, mActions, QgsVectorLayer::ValueRelationData::mAllowMulti, QgsVectorLayer::ValueRelationData::mAllowNull, mAnnotationForm, mAttributeAliasMap, mAttributeEditorElements, QgsLabel::maxScale(), mCheckedStates, mDateFormats, mDiagramLayerSettings, mDiagramRenderer, mEditForm, mEditFormInit, mEditorLayout, mEditTypes, mExcludeAttributesWFS, mExcludeAttributesWMS, mFieldEditables, QgsVectorLayer::ValueRelationData::mFilterExpression, QgsLabel::minScale(), QgsVectorLayer::ValueRelationData::mKey, mLabel, QgsVectorLayer::ValueRelationData::mLayer, QgsVectorLayer::ValueRelationData::mOrderByValue, mOverlays, mRanges, mRendererV2, QgsVectorLayer::ValueRelationData::mValue, mValueMaps, mValueRelations, mWidgetSize, Photo, QgsFeatureRendererV2::save(), QgsLabel::scaleBasedVisibility(), SliderRange, TabLayout, QgsLabel::Text, TextEdit, UiFileLayout, UniqueValues, UniqueValuesEditable, UuidGenerator, ValueMap, ValueRelation, WebView, QgsMapLayer::writeCustomProperties(), QgsDiagramLayerSettings::writeXML(), QgsLabel::writeXML(), QgsAttributeAction::writeXML(), and QgsDiagramRendererV2::writeXML().
Referenced by QgsOfflineEditing::copySymbology(), and writeXml().
| bool QgsVectorLayer::writeXml | ( | QDomNode & | layer_node, |
| QDomDocument & | doc | ||
| ) | [virtual] |
write vector layer specific state to project file Dom node.
Reimplemented from QgsMapLayer.
Definition at line 1682 of file qgsvectorlayer.cpp.
References QgsVectorDataProvider::encoding(), geometryType(), mDataProvider, mDisplayExpression, mJoinBuffer, providerType(), QgsDebugMsg, QGis::vectorGeometryType(), writeSymbology(), and QgsVectorLayerJoinBuffer::writeXml().
friend class QgsVectorLayerEditBuffer [friend] |
Definition at line 1542 of file qgsvectorlayer.h.
Referenced by startEditing().
friend class QgsVectorLayerFeatureIterator [friend] |
Definition at line 1563 of file qgsvectorlayer.h.
Referenced by getFeatures().
QgsAttributeAction* QgsVectorLayer::mActions [private] |
The user-defined actions that are accessed from the Identify Results dialog box.
Definition at line 1461 of file qgsvectorlayer.h.
Referenced by QgsVectorLayer(), readSymbology(), writeSymbology(), and ~QgsVectorLayer().
QString QgsVectorLayer::mAnnotationForm [private] |
Definition at line 1535 of file qgsvectorlayer.h.
Referenced by readSymbology(), setAnnotationForm(), and writeSymbology().
QMap< QString, QString > QgsVectorLayer::mAttributeAliasMap [private] |
Map that stores the aliases for attributes.
Key is the attribute name and value the alias for that attribute
Definition at line 1476 of file qgsvectorlayer.h.
Referenced by addAttributeAlias(), attributeAlias(), readSymbology(), and writeSymbology().
QList< QgsAttributeEditorElement* > QgsVectorLayer::mAttributeEditorElements [private] |
Stores a list of attribute editor elements (Each holding a tree structure for a tab in the attribute editor)
Definition at line 1479 of file qgsvectorlayer.h.
Referenced by addAttributeEditorWidget(), attributeEditorElements(), clearAttributeEditorWidgets(), readSymbology(), and writeSymbology().
QgsGeometryCache* QgsVectorLayer::mCache [private] |
cache for some vector layer data - currently only geometries for faster editing
Definition at line 1538 of file qgsvectorlayer.h.
Referenced by draw(), drawRendererV2(), drawRendererV2Levels(), snapWithContext(), and ~QgsVectorLayer().
QMap< QString, QPair<QString, QString> > QgsVectorLayer::mCheckedStates [private] |
Definition at line 1525 of file qgsvectorlayer.h.
Referenced by checkedState(), readSymbology(), setCheckedState(), and writeSymbology().
QStringList QgsVectorLayer::mCommitErrors [private] |
Definition at line 1519 of file qgsvectorlayer.h.
Referenced by commitChanges(), and commitErrors().
Definition at line 1561 of file qgsvectorlayer.h.
Referenced by drawRendererV2(), and onCacheImageDelete().
int QgsVectorLayer::mCurrentVertexMarkerSize [private] |
The current size of editing marker.
Definition at line 1511 of file qgsvectorlayer.h.
The current type of editing marker.
Definition at line 1508 of file qgsvectorlayer.h.
Pointer to data provider derived from the abastract base class QgsDataProvider.
Definition at line 1447 of file qgsvectorlayer.h.
Referenced by addAttribute(), addFeature(), addFeatures(), addPart(), addRing(), addTopologicalPoints(), boundingBoxOfSelected(), capabilitiesString(), changeAttributeValue(), changeGeometry(), commitChanges(), countSymbolFeatures(), dataComment(), dataProvider(), deleteAttribute(), deleteSelectedFeatures(), deleteVertex(), extent(), featureCount(), geometryType(), getFeatures(), insertVertex(), isEditable(), maximumValue(), minimumValue(), moveVertex(), pendingFeatureCount(), pendingPkAttributesList(), readXml(), reload(), setCoordinateSystem(), setDataProvider(), setProviderEncoding(), setSubsetString(), snapWithContext(), splitFeatures(), startEditing(), storageType(), subsetString(), translateFeature(), uniqueValues(), updateFields(), writeXml(), and ~QgsVectorLayer().
QMap< QString, QString> QgsVectorLayer::mDateFormats [private] |
Definition at line 1527 of file qgsvectorlayer.h.
Referenced by dateFormat(), readSymbology(), and writeSymbology().
Definition at line 1551 of file qgsvectorlayer.h.
Referenced by prepareLabelingAndDiagrams(), readSymbology(), setDiagramLayerSettings(), writeSymbology(), and ~QgsVectorLayer().
Definition at line 1548 of file qgsvectorlayer.h.
Referenced by drawRendererV2(), drawRendererV2Levels(), prepareLabelingAndDiagrams(), readSymbology(), setDiagramRenderer(), and writeSymbology().
QString QgsVectorLayer::mDisplayExpression [private] |
the preview expression used to generate a human readable preview string for features
Definition at line 1455 of file qgsvectorlayer.h.
Referenced by displayExpression(), readXml(), setDisplayExpression(), and writeXml().
QString QgsVectorLayer::mDisplayField [private] |
index of the primary label field
Definition at line 1452 of file qgsvectorlayer.h.
Referenced by displayField(), and setDisplayField().
stores information about uncommitted changes to layer
Definition at line 1541 of file qgsvectorlayer.h.
Referenced by addAttribute(), addFeature(), addFeatures(), addPart(), addRing(), addTopologicalPoints(), changeAttributeValue(), changeGeometry(), commitChanges(), deleteAttribute(), deleteFeature(), deleteVertex(), draw(), drawRendererV2(), drawRendererV2Levels(), extent(), insertVertex(), isEditable(), isModified(), maximumValue(), minimumValue(), moveVertex(), pendingFeatureCount(), rollBack(), setReadOnly(), splitFeatures(), startEditing(), translateFeature(), uniqueValues(), updateFields(), and ~QgsVectorLayer().
QString QgsVectorLayer::mEditForm [private] |
Definition at line 1533 of file qgsvectorlayer.h.
Referenced by editForm(), readSymbology(), setEditForm(), and writeSymbology().
QString QgsVectorLayer::mEditFormInit [private] |
Definition at line 1533 of file qgsvectorlayer.h.
Referenced by editFormInit(), readSymbology(), setEditFormInit(), and writeSymbology().
EditorLayout QgsVectorLayer::mEditorLayout [private] |
Defines the default layout to use for the attribute editor (Drag and drop, UI File, Generated)
Definition at line 1531 of file qgsvectorlayer.h.
Referenced by editorLayout(), readSymbology(), setEditorLayout(), and writeSymbology().
QMap< QString, EditType > QgsVectorLayer::mEditTypes [private] |
Definition at line 1521 of file qgsvectorlayer.h.
Referenced by editType(), readSymbology(), setEditType(), and writeSymbology().
bool QgsVectorLayer::mEnableBackbuffer [private] |
Enables backbuffering for the map window.
This improves graphics performance, but the possibility to cancel rendering and incremental feature drawing will be lost.
Definition at line 1444 of file qgsvectorlayer.h.
Referenced by draw(), and drawRendererV2().
QSet<QString> QgsVectorLayer::mExcludeAttributesWFS [private] |
Attributes which are not published in WFS.
Definition at line 1484 of file qgsvectorlayer.h.
Referenced by readSymbology(), and writeSymbology().
QSet<QString> QgsVectorLayer::mExcludeAttributesWMS [private] |
Attributes which are not published in WMS.
Definition at line 1482 of file qgsvectorlayer.h.
Referenced by readSymbology(), and writeSymbology().
QPainter::CompositionMode QgsVectorLayer::mFeatureBlendMode [private] |
Blend mode for features.
Definition at line 1502 of file qgsvectorlayer.h.
Referenced by featureBlendMode(), and setFeatureBlendMode().
QMap< QString, bool> QgsVectorLayer::mFieldEditables [private] |
Definition at line 1522 of file qgsvectorlayer.h.
Referenced by fieldEditable(), readSymbology(), setFieldEditable(), and writeSymbology().
Definition at line 1545 of file qgsvectorlayer.h.
Referenced by addJoin(), createJoinCaches(), maximumValue(), minimumValue(), QgsVectorLayerFeatureIterator::prepareJoins(), QgsVectorLayer(), QgsVectorLayerFeatureIterator::QgsVectorLayerFeatureIterator(), readXml(), removeJoin(), uniqueValues(), updateFields(), vectorJoins(), writeXml(), and ~QgsVectorLayer().
QgsLabel* QgsVectorLayer::mLabel [private] |
Label.
Definition at line 1496 of file qgsvectorlayer.h.
Referenced by drawLabels(), label(), readSymbology(), setDataProvider(), writeSymbology(), and ~QgsVectorLayer().
bool QgsVectorLayer::mLabelOn [private] |
Display labels.
Definition at line 1499 of file qgsvectorlayer.h.
Referenced by drawLabels(), enableLabels(), hasLabelsEnabled(), and setDataProvider().
int QgsVectorLayer::mLayerTransparency [private] |
Layer transparency.
Definition at line 1505 of file qgsvectorlayer.h.
Referenced by layerTransparency(), and setLayerTransparency().
QList<QgsVectorOverlay*> QgsVectorLayer::mOverlays [private] |
List of overlays.
Vector overlays will be rendered on top of all maplayers
Definition at line 1517 of file qgsvectorlayer.h.
Referenced by addOverlay(), findOverlayByType(), removeOverlay(), vectorOverlays(), writeSymbology(), and ~QgsVectorLayer().
Definition at line 1449 of file qgsvectorlayer.h.
QString QgsVectorLayer::mProviderKey [private] |
Data provider key.
Definition at line 1458 of file qgsvectorlayer.h.
Referenced by getStyleFromDatabase(), listStylesInDatabase(), loadNamedStyle(), providerType(), QgsVectorLayer(), readXml(), saveStyleToDatabase(), and setDataProvider().
QMap< QString, RangeData > QgsVectorLayer::mRanges [private] |
Definition at line 1524 of file qgsvectorlayer.h.
Referenced by range(), readSymbology(), and writeSymbology().
bool QgsVectorLayer::mReadOnly [private] |
Flag indicating whether the layer is in read-only mode (editing disabled) or not.
Definition at line 1464 of file qgsvectorlayer.h.
Referenced by isReadOnly(), setReadOnly(), and startEditing().
QgsFeatureRendererV2* QgsVectorLayer::mRendererV2 [private] |
Renderer object which holds the information about how to display the features.
Definition at line 1493 of file qgsvectorlayer.h.
Referenced by countSymbolFeatures(), draw(), drawLabels(), drawRendererV2(), drawRendererV2Levels(), rendererV2(), setRendererV2(), stopRendererV2(), writeSld(), and writeSymbology().
Set holding the feature IDs that are activated.
Note that if a feature subsequently gets deleted (i.e. by its addition to mDeletedFeatureIds), it always needs to be removed from mSelectedFeatureIds as well.
Definition at line 1470 of file qgsvectorlayer.h.
Referenced by addPart(), boundingBoxOfSelected(), deleteFeature(), deleteSelectedFeatures(), deselect(), drawLabels(), drawRendererV2(), drawRendererV2Levels(), invertSelection(), invertSelectionInRectangle(), modifySelection(), removeSelection(), select(), selectedFeatureCount(), selectedFeatures(), selectedFeaturesIds(), and setSelectedFeatures().
bool QgsVectorLayer::mSymbolFeatureCounted [private] |
Definition at line 1556 of file qgsvectorlayer.h.
Referenced by countSymbolFeatures(), featureCount(), and setRendererV2().
QMap<QgsSymbolV2*, long> QgsVectorLayer::mSymbolFeatureCountMap [private] |
Definition at line 1559 of file qgsvectorlayer.h.
Referenced by countSymbolFeatures(), featureCount(), and setRendererV2().
QList< TabData > QgsVectorLayer::mTabs [private] |
Map that stores the tab for attributes in the edit form.
Key is the tab order and value the tab name
Definition at line 1487 of file qgsvectorlayer.h.
QgsFields QgsVectorLayer::mUpdatedFields [private] |
field map to commit
Definition at line 1473 of file qgsvectorlayer.h.
Referenced by maximumValue(), minimumValue(), QgsVectorLayerFeatureIterator::nextFeature(), pendingAllAttributesList(), pendingFields(), pendingPkAttributesList(), uniqueValues(), updateFields(), QgsVectorLayerFeatureIterator::useAddedFeature(), and QgsVectorLayerFeatureIterator::useChangedAttributeFeature().
int QgsVectorLayer::mUpdateThreshold [private] |
Update threshold for drawing features as they are read.
A value of zero indicates that no features will be drawn until all have been read
Definition at line 1438 of file qgsvectorlayer.h.
Referenced by draw(), and drawRendererV2().
bool QgsVectorLayer::mValidExtent [private] |
Definition at line 1553 of file qgsvectorlayer.h.
Referenced by extent(), setExtent(), and updateExtents().
QMap< QString, QMap<QString, QVariant> > QgsVectorLayer::mValueMaps [private] |
Definition at line 1523 of file qgsvectorlayer.h.
Referenced by readSymbology(), valueMap(), and writeSymbology().
QMap< QString, ValueRelationData > QgsVectorLayer::mValueRelations [private] |
Definition at line 1526 of file qgsvectorlayer.h.
Referenced by readSymbology(), valueRelation(), and writeSymbology().
bool QgsVectorLayer::mVertexMarkerOnlyForSelection [private] |
Flag if the vertex markers should be drawn only for selection (true) or for all features (false)
Definition at line 1514 of file qgsvectorlayer.h.
QMap< QString, QSize> QgsVectorLayer::mWidgetSize [private] |
Definition at line 1528 of file qgsvectorlayer.h.
Referenced by readSymbology(), widgetSize(), and writeSymbology().
int QgsVectorLayer::mWkbType [private] |
Geometry type as defined in enum WkbType (qgis.h)
Definition at line 1490 of file qgsvectorlayer.h.
Referenced by setDataProvider(), and wkbType().