Skip to content

Commit 6274d9c

Browse files
committed
Add pricing.md
1 parent e3b64f7 commit 6274d9c

File tree

2 files changed

+85
-0
lines changed

2 files changed

+85
-0
lines changed

website/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
!overview.md
22
!background.md
3+
!pricing.md
34

45
node_modules
56
.quarto

website/docs/pricing.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Pricing
2+
3+
This project is creating free and open-source software under the MIT license.
4+
There are plenty of ways to run the workflow locally after downloading the [data](/background-gfm.html#data).
5+
However, the workflow can be also be executed with [openEO at EODC](https://editor.openeo.org/?server=openeo.eodc.eu%2Fopeneo%2F1.2.0%2F) by enabling experimental processes and searching for 'rqadeforestation'.
6+
A preliminary price estimation can be calculated using the following tool:
7+
8+
## openEO price calculator
9+
10+
<div>
11+
12+
<!-- added HTML form + script -->
13+
<form id="pricing-form" onsubmit="return false;" style="margin-top:1rem;">
14+
<label>
15+
Equi7 tiles:
16+
<input id="tiles" type="number" min="0" step="1" value="1" style="width:6rem;">
17+
</label>
18+
<br style="line-height:0.6;">
19+
<label>
20+
Start date:
21+
<input id="start" type="date">
22+
</label>
23+
<label style="margin-left:1rem;">
24+
End date:
25+
<input id="end" type="date">
26+
</label>
27+
<div style="margin-top:0.5rem;">
28+
Price: <output id="price">0.00</output>
29+
</div>
30+
</form>
31+
32+
<script>
33+
(function(){
34+
const tilesEl = document.getElementById('tiles');
35+
const startEl = document.getElementById('start');
36+
const endEl = document.getElementById('end');
37+
const priceEl = document.getElementById('price');
38+
39+
const minDate = '2014-01-01';
40+
const today = new Date();
41+
const yyyy = today.getFullYear();
42+
const mm = String(today.getMonth()+1).padStart(2,'0');
43+
const dd = String(today.getDate()).padStart(2,'0');
44+
const todayStr = `${yyyy}-${mm}-${dd}`;
45+
46+
startEl.min = minDate;
47+
endEl.min = minDate;
48+
startEl.max = todayStr;
49+
endEl.max = todayStr;
50+
51+
startEl.value = minDate;
52+
endEl.value = todayStr;
53+
54+
function parseDateInput(el){
55+
const v = el.value;
56+
if(!v) return null;
57+
const d = new Date(v + 'T00:00:00Z');
58+
return isNaN(d) ? null : d;
59+
}
60+
61+
function compute(){
62+
const tiles = Number(tilesEl.value) || 0;
63+
const start = parseDateInput(startEl);
64+
const end = parseDateInput(endEl);
65+
if(!start || !end || end < start){
66+
priceEl.textContent = '0.00';
67+
return;
68+
}
69+
// duration in years (approx)
70+
const msPerYear = 1000 * 60 * 60 * 24 * 365.25;
71+
const years = (end - start) / msPerYear;
72+
const product = tiles * years;
73+
priceEl.textContent = product.toFixed(2);
74+
}
75+
76+
tilesEl.addEventListener('input', compute);
77+
startEl.addEventListener('change', compute);
78+
endEl.addEventListener('change', compute);
79+
80+
// initial compute
81+
compute();
82+
})();
83+
</script>
84+
</div>

0 commit comments

Comments
 (0)