Skip to content

Commit

Permalink
move remaining function_help to json and update it's translation hand…
Browse files Browse the repository at this point in the history
…ling
  • Loading branch information
jef-n committed Sep 20, 2015
1 parent 2affb27 commit 82b34af
Show file tree
Hide file tree
Showing 237 changed files with 1,186 additions and 839 deletions.
Expand Up @@ -129,7 +129,7 @@ def featureOmbb(self, layer, writer, progress):
height])
writer.addFeature(outFeat)
else:
progress.setInfo(self.tr("Can't calculate an OMBB for features n°") + str(inFeat.id()) + ".")
progress.setInfo(self.tr("Can't calculate an OMBB for feature {0}.").format(inFeat.id()))
current += 1
progress.setPercentage(int(current * total))

Expand Down
1 change: 0 additions & 1 deletion resources/CMakeLists.txt
Expand Up @@ -4,4 +4,3 @@ INSTALL(DIRECTORY cpt-city-qgis-min DESTINATION ${QGIS_DATA_DIR}/resources)
INSTALL(DIRECTORY themes DESTINATION ${QGIS_DATA_DIR}/resources)

ADD_SUBDIRECTORY(context_help)
ADD_SUBDIRECTORY(function_help)
32 changes: 0 additions & 32 deletions resources/function_help/CMakeLists.txt

This file was deleted.

3 changes: 2 additions & 1 deletion resources/function_help/json/$area
@@ -1,5 +1,6 @@
{
"function": "$area",
"name": "$area",
"type": "function",
"description": "Returns the area of the current feature.",
"examples": [ { "expression":"$area", "returns":"42"}]
}
3 changes: 2 additions & 1 deletion resources/function_help/json/$atlasfeature
@@ -1,5 +1,6 @@
{
"function": "$atlasfeature",
"name": "$atlasfeature",
"type": "function",
"description": "In atlas generation, returns the current feature that is iterated over on the coverage layer. This can be used with the 'attribute' function to return attribute values from the current atlas feature.",
"examples": [ { "expression":"attribute( $atlasfeature, 'name' )", "returns":"value stored in 'name' attribute for the current atlas feature"}]
}
Expand Down
3 changes: 2 additions & 1 deletion resources/function_help/json/$atlasfeatureid
@@ -1,5 +1,6 @@
{
"function": "$atlasfeatureid",
"name": "$atlasfeatureid",
"type": "function",
"description": "Returns the feature id of the current row while using atlas. This enables you to use features of atlas in rules and for example show or hide features based on their id.",
"examples": [ { "expression":"$atlasfeatureid = $id", "returns":"true"}]
}
Expand Down
3 changes: 2 additions & 1 deletion resources/function_help/json/$atlasgeometry
@@ -1,5 +1,6 @@
{
"function": "$atlasgeometry",
"name": "$atlasgeometry",
"type": "function",
"description": "Returns the geometry of the current feature iterated in atlas. Can be used for rule based display of geometry when using atlas. For example to only show geometries of other layers when their geometry intersects the iterated geometry of features using atlas.",
"examples": [ { "expression":"intersects( $atlasgeometry, $geometry )", "returns":"true"}]
}
Expand Down
8 changes: 8 additions & 0 deletions resources/function_help/json/$currentfeature
@@ -0,0 +1,8 @@
{
"name": "$currentfeature",
"type": "function",
"description": "Returns the current feature being evaluated. This can be used with the 'attribute' function to evaluate attribute values from the current feature.",
"examples": [
{ "expression":"attribute( $currentfeature, 'name' )", "returns":"value stored in 'name' attribute for the current feature"}
]
}
7 changes: 7 additions & 0 deletions resources/function_help/json/$feature
@@ -0,0 +1,7 @@
{
"name": "$feature",
"type": "function",
"description": "In atlas generation, returns the current feature number that is iterated over on the coverage layer.",
"examples": [ { "expression":"$feature", "returns":"2"}
]
}
7 changes: 7 additions & 0 deletions resources/function_help/json/$geometry
@@ -0,0 +1,7 @@
{
"name": "$geometry",
"type": "function",
"description": "Returns the geometry of the current feature. Can be used for processing with other functions.",
"examples": [ { "expression":"geomToWKT( $geometry )", "returns":"POINT(6 50)"}
]
}
7 changes: 7 additions & 0 deletions resources/function_help/json/$id
@@ -0,0 +1,7 @@
{
"name": "$id",
"type": "function",
"description": "Returns the feature id of the current row.",
"examples": [ { "expression":"$id", "returns":"42"}
]
}
7 changes: 5 additions & 2 deletions resources/function_help/json/$length
@@ -1,5 +1,8 @@
{
"function": "$length",
"name": "$length",
"type": "function",
"description": "Returns the length of a linestring. If you need the length of a border of a polygon, use $perimeter instead.",
"examples": [ { "expression":"$length", "returns":"42"}]
"examples": [
{ "expression":"$length", "returns":"42.4711"}
]
}
9 changes: 9 additions & 0 deletions resources/function_help/json/$map
@@ -0,0 +1,9 @@
{
"name": "$map",
"type": "function",
"description": "Returns the id of the current map item if the map is being drawn in a composition, or \"canvas\" if the map is being drawn within the main QGIS window.",
"examples": [
{ "expression": "$map", "returns": "\"overview_map\"", "description": "within a composer item"},
{ "expression": "$map", "returns": "\"canvas\"", "description": "within the main QGIS main canvas"}
]
}
8 changes: 8 additions & 0 deletions resources/function_help/json/$numfeatures
@@ -0,0 +1,8 @@
{
"name": "$numfeatures",
"type": "function",
"description": "In atlas generation, returns the total number of features within the coverage layer.",
"examples": [
{ "expression":"$numfeatures", "returns":"42"}
]
}
7 changes: 7 additions & 0 deletions resources/function_help/json/$numpages
@@ -0,0 +1,7 @@
{
"name": "$numpages",
"type": "function",
"description": "Returns the total number of pages in the composition.",
"examples": [ { "expression":"$numpages", "returns":"42"}
]
}
7 changes: 7 additions & 0 deletions resources/function_help/json/$page
@@ -0,0 +1,7 @@
{
"name": "$page",
"type": "function",
"description": "Returns the current page number within a composition.",
"examples": [ { "expression":"$page", "returns":"2"}
]
}
7 changes: 7 additions & 0 deletions resources/function_help/json/$perimeter
@@ -0,0 +1,7 @@
{
"name": "$perimeter",
"type": "function",
"description": "Returns the perimeter length of the current feature.",
"examples": [ { "expression":"$perimeter", "returns":"42"}
]
}
7 changes: 7 additions & 0 deletions resources/function_help/json/$rownum
@@ -0,0 +1,7 @@
{
"name": "$rownum",
"type": "function",
"description": "Returns the number of the current row.",
"examples": [ { "expression":"$rownum", "returns":"4711"}
]
}
8 changes: 8 additions & 0 deletions resources/function_help/json/$scale
@@ -0,0 +1,8 @@
{
"name": "$scale",
"type": "function",
"description": "Returns the current scale of the map canvas.\\n\\nNote: This function is only available in some contexts and will be 0 otherwise.",
"examples": [
{ "expression":"$scale", "returns":"10000"}
]
}
7 changes: 7 additions & 0 deletions resources/function_help/json/$x
@@ -0,0 +1,7 @@
{
"name": "$x",
"type": "function",
"description": "Returns the x coordinate of the current feature.",
"examples": [ { "expression":"$x", "returns":"42"}
]
}
3 changes: 2 additions & 1 deletion resources/function_help/json/$x_at
@@ -1,5 +1,6 @@
{
"function": "$x_at",
"name": "$x_at",
"type": "function",
"description": "Retrieves a x coordinate of the current feature's geometry.",
"arguments": [ {"arg":"i","description":"index of point of a line (indices start at 0; negative values apply from the last index)"}],
"examples": [ { "expression":"$x_at(1)", "returns":"5"}
Expand Down
7 changes: 7 additions & 0 deletions resources/function_help/json/$y
@@ -0,0 +1,7 @@
{
"name": "$y",
"type": "function",
"description": "Returns the y coordinate of the current feature.",
"examples": [ { "expression":"$y", "returns":"42"}
]
}
3 changes: 2 additions & 1 deletion resources/function_help/json/$y_at
@@ -1,5 +1,6 @@
{
"function": "$y_at",
"name": "$y_at",
"type": "function",
"description": "Retrieves a y coordinate of the current feature's geometry.",
"arguments": [ {"arg":"i","description":"index of point of a line (indices start at 0; negative values apply from the last index)"}],
"examples": [ { "expression":"$y_at(1)", "returns":"2"}
Expand Down
15 changes: 15 additions & 0 deletions resources/function_help/json/AND
@@ -0,0 +1,15 @@
{
"name": "AND",
"type": "operator",
"description": "Returns 1 when condition a and b are true.",
"arguments": [
{ "arg": "a", "description": "condition" },
{ "arg": "b", "description": "condition" }
],
"examples": [
{ "expression":"TRUE AND TRUE", "returns":"1"},
{ "expression":"TRUE AND FALSE", "returns":"0"},
{ "expression":"4 = 2+2 AND 1 = 1", "returns":"1"},
{ "expression":"4 = 2+2 AND 1 = 2", "returns":"0"}
]
}
5 changes: 5 additions & 0 deletions resources/function_help/json/CASE
@@ -0,0 +1,5 @@
{
"name": "CASE",
"type": "expression",
"description": "<pre>\\nCASE\\nWHEN <i>condition</i> THEN <i>result</i>\\n[ ...n ]\\n[ ELSE <i>result</i> ]\\nEND\\n</pre>\\n[ ] marks optional components\\n\\n<h4>Arguments</h4>\\n <i> WHEN condition</i> - The condition expression to evaluate. <br>\\n<i> THEN result</i> - If <i>condition</i> evaluates to True then <i>result</i> is evaluated and returned. <br>\\n<i> ELSE result</i> - If none of the above conditions evaluated to True then <i>result</i> is evaluated and returned. <br>\\n\\n<h4>Example</h4>\\n<pre>\\nCASE\\nWHEN <i>\"column\" IS NULL</i> THEN <i>'None'</i>\\n END\\n</pre>\\n"
}
5 changes: 5 additions & 0 deletions resources/function_help/json/Color
@@ -0,0 +1,5 @@
{
"name": "Color",
"type": "group",
"description": "This group contains functions for manipulating colors"
}
5 changes: 5 additions & 0 deletions resources/function_help/json/Conditionals
@@ -0,0 +1,5 @@
{
"name": "Conditionals",
"type": "group",
"description": "This group contains functions to handle conditional checks in expressions."
}
5 changes: 5 additions & 0 deletions resources/function_help/json/Conditions
@@ -0,0 +1,5 @@
{
"name": "Conditions",
"type": "group",
"description": "This group contains functions that operate on condition."
}
5 changes: 5 additions & 0 deletions resources/function_help/json/Conversions
@@ -0,0 +1,5 @@
{
"name": "Conversions",
"type": "group",
"description": "This group contains functions to convert on data type to another e.g string to integer, integer to string."
}
5 changes: 5 additions & 0 deletions resources/function_help/json/Custom
@@ -0,0 +1,5 @@
{
"name": "Custom",
"type": "group",
"description": "This group contains custom user-created Python functions."
}
5 changes: 5 additions & 0 deletions resources/function_help/json/Date and Time
@@ -0,0 +1,5 @@
{
"name": "Date and Time",
"type": "group",
"description": "This group contains functions for handling date and time data."
}
6 changes: 6 additions & 0 deletions resources/function_help/json/Field
@@ -0,0 +1,6 @@
{
"name": "Field",
"type": "group",
"description": "Double click to add field name to expression string.\\nRight-Click on field name to open context menu sample value loading options.",
"notes": "Loading field values from WFS layers isn't supported, before the layer is actually inserted, ie. when building queries."
}
6 changes: 6 additions & 0 deletions resources/function_help/json/Fields and Values
@@ -0,0 +1,6 @@
{
"name": "Fields and Values",
"type": "group",
"description": "Contains a list of fields from the layer. Sample values can also be accessed via right-click.\\nSelect the field name from the list then right-click to access context menu with options to load sample values from the selected field.\\n",
"notes": "Loading field values from WFS layers isn't supported, before the layer is actually inserted, ie. when building queries."
}
5 changes: 5 additions & 0 deletions resources/function_help/json/Fuzzy Matching
@@ -0,0 +1,5 @@
{
"name": "Fuzzy Matching",
"type": "group",
"description": "This group contains functions for fuzzy comparisons between values."
}
5 changes: 5 additions & 0 deletions resources/function_help/json/General
@@ -0,0 +1,5 @@
{
"name": "General",
"type": "group",
"description": "This group contains general assorted functions."
}
5 changes: 5 additions & 0 deletions resources/function_help/json/GeometryGroup
@@ -0,0 +1,5 @@
{
"name": "GeometryGroup",
"type": "group",
"description": "This group contains functions that operate on geometry objects e.g length, area."
}
18 changes: 18 additions & 0 deletions resources/function_help/json/ILIKE
@@ -0,0 +1,18 @@
{
"name": "ILIKE",
"type": "operator",
"description": "Returns 1 if the first parameter matches case-insensitive the supplied pattern. LIKE can be used instead of ILIKE to make the match case-sensitive. Works with numbers also.",
"arguments": [
{"arg":"string/number","description":"string to search"},
{"arg":"pattern","description":"pattern to find"}
],
"examples": [
{ "expression":"'A' ILIKE 'A'", "returns":"1"},
{ "expression":"'A' ILIKE 'a'", "returns":"1"},
{ "expression":"'A' ILIKE 'B'", "returns":"0"},
{ "expression":"'ABC' ILIKE 'b'", "returns":"0"},
{ "expression":"'ABC' ILIKE 'B'", "returns":"0"},
{ "expression":"'ABC' ILIKE '%b%'", "returns":"1"},
{ "expression":"'ABC' ILIKE '%B%'", "returns":"1"}
]
}
13 changes: 13 additions & 0 deletions resources/function_help/json/IN
@@ -0,0 +1,13 @@
{
"name": "IN",
"type": "operator",
"description": "Returns 1 if value is found within a list of values.",
"arguments": [
{"arg":"a","description":"value"},
{"arg":"b","description":"list of values"}
],
"examples": [
{ "expression":"'A' IN ('A','B')", "returns":"1"},
{ "expression":"'A' IN ('C','B')", "returns":"0"}
]
}
17 changes: 17 additions & 0 deletions resources/function_help/json/IS
@@ -0,0 +1,17 @@
{
"name": "IS",
"type": "operator",
"description": "Returns 1 if a is the same as b.",
"arguments": [
{"arg":"a","description":"any value"},
{"arg":"b","description":"any value"}
],
"examples": [
{ "expression":"'A' IS 'A'", "returns":"1"},
{ "expression":"'A' IS 'a'", "returns":"0"},
{ "expression":"4 IS 4", "returns":"1"},
{ "expression":"4 IS 2+2", "returns":"1"},
{ "expression":"4 IS 2", "returns":"0"},
{ "expression":"$geometry IS NULL", "returns":"0, if your geometry is not NULL"}
]
}
14 changes: 14 additions & 0 deletions resources/function_help/json/IS NOT
@@ -0,0 +1,14 @@
{
"name": "IS NOT",
"type": "operator",
"description": "Returns 1 if a is not the same as b.",
"arguments": [
{"arg":"a","description":"value"},
{"arg":"b","description":"value"}
],
"examples": [
{ "expression":"'a' IS NOT 'b'", "returns":"1"},
{ "expression":"'a' IS NOT 'a'", "returns":"0"},
{ "expression":"4 IS NOT 2+2", "returns":"0"}
]
}
16 changes: 16 additions & 0 deletions resources/function_help/json/LIKE
@@ -0,0 +1,16 @@
{
"name": "LIKE",
"type": "operator",
"description": "Returns 1 if the first parameter matches the supplied pattern. Works with numbers also.",
"arguments": [
{"arg":"string/number","description":"value"},
{"arg":"pattern","description":"pattern to compare value with"}
],
"examples": [
{ "expression":"'A' LIKE 'A'", "returns":"1"},
{ "expression":"'A' LIKE 'a'", "returns":"0"},
{ "expression":"'A' LIKE 'B'", "returns":"0"},
{ "expression":"'ABC' LIKE 'B'", "returns":"0"},
{ "expression":"'ABC' LIKE '%B%'", "returns":"1"}
]
}
5 changes: 5 additions & 0 deletions resources/function_help/json/Math
@@ -0,0 +1,5 @@
{
"name": "Math",
"type": "group",
"description": "This group contains math functions e.g square root, sin and cos"
}

1 comment on commit 82b34af

@m-kuhn
Copy link
Member

@m-kuhn m-kuhn commented on 82b34af Sep 20, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job 👍

Please sign in to comment.