forked from stac-utils/stac-server
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathitems.js
46 lines (38 loc) · 1.38 KB
/
items.js
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
import dynamicTemplates from './dynamicTemplates.js'
export default function () {
const numberOfShards = process.env['ITEMS_INDICIES_NUM_OF_SHARDS']
const numberOfReplicas = process.env['ITEMS_INDICIES_NUM_OF_REPLICAS']
const config = {}
if (numberOfShards || numberOfReplicas) {
const index = {}
if (numberOfShards) index.number_of_shards = Number(numberOfShards)
if (numberOfReplicas) index.number_of_replicas = Number(numberOfReplicas)
config.settings = { index }
}
config.mappings = {
numeric_detection: false,
dynamic_templates: dynamicTemplates,
properties: {
geometry: { type: 'geo_shape' },
assets: { type: 'object', enabled: false },
links: { type: 'object', enabled: false },
id: { type: 'keyword' },
collection: { type: 'keyword' },
properties: {
type: 'object',
properties: {
// Common https://github.com/radiantearth/stac-spec/blob/master/item-spec/common-metadata.md
datetime: { type: 'date' },
start_datetime: { type: 'date' },
end_datetime: { type: 'date' },
created: { type: 'date' },
updated: { type: 'date' },
// Satellite Extension https://github.com/stac-extensions/sat
'sat:absolute_orbit': { type: 'integer' },
'sat:relative_orbit': { type: 'integer' }
}
}
}
}
return config
}