|
| 1 | +<?xml version="1.0"?> |
| 2 | +<h:html xmlns="http://www.w3.org/2002/xforms" xmlns:h="http://www.w3.org/1999/xhtml" |
| 3 | + xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xsd="http://www.w3.org/2001/XMLSchema" |
| 4 | + xmlns:jr="http://openrosa.org/javarosa" xmlns:orx="http://openrosa.org/xforms" |
| 5 | + xmlns:odk="http://www.opendatakit.org/xforms"> |
| 6 | + <h:head> |
| 7 | + <h:title>Examples using the distance() and area() function</h:title> |
| 8 | + <model odk:xforms-version="1.0.0"> |
| 9 | + <instance> |
| 10 | + <data id="distance_examples" version="20241025195211"> |
| 11 | + <location1>-6.8137120026589315 39.29392995851879 400 10</location1> |
| 12 | + <location2>-6.815178491608137 39.29533915133268</location2> |
| 13 | + <location3>-6.81189589956027 39.2973513889647 600</location3> |
| 14 | + <location4>-6.81223343508222 39.29735351357036</location4> |
| 15 | + <geoshape_12341 /> |
| 16 | + <distance_1234 /> |
| 17 | + <area_1234 /> |
| 18 | + <distance_mixed /> |
| 19 | + <distance_via_geoshape /> |
| 20 | + <meta> |
| 21 | + <instanceID /> |
| 22 | + </meta> |
| 23 | + </data> |
| 24 | + </instance> |
| 25 | + <bind nodeset="/data/location1" readonly="true()" type="string" /> |
| 26 | + <bind nodeset="/data/location2" readonly="true()" type="string" /> |
| 27 | + <bind nodeset="/data/location3" readonly="true()" type="string" /> |
| 28 | + <bind nodeset="/data/location4" readonly="true()" type="string" /> |
| 29 | + <bind nodeset="/data/geoshape_12341" readonly="true()" type="string" |
| 30 | + calculate="join("; ", /data/location1 , /data/location2 , /data/location3 , /data/location4 , /data/location1 )" /> |
| 31 | + <bind nodeset="/data/distance_1234" readonly="true()" type="string" |
| 32 | + calculate="distance( /data/location1 , /data/location2 , /data/location3 , /data/location4 )" /> |
| 33 | + <bind nodeset="/data/area_1234" readonly="true()" type="string" |
| 34 | + calculate="area( /data/geoshape_12341 )" /> |
| 35 | + <bind nodeset="/data/distance_mixed" readonly="true()" type="string" |
| 36 | + calculate="distance( /data/location1 , /data/location2 , /data/location3 , /data/location4 , '-6.8137120026589315 39.29392995851879 400 10')" /> |
| 37 | + <bind nodeset="/data/distance_via_geoshape" readonly="true()" type="string" |
| 38 | + calculate="distance( /data/geoshape_12341 )" /> |
| 39 | + <bind nodeset="/data/meta/instanceID" type="string" readonly="true()" jr:preload="uid" /> |
| 40 | + </model> |
| 41 | + </h:head> |
| 42 | + <h:body> |
| 43 | + <input ref="/data/location1"> |
| 44 | + <label>where 1</label> |
| 45 | + </input> |
| 46 | + <input ref="/data/location2"> |
| 47 | + <label>where 2</label> |
| 48 | + </input> |
| 49 | + <input ref="/data/location3"> |
| 50 | + <label>where 3</label> |
| 51 | + </input> |
| 52 | + <input ref="/data/location4"> |
| 53 | + <label>where 4</label> |
| 54 | + </input> |
| 55 | + <input ref="/data/geoshape_12341"> |
| 56 | + <label>geoshape 12341</label> |
| 57 | + </input> |
| 58 | + <input ref="/data/distance_1234"> |
| 59 | + <label>distance 1234</label> |
| 60 | + </input> |
| 61 | + <input ref="/data/area_1234"> |
| 62 | + <label>area 1234</label> |
| 63 | + </input> |
| 64 | + <input ref="/data/distance_mixed"> |
| 65 | + <label>distance 12341 mixed-type arguments</label> |
| 66 | + </input> |
| 67 | + <input ref="/data/distance_via_geoshape"> |
| 68 | + <label>distance 12341 via geoshape</label> |
| 69 | + </input> |
| 70 | + </h:body> |
| 71 | +</h:html> |
0 commit comments