Kriging

GeoGlobe.Visuals.Custom. Kriging

等值面图层

Constructor

new Kriging(options)

Author:
  • liuck
Example
//构造地图对象
 var map = new GeoGlobe.Map({
    style: Cfg.style,
	container: 'map',
	zoom: 8,
	bearing: 0,
	pitch: 0,
	units: "degrees",
	center: [109.6710, 19.1517],
	renderWorldCopies: true
 });
 //构造可视化定制图层
 var custom = new GeoGlobe.Visuals.Custom();
 //添加到地图中
 custom.addTo(map);
 //构造等值面降雨分布图层
 var kriging = new GeoGlobe.Visuals.Custom.Kriging({
	id: "kriging_1",
    data: [ { "type": "Feature", "properties": { "value": 100 }, "geometry": { "type": "Point", "coordinates": [ 110.291748046875, 19.864893620513147 ] } }, { "type": "Feature", "properties": {"value": 150}, "geometry": { "type": "Point", "coordinates": [ 110.71746826171875, 19.836476416934697 ] } }, { "type": "Feature", "properties": {"value": 200}, "geometry": { "type": "Point", "coordinates": [ 110.70098876953125, 19.58308121001252 ] } }, { "type": "Feature", "properties": {"value": 170}, "geometry": { "type": "Point", "coordinates": [ 110.05828857421875, 19.702071807656818 ] } }, { "type": "Feature", "properties": {"value": 100}, "geometry": { "type": "Point", "coordinates": [ 110.45379638671873, 19.611543503814232 ] } }, { "type": "Feature", "properties": {"value": 10}, "geometry": { "type": "Point", "coordinates": [ 109.70947265625, 19.815806165386956 ] } }, { "type": "Feature", "properties": {"value": 0}, "geometry": { "type": "Point", "coordinates": [ 109.64630126953125, 19.18148958198376 ] } }, { "type": "Feature", "properties": {"value": 0}, "geometry": { "type": "Point", "coordinates": [ 109.566650390625, 19.49248592618279 ] } }, { "type": "Feature", "properties": {"value": 20}, "geometry": { "type": "Point", "coordinates": [ 109.34417724609375, 19.686556300019273 ] } }, { "type": "Feature", "properties": {"value": 13}, "geometry": { "type": "Point", "coordinates": [ 109.72320556640625, 19.663280219987662 ] } }, { "type": "Feature", "properties": {"value": 15}, "geometry": { "type": "Point", "coordinates": [ 110.33020019531248, 18.802318121688117 ] } }, { "type": "Feature", "properties": {"value": 160}, "geometry": { "type": "Point", "coordinates": [ 110.41259765625, 18.95824648598139 ] } }, { "type": "Feature", "properties": {"value": 190}, "geometry": { "type": "Point", "coordinates": [ 110.203857421875, 18.919278008397874 ] } }, { "type": "Feature", "properties": {"value": 210}, "geometry": { "type": "Point", "coordinates": [ 109.5941162109375, 18.859508700693762 ] } }, { "type": "Feature", "properties": {"value": 130}, "geometry": { "type": "Point", "coordinates": [ 109.73693847656248, 18.87510275035649 ] } }, { "type": "Feature", "properties": {"value": 250}, "geometry": { "type": "Point", "coordinates": [ 109.951171875, 19.06471383653978 ] } }, { "type": "Feature", "properties": {"value": 220}, "geometry": { "type": "Point", "coordinates": [ 109.28375244140625, 18.968636543402223 ] } }, { "type": "Feature", "properties": {"value": 10}, "geometry": { "type": "Point", "coordinates": [ 108.82507324218748, 18.643642706975996 ] } }, { "type": "Feature", "properties": {"value": 0}, "geometry": { "type": "Point", "coordinates": [ 109.33868408203125, 18.315418308852805 ] } }, { "type": "Feature", "properties": {"value": 5}, "geometry": { "type": "Point", "coordinates": [ 109.55841064453123, 18.260653356758375 ] } }, { "type": "Feature", "properties": {"value": 13}, "geometry": { "type": "Point", "coordinates": [ 109.5721435546875, 18.380592091462194 ] } }, { "type": "Feature", "properties": {"value": 30}, "geometry": { "type": "Point", "coordinates": [ 109.6710205078125, 18.346704792867193 ] } }, { "type": "Feature", "properties": {"value": 70}, "geometry": { "type": "Point", "coordinates": [ 108.74542236328125, 19.22039646558873 ] } } ],
    visibility: true,
    autoRedraw: true,
    rendererOptions: {
    	krigingModel:'exponential',//还可选'gaussian','spherical'
        krigingSigma2:0,
        krigingAlpha:100,
        krigingSize:100,
        opacity: 0.31,
        colors: [
        	"#006837", "#1a9850", "#66bd63", "#a6d96a", "#d9ef8b", "#ffffbf", "#fee08b", "#fdae61", "#f46d43", "#d73027", "#a50026"
        ]
    }
    boundary: {   //海南省的边界轮廓面
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [110.68506920700003, 20.15330638200004],
            [110.78834069100014, 20.010402736000202],
            [110.9345809250002, 19.995062567000048],
            [111.00001061300009, 19.72166575700004],
            [110.87647545700008, 19.539780992000203],
            [110.6982528000002, 19.416937567000048],
            [110.56324303500014, 19.055650132000153],
            [110.46558678500014, 18.881903387000165],
            [110.4267684250002, 18.680894273000092],
            [110.27084394600013, 18.668158270000134],
            [110.10328209700026, 18.539374091000127],
            [110.05258222700013, 18.390204169000157],
            [109.74610436300003, 18.395900783000144],
            [109.6772567070002, 18.245062567000048],
            [109.56804446700016, 18.193182684000135],
            [109.4399520190002, 18.288967190000164],
            [109.21810957100024, 18.305650132000125],
            [109.00074303500014, 18.36717357000009],
            [108.79558353000004, 18.486558335000154],
            [108.69499759200028, 18.504828192000133],
            [108.69361412900014, 18.71987539300008],
            [108.62745201900003, 18.835882880000128],
            [108.65381920700003, 18.92104726800011],
            [108.61524498800009, 19.101629950000216],
            [108.63168379000024, 19.286281643000166],
            [108.94076582100013, 19.51410553600016],
            [109.01587975400014, 19.60126373900019],
            [109.15650475400003, 19.649644273000092],
            [109.16684004000012, 19.80548737200013],
            [109.3037215500002, 19.921698309000135],
            [109.46501712300028, 19.834051825000216],
            [109.52702884200016, 19.951361395000163],
            [109.71900475400014, 20.010646877000056],
            [110.08961022200015, 19.97809479400007],
            [110.15699303500026, 20.067368882000125],
            [110.26099694100026, 20.033148505000042],
            [110.38298587300017, 20.081040757000153],
            [110.5693465500002, 20.079779364000046],
            [110.68506920700003, 20.15330638200004]
          ]
        ]
      }
    }
 });
 //添加到可视化定制图层
 kriging.addTo(custom);
 //绘制
 custom.render();
