-
Notifications
You must be signed in to change notification settings - Fork 1
/
bus-routes-search.html
146 lines (136 loc) · 6.31 KB
/
bus-routes-search.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<!--/* NODE-RED-CONTRIB-SNAP4CITY-DEVELOPER
Copyright (C) 2018 DISIT Lab http://www.disit.org - University of Florence
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */-->
<script type="text/javascript">
RED.nodes.registerType('bus-routes-search', {
category: 'S4CSearchDev',
color: '#C7E9C0',
defaults: {
name: {
value: ""
},
authentication: {
type: "snap4city-authentication",
required: false
},
selection: {
value: "",
required: false
},
maxresults: {
value: 100,
required: false,
validate: RED.validators.number()
},
maxdists: {
value: 1,
required: false,
validate: RED.validators.number()
},
agency: {
value: "",
required: false
},
geometry: {
value: "",
required: false
},
},
outputs: 1,
inputs: 1,
outputLabels: ["routes"],
icon: "tpl.png",
label: function () {
return this.name || "bus-routes-search";
}
});
</script>
<script type="text/x-red" data-template-name="bus-routes-search">
<div class="form-row" id="rowAuthentication">
<label for="node-input-authentication">Authentication</label>
<input type="text" id="node-input-authentication">
</div>
<div class="form-tips" id="tipAuthentication" style="margin-bottom: 10px;">
If you have private data and you want to access them, you must have to insert you account data. You can register for one account
<a href="https://www.snap4city.org"
target="_blank">here</a>.
</div>
<div class="form-row">
<label for="node-input-name">Name</label>
<input type="text" autocomplete="off" id="node-input-name" placeholder="Name">
</div>
<div class="form-row">
<label for="node-input-selection">Selection</label>
<input type="text" autocomplete="off" id="node-input-selection" placeholder="Selection">
</div>
<div class="form-row">
<label for="node-input-agency">Agency</label>
<input type="text" autocomplete="off" id="node-input-agency" placeholder="Agency">
</div>
<div class="form-row">
<label for="node-input-maxresults">Max Results (0 for all Results)</label>
<input type="text" autocomplete="off" id="node-input-maxresults" placeholder="Max Results">
</div>
<div class="form-row">
<label for="node-input-maxdists">Max Distance (in km)</label>
<input type="text" autocomplete="off" id="node-input-maxdists" placeholder="Max Distance">
</div>
<div class="form-row">
<label for="node-input-geometry">Geometry</label>
<input type="checkbox" id="node-input-geometry" style="display:inline-block; width:20px; vertical-align:baseline;">
</div>
</script>
<script type="text/x-red" data-help-name="bus-routes-search">
<p>It provides a list of the public transport routes that have a stop in a specified area.
</p>
<h3>Inputs</h3>
A JSON with these parameters:
<dl class="message-properties">
<dt>selection
<span class="property-type">string</span>
</dt>
<dd> “ <lat>; <lng>” with a GPS position or “ <lat1>; <lng1>; <lat2>; <lng2>” for a rectangular area
or “wkt: <WKT_string>” or “geo: <geoid>” for a geographic area described as Well Known Text</dd>
<dt>agency
<span class="property-type">string</span>
</dt>
<dd> URI of an agency to restrict the search to a specified agency
</dd>
<dt>maxdistance
<span class="property-type">number</span>
</dt>
<dd> maximum distance from the GPS position of the services to be retrieved, expressed in Km (0.1 is used if parameter
is missing) if it is equal to “inside” it searches for services with a WKT geometry that contains the specified
GPS position (e.g a park)</dd>
<dt>maxresults
<span class="property-type">number</span>
</dt>
<dd> maximum number of results to be returned (if parameter is missing 100 is assumed), if it is 0 all results are returned</dd>
<dt>geometry
<span class="property-type">boolean</span>
</dt>
<dd> true/false, if true it returns a “hasGeometry” property for each service stating if the service has a complex WKT
geometries (linestring, polygon) associated with it (if parameter is missing “false” is assumed)</dd>
</dl>
<h3>Outputs</h3>
<dl class="message-properties">
<dd> It provides a JSON Object with all the routes that have stops on the specified area. For each route the following
properties are provided: • lineNumber: the line short name • lineName: the line long name • route: the route
name • routeUri: an URI identifying the route (it can be used to retrieve all the stops of the route) • direction:
with first and last stop • agency: with agency name • agencyUri: with agency URI • polyline: with the WKT geometry
of the route</dd>
</dl>
<h3>Details</h3>
<p>The node can receive a JSON with the parameters described in the Inputs section and with them generate the output JSON.
If the values are not present in the input JSON, these are read by those in the configuration. If they are not present
in either part, an error is generated for the necessary parameters.</p>
</script>