Skip to content

Commit

Permalink
克里金优化
Browse files Browse the repository at this point in the history
  • Loading branch information
jiawanlong committed Dec 31, 2024
1 parent 6431f82 commit 42da84c
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 24 deletions.
43 changes: 19 additions & 24 deletions examples/cesiumEx/8.1.1、kriging.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<script src="./kriging.js"></script>
<script src="./rainbowvis.js"></script>
<script src="./drawKriging.js"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
</head>

<body style="margin: 0; overflow: hidden; background: #fff; width: 100%; height: 100%; position: absolute; top: 0">
Expand All @@ -20,30 +21,24 @@
<script type="text/javascript">
Cesium.Ion.defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI3ZjQ5ZGUzNC1jNWYwLTQ1ZTMtYmNjYS05YTY4ZTVmN2I2MDkiLCJpZCI6MTE3MTM4LCJpYXQiOjE2NzY0NDUyODB9.ZaNSBIfc1sGLhQd_xqhiSsc0yr8oS0wt1hAo9gbke6M'
const viewer = new Cesium.Viewer('map', {});
viewer.scene.debugShowFramesPerSecond = true;
viewer.scene.globe.depthTestAgainstTerrain = true;
viewer.imageryLayers.remove(viewer.imageryLayers.get(0));
var imageryProvider = new Cesium.SingleTileImageryProvider({
"url": "./world_b.jpg",
})
viewer.imageryLayers.addImageryProvider(imageryProvider)


var polygons = turf.randomPolygon(1, { bbox: [-120, 20, -80, 40] })
var points = turf.randomPoint(100, { bbox: turf.bbox(polygons.features[0]) })
points.features.forEach(element => {
element.properties.temperature = parseInt(Math.random() * 300)
});

let krigingMap = drawKriging(points, polygons.features[0].geometry.coordinates, {
"propname": 'temperature',
width: 0.1,
alpha: 0.5
});

// 删除
// viewer.scene.primitives.remove(krigingMap)


axios.get('https://geo.datav.aliyun.com/areas_v3/bound/100000.json')
.then((response) => {
console.log(response)
var polygons = response.data;
var points = turf.randomPoint(100, { bbox:[100, 20, 130, 40] })
points.features.forEach(element => {
element.properties.temperature = parseInt(Math.random() * 300)
});
let krigingMap = drawKriging(points, polygons.features[0].geometry.coordinates[0], {
"propname": 'temperature',
width: 0.1,
alpha: 0.5
});
})
viewer.camera.setView({
destination: Cesium.Cartesian3.fromDegrees(100, 30, 4025692.0)
});
</script>
</body>

Expand Down
Binary file modified examples/cesiumEx/img/8.1.1、kriging.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions examples/cesiumEx/生成卫星czml.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import tle2czml
tles = '''GF-7
1 44703U 19072A 23082.22061530 .00008228 00000-0 36887-3 0 9996
2 44703 97.3775 160.8515 0003845 242.8135 202.2190 15.21469856187930
GF-5
1 49122U 21079A 23068.20121834 .00000896 00000-0 20629-3 0 9992
2 49122 98.2229 145.0474 0002723 56.9951 303.1523 14.57723131 79845
GF-6
1 43484U 18048A 23082.16426080 .00001579 00000-0 23368-3 0 9993
2 43484 97.9025 162.1114 0010008 30.7896 329.3896 14.76502953258967
GF-3
1 41727U 16049A 23082.09017383 -.00001715 00000-0 -50772-3 0 9997
2 41727 98.4092 91.3617 0001194 110.0731 250.0634 14.42188914348254
GAOFEN 1
1 39150U 13018A 22047.13058851 .00000399 00000+0 64218-4 0 9992
2 39150 97.8040 117.2355 0018056 314.6859 45.2886 14.76596516474837
GAOFEN 2
1 40118U 14049A 22047.06986400 .00000597 00000+0 84233-4 0 9994
2 40118 97.7776 119.3496 0007374 2.5437 357.5821 14.80700356405132
ZY-1 02D
1 44528U 19059A 23129.46540019 .00000296 00000+0 11796-3 0 9996
2 44528 98.4473 206.0743 0000910 108.0385 252.0917 14.35402632191554
HAIYANG-2B
1 43655U 18081A 23129.51066396 .00000029 00000+0 71463-4 0 9999
2 43655 99.3406 138.7347 0001770 61.7006 298.4323 13.79303637228504
HAIYANG-2D
1 48621U 21043A 23129.48110233 -.00000021 00000+0 54421-4 0 9993
2 48621 65.9972 249.7279 0008947 254.2063 105.8008 13.83377039 99634
CZ-4B DEB
1 48622U 21043B 23128.63238305 .00000145 00000+0 19397-3 0 9999
2 48622 65.8994 234.5230 0018179 50.6771 309.5906 13.86955426 99768
CZ-4B DEB
1 48623U 21043C 23129.39453621 .00000188 00000+0 22076-3 0 9999
2 48623 66.0815 238.8716 0036389 233.6114 126.1600 13.89113523100020
CZ-4B R/B
1 48624U 21043D 23129.30332602 -.00000037 00000+0 21778-4 0 9999
2 48624 66.0638 139.1087 0165846 319.6608 39.2272 14.20943009102298
CZ-4B DEB
1 48625U 21043E 23124.08457011 .00002145 00000+0 17660-2 0 9996
2 48625 66.1704 256.8178 0045338 214.9286 144.8811 13.90735305 99318
HAIYANG-1C
1 43609U 18068A 23129.47384458 .00000212 00000+0 90842-4 0 9996
2 43609 98.4178 200.6124 0009805 220.5463 139.4994 14.34234517244441
CZ-2C R/B
1 43610U 18068B 23129.42342300 .00000803 00000+0 19043-3 0 9992
2 43610 98.6508 270.1466 0088835 214.0050 145.5434 14.54599017247804
'''
czml = tle2czml.tles_to_czml(tles)
print(czml)
fo = open("test1.czml", "w")
fo.write(czml)
fo.close()
Binary file added examples/threeEx/3602.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/threeEx/3603.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/threeEx/3604.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 42da84c

Please sign in to comment.