Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feature][expressions] Add expressions for creating triangular/square…
…/curved waves along a geometry The new expression functions are: - triangular_wave: Constructs triangular waves along the boundary of a geometry. - square_wave: Constructs square/rectangular waves along the boundary of a geometry - wave: Constructs rounded (sine-like) waves along the boundary of a geometry - triangular_wave_randomized: Constructs randomized triangular waves along the boundary of a geometry - square_wave_randomized: Constructs randomized square/rectangular waves along the boundary of a geometry. - wave_randomized: Constructs randomized curved (sine-like) waves along the boundary of a geometry
- Loading branch information
1 parent
430c5b2
commit 9496367
Showing
8 changed files
with
280 additions
and
0 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,15 @@ | ||
{ | ||
"name": "square_wave", | ||
"type": "function", | ||
"groups": ["GeometryGroup"], | ||
"description": "Constructs square/rectangular waves along the boundary of a geometry.", | ||
"arguments": [ | ||
{"arg":"geometry","description":"a geometry"}, | ||
{"arg":"wavelength","description":"wavelength of square waveform"}, | ||
{"arg":"amplitude","description":"amplitude of square waveform"}, | ||
{"arg":"strict","optional": true, "default": false, "description":"By default the wavelength argument is treated as a \"maximum wavelength\", where the actual wavelength will be dynamically adjusted so that an exact number of square waves are created along the boundaries of the geometry. If the strict argument is set to true then the wavelength will be used exactly and an incomplete pattern may be used for the final waveform."} | ||
], | ||
"examples": [ | ||
{ "expression":"square_wave(geom_from_wkt('LineString(0 0, 10 0)'), 3, 1)", "returns":"Square waves with wavelength 3 and amplitude 1 along the linestring"} | ||
] | ||
} |
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,17 @@ | ||
{ | ||
"name": "square_wave_randomized", | ||
"type": "function", | ||
"groups": ["GeometryGroup"], | ||
"description": "Constructs randomized square/rectangular waves along the boundary of a geometry.", | ||
"arguments": [ | ||
{"arg":"geometry","description":"a geometry"}, | ||
{"arg":"min_wavelength","description":"minimum wavelength of waves"}, | ||
{"arg":"max_wavelength","description":"maximum wavelength of waves"}, | ||
{"arg":"min_amplitude","description":"minimum amplitude of waves"}, | ||
{"arg":"max_amplitude","description":"maximum amplitude of waves"}, | ||
{"arg":"seed","optional": true, "default": "0", "description":"specifies a random seed for generating waves. If the seed is 0, then a completely random set of waves will be generated."} | ||
], | ||
"examples": [ | ||
{ "expression":"square_wave_randomized(geom_from_wkt('LineString(0 0, 10 0)'), 2, 3, 0.1, 0.2)", "returns":"Randomly sized square waves with wavelengths between 2 and 3 and amplitudes between 0.1 and 0.2 along the linestring"} | ||
] | ||
} |
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 @@ | ||
{ | ||
"name": "triangular_wave", | ||
"type": "function", | ||
"groups": ["GeometryGroup"], | ||
"description": "Constructs triangular waves along the boundary of a geometry.", | ||
"arguments": [ | ||
{"arg":"geometry","description":"a geometry"}, | ||
{"arg":"wavelength","description":"wavelength of triangular waveform"}, | ||
{"arg":"amplitude","description":"amplitude of triangular waveform"}, | ||
{"arg":"strict","optional": true, "default": false, "description":"By default the wavelength argument is treated as a \"maximum wavelength\", where the actual wavelength will be dynamically adjusted so that an exact number of triangular waves are created along the boundaries of the geometry. If the strict argument is set to true then the wavelength will be used exactly and an incomplete pattern may be used for the final waveform."} | ||
], | ||
"examples": [ | ||
{ "expression":"triangular_wave(geom_from_wkt('LineString(0 0, 10 0)'), 3, 1)", "returns":"Triangular waves with wavelength 3 and amplitude 1 along the linestring"} | ||
] | ||
} |
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,17 @@ | ||
{ | ||
"name": "triangular_wave_randomized", | ||
"type": "function", | ||
"groups": ["GeometryGroup"], | ||
"description": "Constructs randomized triangular waves along the boundary of a geometry.", | ||
"arguments": [ | ||
{"arg":"geometry","description":"a geometry"}, | ||
{"arg":"min_wavelength","description":"minimum wavelength of waves"}, | ||
{"arg":"max_wavelength","description":"maximum wavelength of waves"}, | ||
{"arg":"min_amplitude","description":"minimum amplitude of waves"}, | ||
{"arg":"max_amplitude","description":"maximum amplitude of waves"}, | ||
{"arg":"seed","optional": true, "default": "0", "description":"specifies a random seed for generating waves. If the seed is 0, then a completely random set of waves will be generated."} | ||
], | ||
"examples": [ | ||
{ "expression":"triangular_wave_randomized(geom_from_wkt('LineString(0 0, 10 0)'), 2, 3, 0.1, 0.2)", "returns":"Randomly sized triangular waves with wavelengths between 2 and 3 and amplitudes between 0.1 and 0.2 along the linestring"} | ||
] | ||
} |
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,16 @@ | ||
{ | ||
"name": "wave", | ||
"type": "function", | ||
"groups": ["GeometryGroup"], | ||
"description": "Constructs rounded (sine-like) waves along the boundary of a geometry.", | ||
"arguments": [ | ||
{"arg":"geometry","description":"a geometry"}, | ||
{"arg":"wavelength","description":"wavelength of sine-like waveform"}, | ||
{"arg":"amplitude","description":"amplitude of sine-like waveform"}, | ||
{"arg":"strict","optional": true, "default": false, "description":"By default the wavelength argument is treated as a \"maximum wavelength\", where the actual wavelength will be dynamically adjusted so that an exact number of waves are created along the boundaries of the geometry. If the strict argument is set to true then the wavelength will be used exactly and an incomplete pattern may be used for the final waveform."} | ||
], | ||
"examples": [ | ||
{ "expression":"wave(geom_from_wkt('LineString(0 0, 10 0)'), 3, 1)", "returns":"Sine-like waves with wavelength 3 and amplitude 1 along the linestring"} | ||
|
||
] | ||
} |
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,17 @@ | ||
{ | ||
"name": "wave_randomized", | ||
"type": "function", | ||
"groups": ["GeometryGroup"], | ||
"description": "Constructs randomized curved (sine-like) waves along the boundary of a geometry.", | ||
"arguments": [ | ||
{"arg":"geometry","description":"a geometry"}, | ||
{"arg":"min_wavelength","description":"minimum wavelength of waves"}, | ||
{"arg":"max_wavelength","description":"maximum wavelength of waves"}, | ||
{"arg":"min_amplitude","description":"minimum amplitude of waves"}, | ||
{"arg":"max_amplitude","description":"maximum amplitude of waves"}, | ||
{"arg":"seed","optional": true, "default": "0", "description":"specifies a random seed for generating waves. If the seed is 0, then a completely random set of waves will be generated."} | ||
], | ||
"examples": [ | ||
{ "expression":"wave_randomized(geom_from_wkt('LineString(0 0, 10 0)'), 2, 3, 0.1, 0.2)", "returns":"Randomly sized curved waves with wavelengths between 2 and 3 and amplitudes between 0.1 and 0.2 along the linestring"} | ||
] | ||
} |
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