Class Functions
First parameter can be of type Environment (if needed). This is
automatically filled in by JOSM and the user only sees the remaining arguments.
When one of the user supplied arguments cannot be converted the
expected type or is null, the function is not called and it returns null
immediately. Add the annotation ExpressionFactory.NullableArguments to allow null arguments.
Every method must be static.
- Since:
- 15245 (extracted from
ExpressionFactory)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic floatGet the value of the alpha channel in the rgba color modelstatic Objectany(Environment ignored, Object... args) Returns the first non-null object.static Floatareasize(Environment env) Returns the area of a closed way or multipolygon in square meters ornull.static booleanat(Environment env, double lat, double lon) Determines if the object centroid lies at given lat/lon coordinates.static floatGet the value of the blue color channel in the rgb color modelstatic Doublecardinal_to_radians(String cardinal) Converts an angle diven in cardinal directions to radians.static LatLoncenter(Environment env) Returns the center of the environment OSM primitive.static Stringchild_tag(Environment env, String key) Gets the value of the keykeyfrom the object's child.static Stringcolor2html(Color c) Computes the HTML notation (#rrggbb) for a color value).static Stringconcat(Environment ignored, Object... args) Assembles the strings to one.static Stringconvert_primitive_to_string(PrimitiveId primitive) Convert a primitive to a stringconvert_primitives_to_string(Iterable<PrimitiveId> primitives) Convert Primitives to a stringstatic IntegerReturns the number of elements in a list.static intcount_roles(Environment env, String... roles) Returns the number of primitives in a relation with the specified roles.static longCalculates the CRC32 checksum from a string (based on RFC 1952).static doubledegree_to_radians(double degree) Converts an angle in degrees to radians.static doubledivided_by(double a, double b) Function associated to the numeric "/" operator.static booleanDetermines if the objectsaandbare equal.static ObjectIdentity function for compatibility with MapCSS specification.static ObjectGet thenth element of the listlst(counting starts at 0).static doublegpx_distance(Environment env) Returns the lowest distance between the OSM object and a GPX pointstatic booleangreater(float a, float b) Function associated to the logical ">" operator.static booleangreater_equal(float a, float b) Function associated to the logical ">=" operator.static floatGet the value of the green color channel in the rgb color modelstatic booleanhas_tag_key(Environment env, String key) Determines whether the object has a tag with the given key.static Colorhsb_color(float h, float s, float b) Create color from hsb color model.static Colorhtml2color(String html) Creates a color value from an HTML notation, i.e.,#rrggbb.static Floatindex(Environment env) Returns the index of node in parent way or member in parent relation.static booleaninside(Environment env, String codes) Determines if the object is inside territories matching given ISO3166 codes.static booleanDetermines whether the way isclosed and oriented anticlockwise, or non-closed and the1st, 2nd and last node are in anticlockwise order.static booleanis_clockwise(Environment env) Determines whether the way isclosed and oriented clockwise, or non-closed and the1st, 2nd and last node are in clockwise order.static Booleanis_prop_set(Environment env, String key) Determines whether propertykeyis set.static Booleanis_prop_set(Environment env, String key, String layer) Determines whether propertykeyis set on layerlayer.static booleancheck if there is right-hand traffic at the current locationstatic booleanis_similar(String string1, String string2) Check if two strings are similar, but not identical, i.e., have a Levenshtein distance of 1 or 2.static Stringjoin(Environment ignored, String... args) Assembles the strings to one, where the first entry is used as separator.static StringJoins a list ofvaluesinto a single string with fields separated byseparator.static StringJOSM_pref(Environment env, String key, String def) static BooleanJOSM_search(Environment env, String searchStr) Determines whether the JOSM search withsearchStrapplies to the object.static booleanless(float a, float b) Function associated to the logical "<" operator.static booleanless_equal(float a, float b) Function associated to the logical "<=" operator.list(Environment ignored, Object... args) Creates a list of values, e.g., for thedashesproperty.static StringConverts stringsto lowercase.static doubleminus(double a, double b) Function associated to the numeric "-" operator.static floatmod(float a, float b) Function associated to the math modulo "%" operator.static booleannot(boolean b) Function associated to the logical "!" operator.static booleanDetermines if the objectsaandbare not equal.static intGet the number of tags for the current primitive.static intReturns the id of the changeset the current object was last uploaded to.static longosm_id(Environment env) Returns the OSM id of the current object.static intosm_timestamp(Environment env) Returns the time of last modification to the current object, as timestamp.static longosm_user_id(Environment env) Returns the OSM user id who last touched the current object.static Stringosm_user_name(Environment env) Returns the OSM user name who last touched the current object.static intosm_version(Environment env) Returns the version number of the current object.static booleanoutside(Environment env, String codes) Determines if the object is outside territories matching given ISO3166 codes.static Longparent_osm_id(Environment env) Returns the OSM id of the object's parent.static List<IPrimitive>Gets a list of all OSM id's of the object's parent(s).static List<IPrimitive>parent_osm_primitives(Environment env, String key) Gets a list of all OSM id's of the object's parent(s) with a specified key.static List<IPrimitive>parent_osm_primitives(Environment env, String key, String keyValue) Gets a list of all OSM id's of the object's parent(s) with a specified key.static Stringparent_tag(Environment env, String key) Gets the first non-null value of the keykeyfrom the object's parent(s).parent_tags(Environment env, String key) Gets a list of all non-null values of the keykeyfrom the object's parent(s).static DoubleGet the rotation angle of the preceding parent way segment at the node location.private static intparse_regex_flags(String flags) Parse flags for regex usage.static doubleplus(double a, double b) Function associated to the numeric "+" operator.static ObjectPrints the object to the command line (for debugging purpose).static ObjectPrints the object to the command line, with new line at the end (for debugging purpose).static Objectprop(Environment env, String key) Returns the value of the propertykey, e.g.,prop("width").static Objectprop(Environment env, String key, String layer) Returns the value of the propertykeyfrom layerlayer.static floatGet the value of the red color channel in the rgb color modelregexp_match(String pattern, String target) Tries to match string against pattern regexp and returns a list of capture groups in case of success.regexp_match(String pattern, String target, String flags) Tries to match string against pattern regexp and returns a list of capture groups in case of success.static booleanregexp_test(String pattern, String target) Tests if stringtargetmatches patternpatternstatic booleanregexp_test(String pattern, String target, String flags) Tests if stringtargetmatches patternpatternstatic StringReplaces insevery target} substring byreplacement.static Colorrgb(float r, float g, float b) Creates a color value with the specified amounts ofred,green,blue (arguments from 0.0 to 1.0)static Colorrgba(float r, float g, float b, float alpha) Creates a color value with the specified amounts ofred,green,blue,alpha(arguments from 0.0 to 1.0)static Stringrole(Environment env) Returns the role of current object in parent relation, or role of child if current object is a relation.static Objectsetting(Environment env, String key) Get value of a setting.static StringConvert a length unit to meterssort(Environment ignored, String... sortables) Sort an array of stringsSort a list of stringsSplits stringtoSplitat occurrences of the separator stringsepand returns a list of matches.static StringReturns the substring ofsstarting at indexbegin(inclusive, 0-indexed).static StringReturns the substring ofsstarting at indexbegin(inclusive) and ending at indexend, (exclusive, 0-indexed).static Stringtag(Environment env, String key) Gets the value of the keykeyfrom the object in question.tag_regex(Environment env, String keyRegex) Get keys that follow a regextag_regex(Environment env, String keyRegex, String flags) Get keys that follow a regexstatic doubletimes(double a, double b) Function associated to the numeric "*" operator.static StringReturns a title-cased version of the string where words start with an uppercase character and the remaining characters are lowercasestatic booleanto_boolean(String value) Parses the string argument as a boolean.static byteParses the string argument as a byte.static doubleParses the string argument as a double.static floatParses the string argument as a float.static intParses the string argument as an int.static longParses the string argument as a long.static shortParses the string argument as a short.static Stringtr(Environment ignored, String... args) Translates some text for the current locale.static StringTrim whitespaces from the strings.Trim whitespaces from the stringsstrings.uniq(Environment ignored, String... values) Get unique valuesGet unique valuesstatic StringConverts stringsto uppercase.static StringURL_decode(String s) Percent-decode a string.static StringURL_encode(String s) Percent-encode a string.static Floatwaylength(Environment env) Returns the length of the way in metres ornull.static StringXML_encode(String s) XML-encode a string.
-
Constructor Details
-
Functions
private Functions()
-
-
Method Details
-
eval
Identity function for compatibility with MapCSS specification.- Parameters:
o- any object- Returns:
ounchanged
-
plus
Function associated to the numeric "+" operator.- Parameters:
a- the first operandb- the second operand- Returns:
- Sum of arguments
- See Also:
-
minus
Function associated to the numeric "-" operator.- Parameters:
a- the first operandb- the second operand- Returns:
- Subtraction of arguments
-
times
Function associated to the numeric "*" operator.- Parameters:
a- the first operandb- the second operand- Returns:
- Multiplication of arguments
-
divided_by
Function associated to the numeric "/" operator.- Parameters:
a- the first operandb- the second operand- Returns:
- Division of arguments
-
mod
Function associated to the math modulo "%" operator.- Parameters:
a- first valueb- second value- Returns:
a mod b, e.g.,mod(7, 5) = 2
-
list
Creates a list of values, e.g., for thedashesproperty.- Parameters:
ignored- The environment (ignored)args- The values to put in a list- Returns:
- list of values
- See Also:
-
count
Returns the number of elements in a list.- Parameters:
lst- the list- Returns:
- length of the list
-
any
Returns the first non-null object. The name originates from MapCSS standard.- Parameters:
ignored- The environment (ignored)args- arguments- Returns:
- the first non-null object
- See Also:
-
get
Get thenth element of the listlst(counting starts at 0).- Parameters:
lst- listn- index- Returns:
nth element of the list, ornullif index out of range- Since:
- 5699
-
split
Splits stringtoSplitat occurrences of the separator stringsepand returns a list of matches.- Parameters:
sep- separator stringtoSplit- string to split- Returns:
- list of matches
- Since:
- 5699
- See Also:
-
rgb
Creates a color value with the specified amounts ofred,green,blue (arguments from 0.0 to 1.0)- Parameters:
r- the red componentg- the green componentb- the blue component- Returns:
- color matching the given components
- See Also:
-
rgba
Creates a color value with the specified amounts ofred,green,blue,alpha(arguments from 0.0 to 1.0)- Parameters:
r- the red componentg- the green componentb- the blue componentalpha- the alpha component- Returns:
- color matching the given components
- See Also:
-
hsb_color
Create color from hsb color model. (arguments form 0.0 to 1.0)- Parameters:
h- hues- saturationb- brightness- Returns:
- the corresponding color
-
html2color
Creates a color value from an HTML notation, i.e.,#rrggbb.- Parameters:
html- HTML notation- Returns:
- color matching the given notation
-
color2html
Computes the HTML notation (#rrggbb) for a color value).- Parameters:
c- color- Returns:
- HTML notation matching the given color
-
red
Get the value of the red color channel in the rgb color model- Parameters:
c- color- Returns:
- the red color channel in the range [0;1]
- See Also:
-
green
Get the value of the green color channel in the rgb color model- Parameters:
c- color- Returns:
- the green color channel in the range [0;1]
- See Also:
-
blue
Get the value of the blue color channel in the rgb color model- Parameters:
c- color- Returns:
- the blue color channel in the range [0;1]
- See Also:
-
alpha
Get the value of the alpha channel in the rgba color model- Parameters:
c- color- Returns:
- the alpha channel in the range [0;1]
- See Also:
-
concat
Assembles the strings to one.- Parameters:
ignored- The environment (ignored)args- arguments- Returns:
- assembled string
- See Also:
-
join
Assembles the strings to one, where the first entry is used as separator.- Parameters:
ignored- The environment (ignored)args- arguments. First one is used as separator- Returns:
- assembled string
- See Also:
-
join_list
Joins a list ofvaluesinto a single string with fields separated byseparator.- Parameters:
separator- the separatorvalues- collection of objects- Returns:
- assembled string
- See Also:
-
prop
Returns the value of the propertykey, e.g.,prop("width").- Parameters:
env- the environmentkey- the property key- Returns:
- the property value
-
prop
Returns the value of the propertykeyfrom layerlayer.- Parameters:
env- the environmentkey- the property keylayer- layer- Returns:
- the property value
-
is_prop_set
Determines whether propertykeyis set.- Parameters:
env- the environmentkey- the property key- Returns:
trueif the property is set,falseotherwise
-
is_prop_set
Determines whether propertykeyis set on layerlayer.- Parameters:
env- the environmentkey- the property keylayer- layer- Returns:
trueif the property is set,falseotherwise
-
tag
Gets the value of the keykeyfrom the object in question.- Parameters:
env- the environmentkey- the OSM key- Returns:
- the value for given key
-
tag_regex
Get keys that follow a regex- Parameters:
env- the environmentkeyRegex- the pattern that the key must match- Returns:
- the values for the keys that match the pattern
- Since:
- 15315
- See Also:
-
tag_regex
Get keys that follow a regex- Parameters:
env- the environmentkeyRegex- the pattern that the key must matchflags- a string that may contain "i" (case insensitive), "m" (multiline) and "s" ("dot all")- Returns:
- the values for the keys that match the pattern
- Since:
- 15315
- See Also:
-
parse_regex_flags
Parse flags for regex usage. Shouldn't be used in mapcss- Parameters:
flags- a string that may contain "i" (case insensitive), "m" (multiline) and "s" ("dot all")- Returns:
- An int that can be used by a
Patternobject - See Also:
-
parent_tag
Gets the first non-null value of the keykeyfrom the object's parent(s).- Parameters:
env- the environmentkey- the OSM key- Returns:
- first non-null value of the key
keyfrom the object's parent(s)
-
parent_tags
Gets a list of all non-null values of the keykeyfrom the object's parent(s).The values are sorted according to
AlphanumComparator.- Parameters:
env- the environmentkey- the OSM key- Returns:
- a list of non-null values of the key
keyfrom the object's parent(s)
-
parent_way_angle
Get the rotation angle of the preceding parent way segment at the node location. If there is no preceding parent way segment, the following way segment is used instead. Requires a parent way object matched via child selector.- Parameters:
env- the environment- Returns:
- the rotation angle of the parent way segment at the node in radians, otherwise null if there is no matching parent way or the object is not a node
- Since:
- 18664
-
child_tag
Gets the value of the keykeyfrom the object's child.- Parameters:
env- the environmentkey- the OSM key- Returns:
- the value of the key
keyfrom the object's child, ornullif there is no child
-
parent_osm_id
Returns the OSM id of the object's parent.Parent must be matched by child selector.
- Parameters:
env- the environment- Returns:
- the OSM id of the object's parent, if available, or
null - See Also:
-
parent_osm_primitives
Gets a list of all OSM id's of the object's parent(s) with a specified key.- Parameters:
env- the environmentkey- the OSM keykeyValue- the regex value of the OSM key- Returns:
- a list of non-null values of the OSM id's from the object's parent(s)
- Since:
- 18829
-
parent_osm_primitives
Gets a list of all OSM id's of the object's parent(s) with a specified key.- Parameters:
env- the environmentkey- the OSM key- Returns:
- a list of non-null values of the OSM id's from the object's parent(s)
- Since:
- 18829
-
parent_osm_primitives
Gets a list of all OSM id's of the object's parent(s).- Parameters:
env- the environment- Returns:
- a list of non-null values of the OSM id's from the object's parent(s)
- Since:
- 18829
-
convert_primitives_to_string
Convert Primitives to a string- Parameters:
primitives- The primitives to convert- Returns:
- A list of strings in the format type + id (in the list order)
- Since:
- 18829
- See Also:
-
convert_primitive_to_string
Convert a primitive to a string- Parameters:
primitive- The primitive to convert- Returns:
- A string in the format type + id
- Since:
- 18829
- See Also:
-
gpx_distance
Returns the lowest distance between the OSM object and a GPX point- Parameters:
env- the environment- Returns:
- the distance between the object and the closest gpx point or
Double.MAX_VALUE - Since:
- 14802
-
has_tag_key
Determines whether the object has a tag with the given key.- Parameters:
env- the environmentkey- the OSM key- Returns:
trueif the object has a tag with the given key,falseotherwise
-
index
Returns the index of node in parent way or member in parent relation.- Parameters:
env- the environment- Returns:
- the index as float. Starts at 1
-
sort
Sort an array of strings- Parameters:
ignored- The environment (ignored)sortables- The array to sort- Returns:
- The sorted list
- Since:
- 15279
-
sort_list
Sort a list of strings- Parameters:
sortables- The list to sort- Returns:
- The sorted list
- Since:
- 15279
-
uniq
Get unique values- Parameters:
ignored- The environment (ignored)values- A list of values that may have duplicates- Returns:
- A list with no duplicates
- Since:
- 15323
-
uniq_list
Get unique values- Parameters:
values- A list of values that may have duplicates- Returns:
- A list with no duplicates
- Since:
- 15323
-
role
Returns the role of current object in parent relation, or role of child if current object is a relation.- Parameters:
env- the environment- Returns:
- role of current object in parent relation, or role of child if current object is a relation
- See Also:
-
count_roles
Returns the number of primitives in a relation with the specified roles.- Parameters:
env- the environmentroles- The roles to count in the relation- Returns:
- The number of relation members with the specified role
- Since:
- 15196
-
areasize
Returns the area of a closed way or multipolygon in square meters ornull.- Parameters:
env- the environment- Returns:
- the area of a closed way or multipolygon in square meters or
null - See Also:
-
waylength
Returns the length of the way in metres ornull.- Parameters:
env- the environment- Returns:
- the length of the way in metres or
null. - See Also:
-
not
Function associated to the logical "!" operator.- Parameters:
b- boolean value- Returns:
trueif!b
-
greater_equal
Function associated to the logical ">=" operator.- Parameters:
a- first valueb- second value- Returns:
trueifa >= b
-
less_equal
Function associated to the logical "<=" operator.- Parameters:
a- first valueb- second value- Returns:
trueifa <= b
-
greater
Function associated to the logical ">" operator.- Parameters:
a- first valueb- second value- Returns:
trueifa > b
-
less
Function associated to the logical "<" operator.- Parameters:
a- first valueb- second value- Returns:
trueifa < b
-
degree_to_radians
Converts an angle in degrees to radians.- Parameters:
degree- the angle in degrees- Returns:
- the angle in radians
- See Also:
-
cardinal_to_radians
Converts an angle diven in cardinal directions to radians. The following values are supported:n,north,ne,northeast,e,east,se,southeast,s,south,sw,southwest,w,west,nw,northwest.- Parameters:
cardinal- the angle in cardinal directions.- Returns:
- the angle in radians
- See Also:
-
equal
Determines if the objectsaandbare equal.- Parameters:
a- First objectb- Second object- Returns:
trueif objects are equal,falseotherwise- See Also:
-
not_equal
Determines if the objectsaandbare not equal.- Parameters:
a- First objectb- Second object- Returns:
falseif objects are equal,trueotherwise- See Also:
-
JOSM_search
Determines whether the JOSM search withsearchStrapplies to the object.- Parameters:
env- the environmentsearchStr- the search string- Returns:
trueif the JOSM search withsearchStrapplies to the object- See Also:
-
JOSM_pref
Obtains the JOSM keyPreferencesstring for keykey, and defaults todefif that is null.If the default value can be converted to a
Color, theNamedColorPropertyis retrieved as string.- Parameters:
env- the environmentkey- Key in JOSM preferencedef- Default value- Returns:
- value for key, or default value if not found
-
regexp_test
Tests if stringtargetmatches patternpattern- Parameters:
pattern- The regex expressiontarget- The character sequence to be matched- Returns:
trueif, and only if, the entire region sequence matches the pattern- Since:
- 5699
- See Also:
-
regexp_test
Tests if stringtargetmatches patternpattern- Parameters:
pattern- The regex expressiontarget- The character sequence to be matchedflags- a string that may contain "i" (case insensitive), "m" (multiline) and "s" ("dot all")- Returns:
trueif, and only if, the entire region sequence matches the pattern- Since:
- 5699
- See Also:
-
regexp_match
Tries to match string against pattern regexp and returns a list of capture groups in case of success. The first element (index 0) is the complete match (i.e. string). Further elements correspond to the bracketed parts of the regular expression.- Parameters:
pattern- The regex expressiontarget- The character sequence to be matchedflags- a string that may contain "i" (case insensitive), "m" (multiline) and "s" ("dot all")- Returns:
- a list of capture groups if
Matcher.matches(), ornull. - Since:
- 5701
- See Also:
-
regexp_match
Tries to match string against pattern regexp and returns a list of capture groups in case of success. The first element (index 0) is the complete match (i.e. string). Further elements correspond to the bracketed parts of the regular expression.- Parameters:
pattern- The regex expressiontarget- The character sequence to be matched- Returns:
- a list of capture groups if
Matcher.matches(), ornull. - Since:
- 5701
-
osm_id
Returns the OSM id of the current object.- Parameters:
env- the environment- Returns:
- the OSM id of the current object
- See Also:
-
osm_user_name
Returns the OSM user name who last touched the current object.- Parameters:
env- the environment- Returns:
- the OSM user name who last touched the current object
- Since:
- 15246
- See Also:
-
osm_user_id
Returns the OSM user id who last touched the current object.- Parameters:
env- the environment- Returns:
- the OSM user id who last touched the current object
- Since:
- 15246
- See Also:
-
osm_version
Returns the version number of the current object.- Parameters:
env- the environment- Returns:
- the version number of the current object
- Since:
- 15246
- See Also:
-
osm_changeset_id
Returns the id of the changeset the current object was last uploaded to.- Parameters:
env- the environment- Returns:
- the id of the changeset the current object was last uploaded to
- Since:
- 15246
- See Also:
-
osm_timestamp
Returns the time of last modification to the current object, as timestamp.- Parameters:
env- the environment- Returns:
- the time of last modification to the current object, as timestamp
- Since:
- 15246
- See Also:
-
tr
Translates some text for the current locale. The first argument is the text to translate, and the subsequent arguments are parameters for the string indicated by{0},{1}, …- Parameters:
ignored- The environment (ignored)args- arguments- Returns:
- the translated string
-
substring
Returns the substring ofsstarting at indexbegin(inclusive, 0-indexed).- Parameters:
s- The base stringbegin- The start index- Returns:
- the substring
- See Also:
-
substring
Returns the substring ofsstarting at indexbegin(inclusive) and ending at indexend, (exclusive, 0-indexed).- Parameters:
s- The base stringbegin- The start indexend- The end index. If negative, it counts from the end of the string- Returns:
- the substring
- See Also:
-
replace
Replaces insevery target} substring byreplacement.- Parameters:
s- The source stringtarget- The sequence of char values to be replacedreplacement- The replacement sequence of char values- Returns:
- The resulting string
- See Also:
-
upper
Converts stringsto uppercase.- Parameters:
s- The source string- Returns:
- The resulting string
- Since:
- 11756
- See Also:
-
lower
Converts stringsto lowercase.- Parameters:
s- The source string- Returns:
- The resulting string
- Since:
- 11756
- See Also:
-
title
Returns a title-cased version of the string where words start with an uppercase character and the remaining characters are lowercaseAlso known as "capitalize".
- Parameters:
str- The source string- Returns:
- The resulting string
- Since:
- 17613
- See Also:
-
trim
Trim whitespaces from the strings.- Parameters:
s- The source string- Returns:
- The resulting string
- Since:
- 11756
- See Also:
-
trim_list
Trim whitespaces from the stringsstrings.- Parameters:
strings- The list of strings to strip- Returns:
- The resulting string
- Since:
- 15591
- See Also:
-
is_similar
Check if two strings are similar, but not identical, i.e., have a Levenshtein distance of 1 or 2.- Parameters:
string1- first string to comparestring2- second string to compare- Returns:
- true if the normalized strings are different but only a "little bit"
- Since:
- 14371
- See Also:
-
URL_decode
Percent-decode a string. (See https://en.wikipedia.org/wiki/Percent-encoding)This is especially useful for wikipedia titles
- Parameters:
s- url-encoded string- Returns:
- the decoded string, or original in case of an error
- Since:
- 11756
-
URL_encode
Percent-encode a string. (See https://en.wikipedia.org/wiki/Percent-encoding)This is especially useful for data urls, e.g.
concat("data:image/svg+xml,", URL_encode("<svg>...</svg>"));- Parameters:
s- arbitrary string- Returns:
- the encoded string
-
XML_encode
XML-encode a string.Escapes special characters in xml. Alternative to using <![CDATA[ ... ]]> blocks.
- Parameters:
s- arbitrary string- Returns:
- the encoded string
-
siunit_length
Convert a length unit to metersTries to convert a length unit to meter value or returns
nullwhen impossible- Parameters:
s- arbitrary string representing a length- Returns:
- the length converted to meters
- Since:
- 19089
-
CRC32_checksum
Calculates the CRC32 checksum from a string (based on RFC 1952).- Parameters:
s- the string- Returns:
- long value from 0 to 2^32-1
-
is_right_hand_traffic
check if there is right-hand traffic at the current location- Parameters:
env- the environment- Returns:
- true if there is right-hand traffic
- Since:
- 7193
-
is_clockwise
Determines whether the way isclosed and oriented clockwise, or non-closed and the1st, 2nd and last node are in clockwise order.- Parameters:
env- the environment- Returns:
- true if the way is closed and oriented clockwise
-
is_anticlockwise
Determines whether the way isclosed and oriented anticlockwise, or non-closed and the1st, 2nd and last node are in anticlockwise order.- Parameters:
env- the environment- Returns:
- true if the way is closed and oriented clockwise
-
print
Prints the object to the command line (for debugging purpose).- Parameters:
o- the object- Returns:
- the same object, unchanged
-
println
Prints the object to the command line, with new line at the end (for debugging purpose).- Parameters:
o- the object- Returns:
- the same object, unchanged
-
number_of_tags
Get the number of tags for the current primitive.- Parameters:
env- the environment- Returns:
- number of tags
-
setting
Get value of a setting.- Parameters:
env- the environmentkey- setting key (given as layer identifier, e.g. setting::mykey {...})- Returns:
- the value of the setting (calculated when the style is loaded)
-
center
Returns the center of the environment OSM primitive.- Parameters:
env- the environment- Returns:
- the center of the environment OSM primitive
- Since:
- 11247
-
inside
Determines if the object is inside territories matching given ISO3166 codes.- Parameters:
env- the environmentcodes- comma-separated list of ISO3166-1-alpha2 or ISO3166-2 country/subdivision codes- Returns:
trueif the object is inside territory matching given ISO3166 codes- Since:
- 11247
-
outside
Determines if the object is outside territories matching given ISO3166 codes.- Parameters:
env- the environmentcodes- comma-separated list of ISO3166-1-alpha2 or ISO3166-2 country/subdivision codes- Returns:
trueif the object is outside territory matching given ISO3166 codes- Since:
- 11247
-
at
Determines if the object centroid lies at given lat/lon coordinates.- Parameters:
env- the environmentlat- latitude, i.e., the north-south position in degreeslon- longitude, i.e., the east-west position in degrees- Returns:
trueif the object centroid lies at given lat/lon coordinates- Since:
- 12514
-
to_boolean
Parses the string argument as a boolean.- Parameters:
value- theStringcontaining the boolean representation to be parsed- Returns:
- the boolean represented by the string argument
- Since:
- 16110
- See Also:
-
to_byte
Parses the string argument as a byte.- Parameters:
value- theStringcontaining the byte representation to be parsed- Returns:
- the byte represented by the string argument
- Since:
- 16110
- See Also:
-
to_short
Parses the string argument as a short.- Parameters:
value- theStringcontaining the short representation to be parsed- Returns:
- the short represented by the string argument
- Since:
- 16110
- See Also:
-
to_int
Parses the string argument as an int.- Parameters:
value- theStringcontaining the int representation to be parsed- Returns:
- the int represented by the string argument
- Since:
- 16110
- See Also:
-
to_long
Parses the string argument as a long.- Parameters:
value- theStringcontaining the long representation to be parsed- Returns:
- the long represented by the string argument
- Since:
- 16110
- See Also:
-
to_float
Parses the string argument as a float.- Parameters:
value- theStringcontaining the float representation to be parsed- Returns:
- the float represented by the string argument
- Since:
- 16110
- See Also:
-
to_double
Parses the string argument as a double.- Parameters:
value- theStringcontaining the double representation to be parsed- Returns:
- the double represented by the string argument
- Since:
- 16110
- See Also:
-