-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] Add get and transform geometry in Expression
In version 2.6, new keywords has been added to Expression : * $currentfeature - returns the current feature * $atlasfeature - returns the atlas feature * getFeature - gets a matching feature from a layer But I think, Expression lacks a few keywords : * geometry - returns the feature's geometry * transform - returns the transformed geometry These new keywords can be used with getFeature for some geometry tests like intersects, crosses, contains, etc Tests has been added to geometry and transform in Expression
- Loading branch information
Showing
4 changed files
with
154 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<h3>getGeometry function</h3> | ||
Returns the feature's geometry | ||
|
||
<h4>Syntax</h4> | ||
<pre>geometry( f )</pre> | ||
|
||
<h4>Arguments</h4> | ||
f → QgsFeature | ||
|
||
<h4>Example</h4> | ||
<pre> geomToWKT( geometry( getFeature( layer, attributeField, value ) ) ) → POINT(6 50)</pre> | ||
<pre> intersects( $geometry, geometry( getFeature( layer, attributeField, value ) ) ) → 1</pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<h3>transformGeometry function</h3> | ||
Returns the geometry transforms from the source CRS to the dest CRS. | ||
|
||
<h4>Syntax</h4> | ||
<pre>transform( geom, sAuthId, dAuthId )</pre> | ||
|
||
<h4>Arguments</h4> | ||
geom → QgsGeometry | ||
|
||
sCrsId → the Source Auth CRS Id | ||
|
||
dCrsId → the Dest Auth CRS Id | ||
|
||
<h4>Example</h4> | ||
<pre> geomToWKT( transform( $geometry, 'EPSG:2154', 'EPSG:4326' ) ) → POINT(0 51)</pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters