Skip to content

Commit 64f7fbc

Browse files
authored
Merge pull request #321 from lognaturel/geofence
Add the geofence function
2 parents 224efe5 + 9a534ec commit 64f7fbc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

_sections/30-bindings.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ For convenience, the functions are categorized based on their main usage. Some f
130130
<a id="fn:uuid" href="#fn:uuid">`uuid(number?)`</a> | string | Without arguments, it returns a random [RFC 4122 version 4](http://tools.ietf.org/html/rfc4122) compliant UUID. With an argument it returns a random string with the provided number of characters.
131131
<a id="fn:digest" href="#fn:digest">`digest(string src, string algorithm, string encoding?)`</a> | string | As in [XForms 1.1](https://www.w3.org/TR/xforms/#fn-digest)
132132
<a id="fn:pulldata" href="#fn:pulldata">`pulldata(string instance_id, string desired_element, string query_element, string query)`</a> | string | Returns a single value from a secondary instance based on the specified query. Shortcut for `instance(instance_id)/root/item[query_element=query]/desired_element`.
133+
<a id="fn:base64-decode" href="#fn:base64-decode">`base64-decode(base64Binary input)`| `string` | Interprets the contents of the base64Binary value as a sequence of bytes representing a UTF-8 character string and returns the corresponding string.
133134
<a id="fn:Boolean-Functions" href="#fn:Boolean-Functions">**Boolean Functions**</a>|||
134135
<a id="fn:if" href="#fn:if">`if(boolean condition, * then, * else)`</a> | string | Deviates from [XForms 1.0](https://www.w3.org/TR/2003/REC-xforms-20031014/slice7.html#fn-if) in that the 2nd and 3rd parameter are objects and not strings.
135136
<a id="fn:coalesce" href="#fn:coalesce">`coalesce(string arg1, string arg2)`</a> | string | Returns first non-empty value of arg1 and arg2 or empty if both are empty and/or non-existent.
@@ -192,7 +193,7 @@ For convenience, the functions are categorized based on their main usage. Some f
192193
<a id="fn:Geographic-Functions" href="#fn:Geographic-Functions">**Geographic Functions**</a>|||
193194
<a id="fn:area" href="#fn:area">`area(node-set ns|geoshape gs)`</a> | number | Returns the calculated area in m2 of either a node-set of geopoints or a geoshape value (not a combination of both) on Earth. It takes into account the circumference of the Earth around the Equator but does not take altitude into account.
194195
<a id="fn:distance" href="#fn:distance">`distance(node-set ns|geoshape gs|geotrace gt|(geopoint|string) arg*)`</a> | number | Returns the total distance in meters of all line segments represented either by a single node-set of geopoints or a single geoshape value or a single geotrace value or a sequence of geopoint values (not a combination of these) on Earth. It uses the [spherical law of cosines](https://www.movable-type.co.uk/scripts/latlong.html) to take the circumference of the Earth around the Equator into account and does not take altitude into account. The line segment distances are computed in the order that the points are provided and then added together. The multiple-argument variant can take a combination of literal string geopoint values and references to geopoint nodes.
195-
<a id="fn:base64-decode" href="#fn:base64-decode">`base64-decode(base64Binary input)`| `string` | Interprets the contents of the base64Binary value as a sequence of bytes representing a UTF-8 character string and returns the corresponding string.
196+
<a id="fn:geofence" href="#fn:geofence">`geofence(geopoint p, geoshape gs)`</a> | boolean | Returns true if the specified point is inside the specified geoshape using [this algorithm](https://wrfranklin.org/Research/Short_Notes/pnpoly.html), false otherwise.
196197

197198
### Metadata
198199

0 commit comments

Comments
 (0)