File size: 7,645 Bytes
d52c87f
 
 
 
0914710
 
 
 
 
c92d24c
0914710
 
 
 
 
 
d52c87f
 
 
 
 
 
 
9bca4cd
0914710
 
9bca4cd
0914710
9bca4cd
0914710
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d52c87f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
import { ref, type Ref } from "vue"
import {Control as LeafletControl} from 'leaflet'
import type { IPointPrompt, IRectanglePrompt } from "./types"
import { driver, type DriveStep } from "../../node_modules/@trincadev/driver.js/src/driver"

export const prefix = " &copy; <a target=\"_blank\" href=\"https://leafletjs.com\">leaflet</a>"
export const OpenStreetMap = "OpenStreetMap"
export const Satellite = "OpenStreetMap.HOT"
export const maxZoom = 20
export const minZoom = 2
export const waitingString = "waiting..."
export const durationRef = ref(0)
export const numberOfPolygonsRef = ref(0)
export const numberOfPredictedMasksRef = ref(0)
export const responseMessageRef = ref("-")
export const geojsonRef = ref("geojsonOutput-placeholder")
export const currentBaseMapNameRef = ref("")
export const currentMapBBoxRef = ref()
export const currentZoomRef = ref()
export const promptsArrayRef: Ref<Array<IPointPrompt | IRectanglePrompt>> = ref([])
export const mapOptionsDefaultRef = ref()
export const layerControlGroupLayersRef = ref(new LeafletControl.Layers());
export const mapNavigationLocked = ref(false)
export const responseMessageLisaRef = ref("-")

export const promptPlaceHolder = "You are a skilled gis analyst with a lot of expertise " +
    "in photogrammetry, remote sensing and geomorphology field."
export const promptTextArray = [
  "You need to identify the areas with trees in this photogrammetric image. Please output segmentation mask.",
  "You need to identify the roads in this photogrammetric image. Please output segmentation mask and explain why.",
  "You need to identify the lake in this photogrammetric image. Please output segmentation mask, explain why and describe what you identified.",
  "Describe what do you can identify in this photogrammetric image."
]

// modified from https://github.com/for-GET/know-your-http-well/blob/master/json/status-codes.json
export const htmlStatusMessages = [
  {
    code: 100,
    phrase: 'Continue'
  },
  {
    code: 101,
    phrase: 'Switching Protocols'
  },
  {
    code: 200,
    phrase: 'OK'
  },
  {
    code: 201,
    phrase: 'Created'
  },
  {
    code: 202,
    phrase: 'Accepted'
  },
  {
    code: 203,
    phrase: 'Non-Authoritative Information'
  },
  {
    code: 204,
    phrase: 'No Content'
  },
  {
    code: 205,
    phrase: 'Reset Content'
  },
  {
    code: 206,
    phrase: 'Partial Content'
  },
  {
    code: 300,
    phrase: 'Multiple Choices'
  },
  {
    code: 302,
    phrase: 'Found'
  },
  {
    code: 303,
    phrase: 'See Other'
  },
  {
    code: 304,
    phrase: 'Not Modified'
  },
  {
    code: 305,
    phrase: 'Use Proxy'
  },
  {
    code: 307,
    phrase: 'Temporary Redirect'
  },
  {
    code: 400,
    phrase: 'Bad Request'
  },
  {
    code: 401,
    phrase: 'Unauthorized'
  },
  {
    code: 402,
    phrase: 'Payment Required'
  },
  {
    code: 403,
    phrase: 'Forbidden'
  },
  {
    code: 404,
    phrase: 'Not Found'
  },
  {
    code: 405,
    phrase: 'Method Not Allowed'
  },
  {
    code: 406,
    phrase: 'Not Acceptable'
  },
  {
    code: 407,
    phrase: 'Proxy Authentication Required'
  },
  {
    code: 408,
    phrase: 'Request Timeout'
  },
  {
    code: 409,
    phrase: 'Conflict'
  },
  {
    code: 410,
    phrase: 'Gone'
  },
  {
    code: 411,
    phrase: 'Length Required'
  },
  {
    code: 412,
    phrase: 'Precondition Failed'
  },
  {
    code: 413,
    phrase: 'Payload Too Large'
  },
  {
    code: 414,
    phrase: 'URI Too Long'
  },
  {
    code: 415,
    phrase: 'Unsupported Media Type'
  },
  {
    code: 416,
    phrase: 'Range Not Satisfiable'
  },
  {
    code: 417,
    phrase: 'Expectation Failed'
  },
  {
    code: 418,
    phrase: "I'm a teapot"
  },
  {
    code: 426,
    phrase: 'Upgrade Required'
  },
  {
    code: 500,
    phrase: 'Internal Server Error'
  },
  {
    code: 501,
    phrase: 'Not Implemented'
  },
  {
    code: 502,
    phrase: 'Bad Gateway'
  },
  {
    code: 503,
    phrase: 'Service Unavailable'
  },
  {
    code: 504,
    phrase: 'Gateway Time-out'
  },
  {
    code: 505,
    phrase: 'HTTP Version Not Supported'
  },
  {
    code: 102,
    phrase: 'Processing'
  },
  {
    code: 207,
    phrase: 'Multi-Status'
  },
  {
    code: 226,
    phrase: 'IM Used'
  },
  {
    code: 308,
    phrase: 'Permanent Redirect'
  },
  {
    code: 422,
    phrase: 'Unprocessable Entity'
  },
  {
    code: 423,
    phrase: 'Locked'
  },
  {
    code: 424,
    phrase: 'Failed Dependency'
  },
  {
    code: 428,
    phrase: 'Precondition Required'
  },
  {
    code: 429,
    phrase: 'Too Many Requests'
  },
  {
    code: 431,
    phrase: 'Request Header Fields Too Large'
  },
  {
    code: 451,
    phrase: 'Unavailable For Legal Reasons'
  },
  {
    code: 506,
    phrase: 'Variant Also Negotiates'
  },
  {
    code: 507,
    phrase: 'Insufficient Storage'
  },
  {
    code: 511,
    phrase: 'Network Authentication Required'
  }
]
export const driverSteps = [
  { element: 'id-prediction-map-container', popover: { title: 'SamGIS', description: 'A quick tour about SamGIS functionality' } },
  { element: '#map', popover: { title: 'Webmap for ML prompt', description: 'Add here your machine learning prompt. Pay attention about markers and polygons outside the map bounds: you could get unexpected results' } },
  { element: '.leaflet-pm-icon-marker-include', popover: { title: '"Include" point prompt', description: 'add "include" points prompt (label 1) for machine learning request' } },
  { element: '.leaflet-pm-icon-marker-exclude', popover: { title: '"Exclude" point prompt', description: 'add "exclude" points prompt (label 0) for machine learning request' } },
  { element: '.leaflet-pm-icon-rectangle', popover: { title: '"Include" rectangle prompt', description: 'add "include" rectangles prompt for machine learning request' } },
  { element: "#id-button-submit", popover: { title: 'ML submit button', description: 'Machine learning submit button' } },
  { element: '.leaflet-control-layers-toggle', popover: { title: 'Map provider selector', description: 'select a different map provider' } },
  { element: '#id-map-info', popover: { title: 'map info', description: 'Section about various map info' } },
  { element: '#id-ml-request-prompt', popover: { title: 'ML prompt quest', description: 'Empty at beginning, this table will contain the machine learning prompt (points and rectangles) section' } }
]
export const lisaPartialDriverSteps: Array<DriveStep> = [
  {
    element: '#map',
    popover: {
      title: 'Geographic map',
      description: 'Choose here the map area where you can execute your machine learning prompt'
    }
  },
  {
    element: "#prompt-examples-array",
    popover: {title: 'Some prompt examples', description: 'A selection of prompt examples'}
  },
  {
    element: "#prompt-text-placeholder", popover: {
      title: 'Default prompt prefix',
      description: 'A good LLM prompt prefix tailored for photogrammetry, remote sensing and geomorphology (editable)'
    }
  },
  {
    element: "#prompt-text-llm-ref", popover: {
      title: 'Prompt text',
      description: 'Editable text area for the LLM text prompt (you can precompile it clicking on the examples)'
    }
  },
  {
    element: "#id-button-submit",
    popover: {title: 'LLM submit button', description: 'submit button for the LISA request'}
  },
  {
    element: '.leaflet-control-layers-toggle',
    popover: {title: 'Map provider selector', description: 'select a different map provider'}
  },
  {
    element: '#lisa-response-text',
    popover: {title: 'LISA response text', description: 'Output area with the LISA response text'}
  }
]