mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-15 00:04:00 -04:00
Added missing python bindings for table joins
git-svn-id: http://svn.osgeo.org/qgis/trunk@15327 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
82dda642ec
commit
9ff2f5793b
@ -4,6 +4,27 @@ typedef QSet<int> QgsFeatureIds;
|
|||||||
typedef QSet<int> QgsAttributeIds;
|
typedef QSet<int> QgsAttributeIds;
|
||||||
|
|
||||||
|
|
||||||
|
/** @note added in 1.7 */
|
||||||
|
struct QgsVectorJoinInfo
|
||||||
|
{
|
||||||
|
%TypeHeaderCode
|
||||||
|
#include "qgsvectorlayer.h"
|
||||||
|
%End
|
||||||
|
|
||||||
|
/**Join field in the target layer*/
|
||||||
|
int targetField;
|
||||||
|
/**Source layer*/
|
||||||
|
QString joinLayerId;
|
||||||
|
/**Join field in the source layer*/
|
||||||
|
int joinField;
|
||||||
|
/**True if the join is cached in virtual memory*/
|
||||||
|
bool memoryCache;
|
||||||
|
/**Cache for joined attributes to provide fast lookup (size is 0 if no memory caching)*/
|
||||||
|
// TODO: needs conversion
|
||||||
|
// QHash< QString, QgsAttributeMap> cachedAttributes;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
class QgsVectorLayer : QgsMapLayer
|
class QgsVectorLayer : QgsMapLayer
|
||||||
{
|
{
|
||||||
%TypeHeaderCode
|
%TypeHeaderCode
|
||||||
@ -88,6 +109,19 @@ public:
|
|||||||
/** Setup the coordinate system tranformation for the layer */
|
/** Setup the coordinate system tranformation for the layer */
|
||||||
void setCoordinateSystem();
|
void setCoordinateSystem();
|
||||||
|
|
||||||
|
/** Joins another vector layer to this layer
|
||||||
|
@param joinInfo join object containing join layer id, target and source field
|
||||||
|
@param cacheInMemory if true: caches the content of the join layer in virtual memory
|
||||||
|
@note added in 1.7 */
|
||||||
|
void addJoin( QgsVectorJoinInfo joinInfo );
|
||||||
|
|
||||||
|
/** Removes a vector layer join
|
||||||
|
@note added in 1.7 */
|
||||||
|
void removeJoin( const QString& joinLayerId );
|
||||||
|
|
||||||
|
/** @note added in 1.7 */
|
||||||
|
const QList< QgsVectorJoinInfo >& vectorJoins() const;
|
||||||
|
|
||||||
QgsLabel *label();
|
QgsLabel *label();
|
||||||
|
|
||||||
QgsAttributeAction *actions();
|
QgsAttributeAction *actions();
|
||||||
@ -549,12 +583,20 @@ public:
|
|||||||
@note public and static from version 1.4 */
|
@note public and static from version 1.4 */
|
||||||
static void drawVertexMarker( double x, double y, QPainter& p, QgsVectorLayer::VertexMarkerType type, int vertexSize );
|
static void drawVertexMarker( double x, double y, QPainter& p, QgsVectorLayer::VertexMarkerType type, int vertexSize );
|
||||||
|
|
||||||
|
/** Assembles mUpdatedFields considering provider fields, joined fields and added fields
|
||||||
|
@note added in 1.7 */
|
||||||
|
void updateFieldMap();
|
||||||
|
|
||||||
|
/** Caches joined attributes if required (and not already done)
|
||||||
|
@note added in 1.7 */
|
||||||
|
void createJoinCaches();
|
||||||
|
|
||||||
/**Returns unique values for column
|
/**Returns unique values for column
|
||||||
@param index column index for attribute
|
@param index column index for attribute
|
||||||
@param uniqueValues out: result list
|
@param uniqueValues out: result list
|
||||||
@limit maximum number of values to return (-1 if unlimited)
|
@limit maximum number of values to return (-1 if unlimited)
|
||||||
@note: this method was added in version 1.7*/
|
@note: this method was added in version 1.7*/
|
||||||
void uniqueValues( int index, QList<QVariant>& uniqueValues, int limit );
|
void uniqueValues( int index, QList<QVariant>& uniqueValues /Out/, int limit );
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
||||||
@ -574,6 +616,10 @@ public slots:
|
|||||||
*/
|
*/
|
||||||
virtual void updateExtents();
|
virtual void updateExtents();
|
||||||
|
|
||||||
|
/** Check if there is a join with a layer that will be removed
|
||||||
|
@note added in 1.7 */
|
||||||
|
void checkJoinLayerRemove( QString theLayerId );
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
/** This signal is emited when selection was changed */
|
/** This signal is emited when selection was changed */
|
||||||
|
@ -55,6 +55,7 @@ typedef QList<int> QgsAttributeList;
|
|||||||
typedef QSet<int> QgsFeatureIds;
|
typedef QSet<int> QgsFeatureIds;
|
||||||
typedef QSet<int> QgsAttributeIds;
|
typedef QSet<int> QgsAttributeIds;
|
||||||
|
|
||||||
|
/** @note added in 1.7 */
|
||||||
struct CORE_EXPORT QgsVectorJoinInfo
|
struct CORE_EXPORT QgsVectorJoinInfo
|
||||||
{
|
{
|
||||||
/**Join field in the target layer*/
|
/**Join field in the target layer*/
|
||||||
@ -69,8 +70,10 @@ struct CORE_EXPORT QgsVectorJoinInfo
|
|||||||
QHash< QString, QgsAttributeMap> cachedAttributes;
|
QHash< QString, QgsAttributeMap> cachedAttributes;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**Join information prepared for fast attribute id mapping in QgsVectorLayerJoinBuffer::updateFeatureAttributes().
|
/** Join information prepared for fast attribute id mapping in QgsVectorLayerJoinBuffer::updateFeatureAttributes().
|
||||||
Created in the select() method of QgsVectorLayerJoinBuffer for the joins that contain fetched attributes*/
|
Created in the select() method of QgsVectorLayerJoinBuffer for the joins that contain fetched attributes
|
||||||
|
@note added in 1.7
|
||||||
|
*/
|
||||||
struct CORE_EXPORT QgsFetchJoinInfo
|
struct CORE_EXPORT QgsFetchJoinInfo
|
||||||
{
|
{
|
||||||
const QgsVectorJoinInfo* joinInfo;
|
const QgsVectorJoinInfo* joinInfo;
|
||||||
@ -150,14 +153,17 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
|
|||||||
/** Setup the coordinate system tranformation for the layer */
|
/** Setup the coordinate system tranformation for the layer */
|
||||||
void setCoordinateSystem();
|
void setCoordinateSystem();
|
||||||
|
|
||||||
/**Joins another vector layer to this layer
|
/** Joins another vector layer to this layer
|
||||||
@param joinInfo join object containing join layer id, target and source field
|
@param joinInfo join object containing join layer id, target and source field
|
||||||
@param cacheInMemory if true: caches the content of the join layer in virtual memory*/
|
@param cacheInMemory if true: caches the content of the join layer in virtual memory
|
||||||
|
@note added in 1.7 */
|
||||||
void addJoin( QgsVectorJoinInfo joinInfo );
|
void addJoin( QgsVectorJoinInfo joinInfo );
|
||||||
|
|
||||||
/**Removes a vector layer join*/
|
/** Removes a vector layer join
|
||||||
|
@note added in 1.7 */
|
||||||
void removeJoin( const QString& joinLayerId );
|
void removeJoin( const QString& joinLayerId );
|
||||||
|
|
||||||
|
/** @note added in 1.7 */
|
||||||
const QList< QgsVectorJoinInfo >& vectorJoins() const;
|
const QList< QgsVectorJoinInfo >& vectorJoins() const;
|
||||||
|
|
||||||
/** Get the label object associated with this layer */
|
/** Get the label object associated with this layer */
|
||||||
@ -631,11 +637,12 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
|
|||||||
@note public and static from version 1.4 */
|
@note public and static from version 1.4 */
|
||||||
static void drawVertexMarker( double x, double y, QPainter& p, QgsVectorLayer::VertexMarkerType type, int vertexSize );
|
static void drawVertexMarker( double x, double y, QPainter& p, QgsVectorLayer::VertexMarkerType type, int vertexSize );
|
||||||
|
|
||||||
/**Assembles mUpdatedFields considering provider fields, joined fields and added fields
|
/** Assembles mUpdatedFields considering provider fields, joined fields and added fields
|
||||||
@note added in version 1.6*/
|
@note added in 1.7 */
|
||||||
void updateFieldMap();
|
void updateFieldMap();
|
||||||
|
|
||||||
/**Caches joined attributes if required (and not already done)*/
|
/** Caches joined attributes if required (and not already done)
|
||||||
|
@note added in 1.7 */
|
||||||
void createJoinCaches();
|
void createJoinCaches();
|
||||||
|
|
||||||
/**Returns unique values for column
|
/**Returns unique values for column
|
||||||
@ -663,7 +670,8 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
|
|||||||
*/
|
*/
|
||||||
virtual void updateExtents();
|
virtual void updateExtents();
|
||||||
|
|
||||||
/**Check if there is a join with a layer that will be removed*/
|
/** Check if there is a join with a layer that will be removed
|
||||||
|
@note added in 1.7 */
|
||||||
void checkJoinLayerRemove( QString theLayerId );
|
void checkJoinLayerRemove( QString theLayerId );
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user