Parameters:
Name Type Description
options Object
Properties
Name Type Description
id String 图层id
data Array 数据,GeoJSON结构的features数组
visibility Boolean 图层默认是否显示
autoRedraw Boolean 当地图漫游操作后是否自动更新
boundary boundary 需要分析计算的边界面,一般是省市县的边界面,GeoJSON结构的feature
rendererOptions Object 渲染配置
Properties
Name Type Description
krigingModel Number 分析计算的模式,默认'exponential',还可选'gaussian','spherical'
krigingSigma2 Number 模型的Sigma参数
krigingAlpha Number 模型的Alpha参数
krigingSize Number 格网化的粒度
opacity Number 绘制粒子的不透明度
colors Array 颜色域

Members

boundary :object

边界轮廓面
Type:
  • object

canvas :Object

画布
Type:
  • Object

canvasContext :Object

画布2d上下文
Type:
  • Object

Methods

addTo(custom)

关联可视化定制图层对象
Parameters:
Name Type Description
custom GeoGlobe.Visuals.Custom 可视化定制图层对象

clearCanvas()

画布清空

destroy()

画布销毁

draw()

图层绘制

initialize(options)

构造函数
Parameters:
Name Type Description
options Object 参数对象

onMove()

图层(地图)移动时触发

onMoveEnd()

图层(地图)移动结束时触发

onResize()

图层自适应

redraw()

图层重绘

render()

渲染图层

setData(data)

数据的处理
Parameters:
Name Type Description
data Array 数据

setVisible(visibility)

图层的显示与隐藏
Parameters:
Name Type Description
visibility Boolean 可见性

stopDraw()

停止绘制