raain-model 2.6.10 → 2.6.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -12
- package/RELEASE_PROCESS.md +11 -6
- package/cartesian/CartesianMeasureValue.d.ts +40 -0
- package/{src/cartesian/CartesianMeasureValue.ts → cartesian/CartesianMeasureValue.js} +41 -73
- package/cartesian/CartesianMeasureValue.js.map +1 -0
- package/cartesian/CartesianTools.d.ts +32 -0
- package/{src/cartesian/CartesianTools.ts → cartesian/CartesianTools.js} +69 -130
- package/cartesian/CartesianTools.js.map +1 -0
- package/cartesian/CartesianValue.d.ts +14 -0
- package/cartesian/CartesianValue.js +17 -0
- package/cartesian/CartesianValue.js.map +1 -0
- package/cartesian/EarthMap.d.ts +5 -0
- package/cartesian/EarthMap.js +3 -0
- package/cartesian/EarthMap.js.map +1 -0
- package/cartesian/ICartesianMeasureValue.d.ts +23 -0
- package/cartesian/ICartesianMeasureValue.js +3 -0
- package/cartesian/ICartesianMeasureValue.js.map +1 -0
- package/cartesian/LatLng.d.ts +16 -0
- package/cartesian/LatLng.js +34 -0
- package/cartesian/LatLng.js.map +1 -0
- package/cartesian/RadarCartesianMeasureValue.d.ts +17 -0
- package/cartesian/RadarCartesianMeasureValue.js +22 -0
- package/cartesian/RadarCartesianMeasureValue.js.map +1 -0
- package/cartesian/RainCartesianMeasureValue.d.ts +17 -0
- package/cartesian/RainCartesianMeasureValue.js +23 -0
- package/cartesian/RainCartesianMeasureValue.js.map +1 -0
- package/cartesian/index.js +25 -0
- package/cartesian/index.js.map +1 -0
- package/gauge/GaugeMeasure.d.ts +20 -0
- package/gauge/GaugeMeasure.js +30 -0
- package/gauge/GaugeMeasure.js.map +1 -0
- package/gauge/GaugeNode.d.ts +85 -0
- package/{src/gauge/GaugeNode.ts → gauge/GaugeNode.js} +20 -48
- package/gauge/GaugeNode.js.map +1 -0
- package/gauge/GaugeNodeMap.d.ts +24 -0
- package/gauge/GaugeNodeMap.js +40 -0
- package/gauge/GaugeNodeMap.js.map +1 -0
- package/gauge/index.js +20 -0
- package/gauge/index.js.map +1 -0
- package/index.js +24 -0
- package/index.js.map +1 -0
- package/organization/EventNode.d.ts +22 -0
- package/organization/EventNode.js +30 -0
- package/organization/EventNode.js.map +1 -0
- package/organization/IVersion.js +3 -0
- package/organization/IVersion.js.map +1 -0
- package/organization/Link.d.ts +16 -0
- package/{src/organization/Link.ts → organization/Link.js} +15 -15
- package/organization/Link.js.map +1 -0
- package/organization/Measure.d.ts +22 -0
- package/organization/Measure.js +45 -0
- package/organization/Measure.js.map +1 -0
- package/organization/PeopleNode.d.ts +18 -0
- package/{src/organization/PeopleNode.ts → organization/PeopleNode.js} +10 -20
- package/organization/PeopleNode.js.map +1 -0
- package/organization/RaainNode.d.ts +91 -0
- package/{src/organization/RaainNode.ts → organization/RaainNode.js} +38 -63
- package/organization/RaainNode.js.map +1 -0
- package/organization/TeamNode.d.ts +63 -0
- package/{src/organization/TeamNode.ts → organization/TeamNode.js} +13 -36
- package/organization/TeamNode.js.map +1 -0
- package/organization/index.js +24 -0
- package/organization/index.js.map +1 -0
- package/package.json +1 -1
- package/polar/AbstractPolarMeasureValue.d.ts +29 -0
- package/{src/polar/AbstractPolarMeasureValue.ts → polar/AbstractPolarMeasureValue.js} +32 -58
- package/polar/AbstractPolarMeasureValue.js.map +1 -0
- package/polar/IPolarMeasureValue.d.ts +19 -0
- package/polar/IPolarMeasureValue.js +3 -0
- package/polar/IPolarMeasureValue.js.map +1 -0
- package/polar/MeasureValuePolarContainer.d.ts +19 -0
- package/{src/polar/MeasureValuePolarContainer.ts → polar/MeasureValuePolarContainer.js} +13 -29
- package/polar/MeasureValuePolarContainer.js.map +1 -0
- package/polar/PolarFilter.d.ts +16 -0
- package/polar/PolarFilter.js +45 -0
- package/polar/PolarFilter.js.map +1 -0
- package/polar/PolarMeasureValue.d.ts +51 -0
- package/{src/polar/PolarMeasureValue.ts → polar/PolarMeasureValue.js} +62 -125
- package/polar/PolarMeasureValue.js.map +1 -0
- package/polar/PolarMeasureValueMap.d.ts +45 -0
- package/{src/polar/PolarMeasureValueMap.ts → polar/PolarMeasureValueMap.js} +88 -165
- package/polar/PolarMeasureValueMap.js.map +1 -0
- package/polar/PolarValue.d.ts +10 -0
- package/polar/PolarValue.js +12 -0
- package/polar/PolarValue.js.map +1 -0
- package/polar/RadarPolarMeasureValue.d.ts +27 -0
- package/{src/polar/RadarPolarMeasureValue.ts → polar/RadarPolarMeasureValue.js} +21 -34
- package/polar/RadarPolarMeasureValue.js.map +1 -0
- package/polar/RainPolarMeasureValue.d.ts +20 -0
- package/polar/RainPolarMeasureValue.js +42 -0
- package/polar/RainPolarMeasureValue.js.map +1 -0
- package/polar/index.js +25 -0
- package/polar/index.js.map +1 -0
- package/quality/QualityPoint.d.ts +37 -0
- package/{src/quality/QualityPoint.ts → quality/QualityPoint.js} +33 -56
- package/quality/QualityPoint.js.map +1 -0
- package/quality/SpeedMatrix.d.ts +83 -0
- package/{src/quality/SpeedMatrix.ts → quality/SpeedMatrix.js} +76 -117
- package/quality/SpeedMatrix.js.map +1 -0
- package/quality/SpeedMatrixContainer.d.ts +102 -0
- package/{src/quality/SpeedMatrixContainer.ts → quality/SpeedMatrixContainer.js} +103 -210
- package/quality/SpeedMatrixContainer.js.map +1 -0
- package/quality/history/CartesianGaugeHistory.d.ts +15 -0
- package/quality/history/CartesianGaugeHistory.js +14 -0
- package/quality/history/CartesianGaugeHistory.js.map +1 -0
- package/quality/history/CartesianRainHistory.d.ts +9 -0
- package/quality/history/CartesianRainHistory.js +11 -0
- package/quality/history/CartesianRainHistory.js.map +1 -0
- package/quality/history/PositionHistory.d.ts +20 -0
- package/quality/history/PositionHistory.js +17 -0
- package/quality/history/PositionHistory.js.map +1 -0
- package/{src/quality/index.ts → quality/index.d.ts} +0 -3
- package/quality/index.js +26 -0
- package/quality/index.js.map +1 -0
- package/quality/position/Position.d.ts +22 -0
- package/quality/position/Position.js +50 -0
- package/quality/position/Position.js.map +1 -0
- package/quality/position/PositionValue.d.ts +9 -0
- package/quality/position/PositionValue.js +12 -0
- package/quality/position/PositionValue.js.map +1 -0
- package/quality/tools/QualityTools.d.ts +9 -0
- package/{src/quality/tools/QualityTools.ts → quality/tools/QualityTools.js} +17 -18
- package/quality/tools/QualityTools.js.map +1 -0
- package/radar/RadarMeasure.d.ts +19 -0
- package/radar/RadarMeasure.js +30 -0
- package/radar/RadarMeasure.js.map +1 -0
- package/radar/RadarNode.d.ts +30 -0
- package/{src/radar/RadarNode.ts → radar/RadarNode.js} +19 -41
- package/radar/RadarNode.js.map +1 -0
- package/radar/RadarNodeMap.d.ts +26 -0
- package/radar/RadarNodeMap.js +44 -0
- package/radar/RadarNodeMap.js.map +1 -0
- package/radar/index.js +20 -0
- package/radar/index.js.map +1 -0
- package/rain/MergeStrategy.d.ts +13 -0
- package/rain/MergeStrategy.js +11 -0
- package/rain/MergeStrategy.js.map +1 -0
- package/rain/RainComputation.d.ts +42 -0
- package/rain/RainComputation.js +65 -0
- package/rain/RainComputation.js.map +1 -0
- package/rain/RainComputationAbstract.d.ts +73 -0
- package/{src/rain/RainComputationAbstract.ts → rain/RainComputationAbstract.js} +69 -135
- package/rain/RainComputationAbstract.js.map +1 -0
- package/rain/RainComputationMap.d.ts +97 -0
- package/{src/rain/RainComputationMap.ts → rain/RainComputationMap.js} +22 -55
- package/rain/RainComputationMap.js.map +1 -0
- package/rain/RainComputationQuality.d.ts +40 -0
- package/{src/rain/RainComputationQuality.ts → rain/RainComputationQuality.js} +42 -80
- package/rain/RainComputationQuality.js.map +1 -0
- package/rain/RainMeasure.d.ts +17 -0
- package/rain/RainMeasure.js +18 -0
- package/rain/RainMeasure.js.map +1 -0
- package/rain/RainNode.d.ts +46 -0
- package/{src/rain/RainNode.ts → rain/RainNode.js} +72 -117
- package/rain/RainNode.js.map +1 -0
- package/rain/index.js +23 -0
- package/rain/index.js.map +1 -0
- package/.cursorignore +0 -10
- package/.github/workflows/ci.yml +0 -29
- package/LICENSE +0 -21
- package/RELEASE.md +0 -19
- package/specs/REQUIREMENTS.md +0 -42
- package/specs/TECHNICAL.md +0 -57
- package/specs/cartesian/Cartesian.spec.ts +0 -82
- package/specs/cartesian/CartesianTools.spec.ts +0 -121
- package/specs/gauge/Gauge.spec.ts +0 -39
- package/specs/organization/Organization.spec.ts +0 -38
- package/specs/polar/Polar.spec.ts +0 -267
- package/specs/quality/Position.spec.ts +0 -18
- package/specs/quality/QualityPointEdgeCases.spec.ts +0 -215
- package/specs/quality/QualityTools.spec.ts +0 -67
- package/specs/quality/SpeedMatrix.spec.ts +0 -214
- package/specs/radar/Radar.spec.ts +0 -129
- package/specs/rain/Rain.spec.ts +0 -334
- package/specs/tsconfig.json +0 -12
- package/src/cartesian/CartesianValue.ts +0 -26
- package/src/cartesian/EarthMap.ts +0 -5
- package/src/cartesian/ICartesianMeasureValue.ts +0 -22
- package/src/cartesian/LatLng.ts +0 -43
- package/src/cartesian/RadarCartesianMeasureValue.ts +0 -32
- package/src/cartesian/RainCartesianMeasureValue.ts +0 -32
- package/src/gauge/GaugeMeasure.ts +0 -42
- package/src/gauge/GaugeNodeMap.ts +0 -55
- package/src/organization/EventNode.ts +0 -43
- package/src/organization/Measure.ts +0 -61
- package/src/polar/IPolarMeasureValue.ts +0 -21
- package/src/polar/PolarFilter.ts +0 -46
- package/src/polar/PolarValue.ts +0 -16
- package/src/polar/RainPolarMeasureValue.ts +0 -57
- package/src/quality/history/CartesianGaugeHistory.ts +0 -23
- package/src/quality/history/CartesianRainHistory.ts +0 -15
- package/src/quality/history/PositionHistory.ts +0 -31
- package/src/quality/position/Position.ts +0 -59
- package/src/quality/position/PositionValue.ts +0 -15
- package/src/radar/RadarMeasure.ts +0 -41
- package/src/radar/RadarNodeMap.ts +0 -61
- package/src/rain/MergeStrategy.ts +0 -15
- package/src/rain/RainComputation.ts +0 -96
- package/src/rain/RainMeasure.ts +0 -25
- package/tsconfig.json +0 -17
- package/tslint.json +0 -79
- package/typedoc.json +0 -31
- /package/{src/cartesian/index.ts → cartesian/index.d.ts} +0 -0
- /package/{src/gauge/index.ts → gauge/index.d.ts} +0 -0
- /package/{src/index.ts → index.d.ts} +0 -0
- /package/{src/organization/IVersion.ts → organization/IVersion.d.ts} +0 -0
- /package/{src/organization/index.ts → organization/index.d.ts} +0 -0
- /package/{src/polar/index.ts → polar/index.d.ts} +0 -0
- /package/{src/radar/index.ts → radar/index.d.ts} +0 -0
- /package/{src/rain/index.ts → rain/index.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -79,20 +79,10 @@ npm test
|
|
|
79
79
|
npm run test:coverage
|
|
80
80
|
```
|
|
81
81
|
|
|
82
|
-
## 🤝 Contributing
|
|
83
|
-
|
|
84
|
-
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
|
|
85
|
-
|
|
86
82
|
## 📝 License
|
|
87
83
|
|
|
88
84
|
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
89
85
|
|
|
90
|
-
## 📅
|
|
91
|
-
|
|
92
|
-
See [Release notes](./RELEASE.md) for version history and changes.
|
|
93
|
-
|
|
94
|
-
## 🔗 Links
|
|
86
|
+
## 📅 Changelog
|
|
95
87
|
|
|
96
|
-
|
|
97
|
-
- [API Documentation](https://api.sandbox.radartorain.com/docs)
|
|
98
|
-
- [GitHub Issues](https://github.com/raainio/raain-model/issues)
|
|
88
|
+
See [Changelog](./CHANGELOG.md) for version history and changes.
|
package/RELEASE_PROCESS.md
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
- specs/*.md files
|
|
28
28
|
- CHANGELOG.md
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
3. **Version Control**
|
|
31
31
|
```bash
|
|
32
32
|
git add .
|
|
33
33
|
git commit -m "release: patch version X.Y.Z with [explanation of changes]"
|
|
@@ -37,17 +37,20 @@
|
|
|
37
37
|
```
|
|
38
38
|
Replace X.Y.Z with the actual version number and provide a clear explanation of changes.
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
4. **CI/CD Process**
|
|
41
|
+
- Monitor the CI pipeline at GitHub Actions
|
|
42
|
+
- The CI process will automatically:
|
|
43
|
+
- Run tests
|
|
44
|
+
- Build the package
|
|
45
|
+
- Publish to npm registry
|
|
46
|
+
- Verify the release appears on npm registry
|
|
41
47
|
|
|
42
48
|
### Important Notes
|
|
43
49
|
|
|
44
50
|
- Always run and verify tests before pushing
|
|
45
51
|
- Document all significant changes in the commit message
|
|
46
52
|
- Monitor the merge process for any conflicts
|
|
47
|
-
|
|
48
|
-
### Post-Release Verification
|
|
49
|
-
|
|
50
|
-
- Verify the release is properly tagged
|
|
53
|
+
- DO NOT manually publish to npm - this is handled by CI
|
|
51
54
|
|
|
52
55
|
### Version Management Best Practices
|
|
53
56
|
|
|
@@ -75,6 +78,8 @@
|
|
|
75
78
|
|
|
76
79
|
- Don't create tags with placeholder version numbers (X.Y.Z)
|
|
77
80
|
- Don't forget to push both commits and tags
|
|
81
|
+
- Don't manually publish to npm
|
|
82
|
+
- Don't bypass CI process
|
|
78
83
|
|
|
79
84
|
### Recovery Procedures
|
|
80
85
|
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ICartesianMeasureValue } from './ICartesianMeasureValue';
|
|
2
|
+
import { CartesianValue } from './CartesianValue';
|
|
3
|
+
import { LatLng } from './LatLng';
|
|
4
|
+
export declare class CartesianMeasureValue implements ICartesianMeasureValue {
|
|
5
|
+
protected cartesianValues: CartesianValue[];
|
|
6
|
+
protected limitPoints: [LatLng, LatLng];
|
|
7
|
+
constructor(json: {
|
|
8
|
+
cartesianValues: string | CartesianValue[];
|
|
9
|
+
limitPoints?: [LatLng, LatLng];
|
|
10
|
+
});
|
|
11
|
+
static From(obj: ICartesianMeasureValue | any): CartesianMeasureValue;
|
|
12
|
+
getCartesianValuesStringified(): string;
|
|
13
|
+
getCartesianValues(): CartesianValue[];
|
|
14
|
+
setCartesianValues(cartesianValues: CartesianValue[]): void;
|
|
15
|
+
setCartesianValuesAsString(s: string): void;
|
|
16
|
+
toJSON(options?: {
|
|
17
|
+
stringify: boolean;
|
|
18
|
+
}): any;
|
|
19
|
+
toJSONWithCartesianValuesStringified(): any;
|
|
20
|
+
getCartesianValue(json: {
|
|
21
|
+
lat: number;
|
|
22
|
+
lng: number;
|
|
23
|
+
}): CartesianValue;
|
|
24
|
+
getCartesianValueRounded(json: {
|
|
25
|
+
lat: number;
|
|
26
|
+
lng: number;
|
|
27
|
+
scale: LatLng;
|
|
28
|
+
}): CartesianValue;
|
|
29
|
+
setCartesianValue(json: {
|
|
30
|
+
lat: number;
|
|
31
|
+
lng: number;
|
|
32
|
+
value: number;
|
|
33
|
+
}): void;
|
|
34
|
+
getLimitPoints(options?: {
|
|
35
|
+
forceCompute: boolean;
|
|
36
|
+
}): [LatLng, LatLng];
|
|
37
|
+
setLimitPoints(point1: LatLng, point2: LatLng): void;
|
|
38
|
+
protected setCartesianValuesAsAny(cartesianValues: any): void;
|
|
39
|
+
protected computeLimits(): void;
|
|
40
|
+
}
|
|
@@ -1,88 +1,66 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
constructor(json: {
|
|
11
|
-
cartesianValues: string | CartesianValue[],
|
|
12
|
-
limitPoints?: [LatLng, LatLng]
|
|
13
|
-
}
|
|
14
|
-
) {
|
|
15
|
-
|
|
16
|
-
if (!json?.cartesianValues) {
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CartesianMeasureValue = void 0;
|
|
4
|
+
const CartesianValue_1 = require("./CartesianValue");
|
|
5
|
+
const LatLng_1 = require("./LatLng");
|
|
6
|
+
class CartesianMeasureValue {
|
|
7
|
+
constructor(json) {
|
|
8
|
+
var _a;
|
|
9
|
+
if (!(json === null || json === void 0 ? void 0 : json.cartesianValues)) {
|
|
17
10
|
throw new Error('CartesianMeasureValue needs cartesianValues');
|
|
18
11
|
}
|
|
19
|
-
|
|
20
12
|
this.setCartesianValuesAsAny(json.cartesianValues);
|
|
21
|
-
if (json.limitPoints
|
|
13
|
+
if (((_a = json.limitPoints) === null || _a === void 0 ? void 0 : _a.length) === 2) {
|
|
22
14
|
this.setLimitPoints(json.limitPoints[0], json.limitPoints[1]);
|
|
23
15
|
}
|
|
24
16
|
}
|
|
25
|
-
|
|
26
|
-
static From(obj: ICartesianMeasureValue | any): CartesianMeasureValue {
|
|
17
|
+
static From(obj) {
|
|
27
18
|
const created = new CartesianMeasureValue({
|
|
28
19
|
cartesianValues: [],
|
|
29
20
|
});
|
|
30
|
-
|
|
31
21
|
if (typeof obj.cartesianValues !== 'undefined') {
|
|
32
22
|
created.setCartesianValuesAsAny(obj.cartesianValues);
|
|
33
23
|
}
|
|
34
|
-
|
|
35
24
|
if (Array.isArray(obj.limitPoints) && obj.limitPoints.length === 2) {
|
|
36
25
|
created.setLimitPoints(obj.limitPoints[0], obj.limitPoints[1]);
|
|
37
26
|
}
|
|
38
|
-
|
|
39
27
|
return created;
|
|
40
28
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
return JSON.stringify({cartesianValues: this.cartesianValues});
|
|
29
|
+
getCartesianValuesStringified() {
|
|
30
|
+
return JSON.stringify({ cartesianValues: this.cartesianValues });
|
|
44
31
|
}
|
|
45
|
-
|
|
46
|
-
getCartesianValues(): CartesianValue[] {
|
|
32
|
+
getCartesianValues() {
|
|
47
33
|
return this.cartesianValues;
|
|
48
34
|
}
|
|
49
|
-
|
|
50
|
-
setCartesianValues(cartesianValues: CartesianValue[]): void {
|
|
35
|
+
setCartesianValues(cartesianValues) {
|
|
51
36
|
this.cartesianValues = cartesianValues;
|
|
52
37
|
}
|
|
53
|
-
|
|
54
|
-
setCartesianValuesAsString(s: string): void {
|
|
38
|
+
setCartesianValuesAsString(s) {
|
|
55
39
|
let values = JSON.parse(s);
|
|
56
40
|
if (values.cartesianValues) {
|
|
57
41
|
values = values.cartesianValues;
|
|
58
42
|
}
|
|
59
|
-
|
|
60
43
|
if (Array.isArray(values)) {
|
|
61
44
|
this.cartesianValues = [];
|
|
62
45
|
values.forEach(v => {
|
|
63
|
-
this.cartesianValues.push(new CartesianValue(v));
|
|
46
|
+
this.cartesianValues.push(new CartesianValue_1.CartesianValue(v));
|
|
64
47
|
});
|
|
65
48
|
}
|
|
66
49
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
let cartesianValues: any = this.cartesianValues;
|
|
50
|
+
toJSON(options = { stringify: false }) {
|
|
51
|
+
let cartesianValues = this.cartesianValues;
|
|
71
52
|
if (options.stringify) {
|
|
72
|
-
cartesianValues = JSON.stringify(this.cartesianValues)
|
|
53
|
+
cartesianValues = JSON.stringify(this.cartesianValues);
|
|
73
54
|
}
|
|
74
|
-
|
|
75
55
|
return {
|
|
76
56
|
cartesianValues,
|
|
77
57
|
limitPoints: this.getLimitPoints(),
|
|
78
58
|
};
|
|
79
59
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
return this.toJSON({stringify: true});
|
|
60
|
+
toJSONWithCartesianValuesStringified() {
|
|
61
|
+
return this.toJSON({ stringify: true });
|
|
83
62
|
}
|
|
84
|
-
|
|
85
|
-
getCartesianValue(json: { lat: number, lng: number }): CartesianValue {
|
|
63
|
+
getCartesianValue(json) {
|
|
86
64
|
for (const value of this.cartesianValues) {
|
|
87
65
|
if (value.lat === json.lat && value.lng === json.lng) {
|
|
88
66
|
return value;
|
|
@@ -90,12 +68,7 @@ export class CartesianMeasureValue implements ICartesianMeasureValue {
|
|
|
90
68
|
}
|
|
91
69
|
return null;
|
|
92
70
|
}
|
|
93
|
-
|
|
94
|
-
getCartesianValueRounded(json: {
|
|
95
|
-
lat: number,
|
|
96
|
-
lng: number,
|
|
97
|
-
scale: LatLng
|
|
98
|
-
}): CartesianValue {
|
|
71
|
+
getCartesianValueRounded(json) {
|
|
99
72
|
for (const value of this.cartesianValues) {
|
|
100
73
|
const latRounded1 = Math.round(json.lat / json.scale.lat) * json.scale.lat;
|
|
101
74
|
const lngRounded1 = Math.round(json.lng / json.scale.lng) * json.scale.lng;
|
|
@@ -107,40 +80,35 @@ export class CartesianMeasureValue implements ICartesianMeasureValue {
|
|
|
107
80
|
}
|
|
108
81
|
return null;
|
|
109
82
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
this.cartesianValues.push(new CartesianValue(json));
|
|
83
|
+
setCartesianValue(json) {
|
|
84
|
+
this.cartesianValues.push(new CartesianValue_1.CartesianValue(json));
|
|
113
85
|
}
|
|
114
|
-
|
|
115
|
-
getLimitPoints(options = {forceCompute: false}): [LatLng, LatLng] {
|
|
86
|
+
getLimitPoints(options = { forceCompute: false }) {
|
|
116
87
|
if (options.forceCompute || !this.limitPoints || this.limitPoints.length !== 2) {
|
|
117
88
|
this.computeLimits();
|
|
118
89
|
}
|
|
119
90
|
return this.limitPoints;
|
|
120
91
|
}
|
|
121
|
-
|
|
122
|
-
setLimitPoints(point1: LatLng, point2: LatLng) {
|
|
92
|
+
setLimitPoints(point1, point2) {
|
|
123
93
|
this.limitPoints = [
|
|
124
|
-
new LatLng({lat: point1.lat, lng: point1.lng}),
|
|
125
|
-
new LatLng({lat: point2.lat, lng: point2.lng})
|
|
94
|
+
new LatLng_1.LatLng({ lat: point1.lat, lng: point1.lng }),
|
|
95
|
+
new LatLng_1.LatLng({ lat: point2.lat, lng: point2.lng })
|
|
126
96
|
];
|
|
127
97
|
}
|
|
128
|
-
|
|
129
|
-
protected setCartesianValuesAsAny(cartesianValues: any) {
|
|
98
|
+
setCartesianValuesAsAny(cartesianValues) {
|
|
130
99
|
if (typeof cartesianValues === 'string') {
|
|
131
100
|
this.setCartesianValuesAsString(cartesianValues);
|
|
132
|
-
}
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
133
103
|
this.setCartesianValues(cartesianValues);
|
|
134
104
|
}
|
|
135
105
|
}
|
|
136
|
-
|
|
137
|
-
protected computeLimits() {
|
|
106
|
+
computeLimits() {
|
|
138
107
|
this.limitPoints = undefined;
|
|
139
|
-
let p1Lat
|
|
140
|
-
let p1Lng
|
|
141
|
-
let p2Lat
|
|
142
|
-
let p2Lng
|
|
143
|
-
|
|
108
|
+
let p1Lat;
|
|
109
|
+
let p1Lng;
|
|
110
|
+
let p2Lat;
|
|
111
|
+
let p2Lng;
|
|
144
112
|
for (const cartesianValue of this.cartesianValues) {
|
|
145
113
|
if (typeof p1Lat === 'undefined' || cartesianValue.lat < p1Lat) {
|
|
146
114
|
p1Lat = cartesianValue.lat;
|
|
@@ -155,11 +123,11 @@ export class CartesianMeasureValue implements ICartesianMeasureValue {
|
|
|
155
123
|
p2Lng = cartesianValue.lng;
|
|
156
124
|
}
|
|
157
125
|
}
|
|
158
|
-
|
|
159
126
|
if (typeof p1Lat !== 'undefined' && typeof p1Lng !== 'undefined' &&
|
|
160
127
|
typeof p2Lat !== 'undefined' && typeof p2Lng !== 'undefined') {
|
|
161
|
-
this.setLimitPoints(new LatLng({lat: p1Lat, lng: p1Lng}),
|
|
162
|
-
new LatLng({lat: p2Lat, lng: p2Lng}));
|
|
128
|
+
this.setLimitPoints(new LatLng_1.LatLng({ lat: p1Lat, lng: p1Lng }), new LatLng_1.LatLng({ lat: p2Lat, lng: p2Lng }));
|
|
163
129
|
}
|
|
164
130
|
}
|
|
165
131
|
}
|
|
132
|
+
exports.CartesianMeasureValue = CartesianMeasureValue;
|
|
133
|
+
//# sourceMappingURL=CartesianMeasureValue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CartesianMeasureValue.js","sourceRoot":"","sources":["../../src/cartesian/CartesianMeasureValue.ts"],"names":[],"mappings":";;;AACA,qDAAgD;AAChD,qCAAgC;AAEhC,MAAa,qBAAqB;IAK9B,YAAY,IAGC;;QAGT,IAAI,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,eA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,KAAK,KAAK,WAAW,IAAI,OAAO,KAAK,KAAK,WAAW;YAC5D,OAAO,KAAK,KAAK,WAAW,IAAI,OAAO,KAAK,KAAK,WAAW,EAAE,CAAC;YAC/D,IAAI,CAAC,cAAc,CAAC,IAAI,eAAM,CAAC,EAAC,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAC,CAAC,EACpD,IAAI,eAAM,CAAC,EAAC,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAC,CAAC,CAAC,CAAC;QAC9C,CAAC;IACL,CAAC;CACJ;AAhKD,sDAgKC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { LatLng } from './LatLng';
|
|
2
|
+
import { CartesianValue } from './CartesianValue';
|
|
3
|
+
import { EarthMap } from './EarthMap';
|
|
4
|
+
export declare class CartesianTools {
|
|
5
|
+
scale: number;
|
|
6
|
+
earthMap: EarthMap;
|
|
7
|
+
static DEFAULT_SCALE: number;
|
|
8
|
+
constructor(scale?: number, earthMap?: EarthMap);
|
|
9
|
+
static RoundLatLng(latOrLng: number, scale?: number, needPrecision?: boolean): number;
|
|
10
|
+
static CreateLatLng(latLng: {
|
|
11
|
+
lat: number;
|
|
12
|
+
lng: number;
|
|
13
|
+
}): LatLng;
|
|
14
|
+
static LimitWithPrecision(latOrLng: number, precision?: number): number;
|
|
15
|
+
static IsEqualsLatLng(latOrLng1: number, latOrLng2: number, cartesianStep?: number): boolean;
|
|
16
|
+
static IsAroundLatLng(latLngCenter: LatLng, latLngAround: LatLng, stepRange: number, cartesianStep?: number): boolean;
|
|
17
|
+
static IsNotAroundLatLng(latLngCenter: LatLng, latLngAround: LatLng, stepRange: number, cartesianStep?: number): boolean;
|
|
18
|
+
static DegToRad(azimuthInDegrees: number): number;
|
|
19
|
+
static GetAzimuthRad(angleInDegrees: number): number;
|
|
20
|
+
static ComputeLatSteps(cartesianValues: CartesianValue[]): number[];
|
|
21
|
+
static ComputeLngSteps(cartesianValues: CartesianValue[]): number[];
|
|
22
|
+
static LogCartesianValues(cartesianValues: CartesianValue[], logger?: Console): void;
|
|
23
|
+
static UniqNum(a: number[]): number[];
|
|
24
|
+
static UniqStr(a: number[]): number[];
|
|
25
|
+
static GetDistanceFromLatLngInKm(latLng1: LatLng, latLng2: LatLng): number;
|
|
26
|
+
static VincentyDistance(latLng1: LatLng, latLng2: LatLng): number;
|
|
27
|
+
protected static LabelWithSign(val: number): string;
|
|
28
|
+
getScaleLatLng(latLng: LatLng, latDirection?: number): LatLng;
|
|
29
|
+
getScaleLatLngFromEarth(fromLatLng: LatLng): LatLng;
|
|
30
|
+
getLatLngFromEarthMap(fromLatLng: LatLng): LatLng;
|
|
31
|
+
buildLatLngEarthMap(): EarthMap;
|
|
32
|
+
}
|