kopia lustrzana https://github.com/OpenDroneMap/WebODM
commit
3af0db1b84
|
@ -9,23 +9,28 @@ from django.utils.translation import gettext_lazy as _
|
||||||
algos = {
|
algos = {
|
||||||
'NDVI': {
|
'NDVI': {
|
||||||
'expr': '(N - R) / (N + R)',
|
'expr': '(N - R) / (N + R)',
|
||||||
'help': _('Normalized Difference Vegetation Index shows the amount of green vegetation.')
|
'help': _('Normalized Difference Vegetation Index shows the amount of green vegetation.'),
|
||||||
|
'range': (-1, 1)
|
||||||
},
|
},
|
||||||
'NDYI': {
|
'NDYI': {
|
||||||
'expr': '(G - B) / (G + B)',
|
'expr': '(G - B) / (G + B)',
|
||||||
'help': _('Normalized difference yellowness index (NDYI), best model variability in relative yield potential in Canola.')
|
'help': _('Normalized difference yellowness index (NDYI), best model variability in relative yield potential in Canola.'),
|
||||||
|
'range': (-1, 1)
|
||||||
},
|
},
|
||||||
'NDRE': {
|
'NDRE': {
|
||||||
'expr': '(N - Re) / (N + Re)',
|
'expr': '(N - Re) / (N + Re)',
|
||||||
'help': _('Normalized Difference Red Edge Index shows the amount of green vegetation of permanent or later stage crops.')
|
'help': _('Normalized Difference Red Edge Index shows the amount of green vegetation of permanent or later stage crops.'),
|
||||||
|
'range': (-1, 1)
|
||||||
},
|
},
|
||||||
'NDWI': {
|
'NDWI': {
|
||||||
'expr': '(G - N) / (G + N)',
|
'expr': '(G - N) / (G + N)',
|
||||||
'help': _('Normalized Difference Water Index shows the amount of water content in water bodies.')
|
'help': _('Normalized Difference Water Index shows the amount of water content in water bodies.'),
|
||||||
|
'range': (-1, 1)
|
||||||
},
|
},
|
||||||
'NDVI (Blue)': {
|
'NDVI (Blue)': {
|
||||||
'expr': '(N - B) / (N + B)',
|
'expr': '(N - B) / (N + B)',
|
||||||
'help': _('Normalized Difference Vegetation Index shows the amount of green vegetation.')
|
'help': _('Normalized Difference Vegetation Index shows the amount of green vegetation.'),
|
||||||
|
'range': (-1, 1)
|
||||||
},
|
},
|
||||||
'ENDVI':{
|
'ENDVI':{
|
||||||
'expr': '((N + G) - (2 * B)) / ((N + G) + (2 * B))',
|
'expr': '((N + G) - (2 * B)) / ((N + G) + (2 * B))',
|
||||||
|
@ -59,7 +64,8 @@ algos = {
|
||||||
},
|
},
|
||||||
'GNDVI':{
|
'GNDVI':{
|
||||||
'expr': '(N - G) / (N + G)',
|
'expr': '(N - G) / (N + G)',
|
||||||
'help': _('Green Normalized Difference Vegetation Index is similar to NDVI, but measures the green spectrum instead of red.')
|
'help': _('Green Normalized Difference Vegetation Index is similar to NDVI, but measures the green spectrum instead of red.'),
|
||||||
|
'range': (-1, 1)
|
||||||
},
|
},
|
||||||
'GRVI':{
|
'GRVI':{
|
||||||
'expr': 'N / G',
|
'expr': 'N / G',
|
||||||
|
|
|
@ -55,7 +55,9 @@ export default class Histogram extends React.Component {
|
||||||
|
|
||||||
const st = {
|
const st = {
|
||||||
min: minX.toFixed(3),
|
min: minX.toFixed(3),
|
||||||
max: maxX.toFixed(3)
|
max: maxX.toFixed(3),
|
||||||
|
minInput: minX.toFixed(3),
|
||||||
|
maxInput: maxX.toFixed(3)
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!this.state){
|
if (!this.state){
|
||||||
|
@ -235,6 +237,9 @@ export default class Histogram extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidUpdate(prevProps, prevState){
|
componentDidUpdate(prevProps, prevState){
|
||||||
|
if (prevState.min !== this.state.min) this.state.minInput = this.state.min;
|
||||||
|
if (prevState.max !== this.state.max) this.state.maxInput = this.state.max;
|
||||||
|
|
||||||
if (prevState.min !== this.state.min ||
|
if (prevState.min !== this.state.min ||
|
||||||
prevState.max !== this.state.max ||
|
prevState.max !== this.state.max ||
|
||||||
prevProps.colorMap !== this.props.colorMap ||
|
prevProps.colorMap !== this.props.colorMap ||
|
||||||
|
@ -271,6 +276,7 @@ export default class Histogram extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
handleChangeMax = (e) => {
|
handleChangeMax = (e) => {
|
||||||
|
this.setState({maxInput: e.target.value});
|
||||||
const val = parseFloat(e.target.value);
|
const val = parseFloat(e.target.value);
|
||||||
|
|
||||||
if (val >= this.state.min && val <= this.rangeX[1]){
|
if (val >= this.state.min && val <= this.rangeX[1]){
|
||||||
|
@ -279,6 +285,7 @@ export default class Histogram extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
handleChangeMin = (e) => {
|
handleChangeMin = (e) => {
|
||||||
|
this.setState({minInput: e.target.value});
|
||||||
const val = parseFloat(e.target.value);
|
const val = parseFloat(e.target.value);
|
||||||
|
|
||||||
if (val <= this.state.max && val >= this.rangeX[0]){
|
if (val <= this.state.max && val >= this.rangeX[0]){
|
||||||
|
@ -290,8 +297,8 @@ export default class Histogram extends React.Component {
|
||||||
return (<div className={"histogram " + (this.props.loading ? "disabled" : "")}>
|
return (<div className={"histogram " + (this.props.loading ? "disabled" : "")}>
|
||||||
<div ref={(domNode) => { this.hgContainer = domNode; }}>
|
<div ref={(domNode) => { this.hgContainer = domNode; }}>
|
||||||
</div>
|
</div>
|
||||||
<label>{_("Min:")}</label> <input onChange={this.handleChangeMin} type="number" className="form-control min-max" size={5} value={this.state.min} />
|
<label>{_("Min:")}</label> <input onChange={this.handleChangeMin} type="number" className="form-control min-max" size={5} value={this.state.minInput} />
|
||||||
<label>{_("Max:")}</label> <input onChange={this.handleChangeMax} type="number" className="form-control min-max" size={5} value={this.state.max} />
|
<label>{_("Max:")}</label> <input onChange={this.handleChangeMax} type="number" className="form-control min-max" size={5} value={this.state.maxInput} />
|
||||||
</div>);
|
</div>);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue