private static SpatialValue CreateSpatialValue(TIM tim, byte order, int value)
{
var dlvs = tim.Items.Where(x => x.GetType() == typeof (DLV));
var matchingDlv = dlvs.ElementAtOrDefault(order) as DLV;
if (matchingDlv == null)
return null;
var ddis = DdiLoader.Ddis;
var resolution = 1d;
if (matchingDlv.A != null && ddis.ContainsKey(Convert.ToInt32(matchingDlv.A, 16)))
resolution = ddis[Convert.ToInt32(matchingDlv.A, 16)].Resolution;
var spatialValue = new SpatialValue
{
Id = order,
Dlv = matchingDlv,
Value = value * resolution,
};
return spatialValue;
}