Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Remove a bunch of layer variables, replace with new layer_property
function layer_property takes a layer name/id and a property (eg 'crs') and returns the matching value. This approach is more flexible than having all these values as variables, since it allows retrieval of properties of a layer from contexts which aren't layer-aware (eg a composer label showing the metadata of a layer).
- Loading branch information
1 parent
9f3e229
commit 7871d6c
Showing
5 changed files
with
176 additions
and
43 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,2 @@ | ||
<h3>General</h3> | ||
This group contains general assorted functions. |
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,34 @@ | ||
<h3>layer_property function</h3> | ||
Returns a matching layer property or metadata value. | ||
|
||
<h4>Syntax</h4> | ||
<pre>layer_property(layer,property)</pre> | ||
|
||
<h4>Arguments</h4> | ||
layer → a string, representing either a layer name or layer ID<br /> | ||
property → a string corresponding to the property to return. Valid options are:<br /> | ||
<ul> | ||
<li>name: layer name</li> | ||
<li>id: layer ID</li> | ||
<li>title: metadata title string</li> | ||
<li>abstract: metadata abstract string</li> | ||
<li>keywords: metadata keywords</li> | ||
<li>data_url: metadata URL</li> | ||
<li>attribution: metadata attribution string</li> | ||
<li>attribution_url: metadata attribution URL</li> | ||
<li>source: layer source</li> | ||
<li>min_scale: minimum display scale for layer</li> | ||
<li>max_scale: maximum display scale for layer</li> | ||
<li>crs: layer CRS</li> | ||
<li>crs_definition: layer CRS full definition</li> | ||
<li>extent: layer extent (as a geometry object)</li> | ||
<li>type: layer type, eg Vector or Raster</li> | ||
<li>storage_type: storage format (vector layers only)</li> | ||
<li>geometry_type: geometry type, eg Point (vector layers only)</li> | ||
<li>feature_count: approximate feature count for layer (vector layers only)</li> | ||
</ul> | ||
<h4>Example</h4> | ||
<pre> layer_property('streets','title') → 'Basemap Streets'</pre><br /> | ||
<pre> layer_property('airports','feature_count') → 120</pre><br /> | ||
<pre> layer_property('landsat','crs') →'EPSG:4326'</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
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