在谷歌地图上渲染温度

在谷歌地图上渲染温度

本文介绍了在谷歌地图上渲染温度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好......



我有(纬度,经度,温度)形式的多个数据点。我需要在地图上渲染温度。



最终结果应与此处的地图类似 []





我使用google热图为此,并且能够成功渲染数据点。然而问题是读数相距很远,因此每个读数都显示为断开的圆。我可以增加渲染数据点的半径来解决这个问题。



我的问题是:google热图是否用于正确渲染温度?或者我应该使用另一个api?





非常感谢任何建议。

Hi there...

I have a number of data points in the form of (latitude,longitude,temperature). I am required to render the temperature on a map.

The final result should be similar to the the map here http://peseta.jrc.ec.europa.eu/peseta1_ClimateModel.html[^]


I used google heat maps for this, and was able to render the data points successfully. The problem however is that the readings are far apart, so each reading appear as a disconnected circle. I could increase the radius of the rendered data points to solve this.

My question is: Is google heat map used to render the temperature correctly? or should I use another api?


Any advice is highly appreciated.

推荐答案

Public Structure PointXYZ
    Public X As Single
    Public Y As Single
    Public Z As Single
End Structure

Public Function GetZInterpolationForPoint(ByVal X As Single, ByVal Y As Single, ByVal KnownPoints() As PointXYZ, ByVal P As Single) As PointXYZ
    Dim I As Integer

    Dim Sum1 As Single = 0
    Dim Sum2 As Single = 0
    For I = 0 To KnownPoints.Length - 1
        Dim DX As Single = (KnownPoints(I).X - X) ^ 2
        Dim DY As Single = (KnownPoints(I).Y - Y) ^ 2
        Dim LP As Single = (DX + DY) ^ (0.5)
        Sum1 = Sum1 + KnownPoints(I).Z / (LP ^ P)
        Sum2 = Sum2 + (1.0 / (LP ^ P))
    Next

    Dim PT As New PointXYZ
    PT.X = X
    PT.Y = Y
    PT.Z = Sum1 / Sum2
    Return PT
End Function





您只需调用函数传递PointXYZ数组,该数组包含已知数据点,所需的x,y值,然后返回包含插值的PointXYZ结构。





Google热图却没有正确渲染插值。我想知道是否有办法在谷歌地图上呈现这些现有数据点。



You just call the function passing an array of PointXYZ which holds the known data points, the desired x,y value, and you get in return a PointXYZ structure containing the interpolated value.


Google heatmap however did not render the interpolated values correctly. I am wondering if there is a way to render these existing data points on top of google maps.


这篇关于在谷歌地图上渲染温度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 06:14