internal static System.Collections.Generic.Dictionary<string, string> ToDictionary(GeometrySurfaceAnalystParameters geometrySurfaceAnalystParams)
{
System.Collections.Generic.Dictionary<string, string> dict = new System.Collections.Generic.Dictionary<string, string>();
if (geometrySurfaceAnalystParams.Points != null && geometrySurfaceAnalystParams.Points.Count > 0)
{
List<string> ps = new List<string>();
foreach (Point2D p in geometrySurfaceAnalystParams.Points)
{
ps.Add(JsonHelper.FromPoint2D(p));
}
dict.Add("points", "[" + string.Join(",", ps.ToArray()) + "]");
}
else
{
dict.Add("points", "null");
}
if (geometrySurfaceAnalystParams.ZValues != null && geometrySurfaceAnalystParams.ZValues.Count > 0)
{
List<double> list = new List<double>();
for (int i = 0; i < geometrySurfaceAnalystParams.ZValues.Count; i++)
{
list.Add(geometrySurfaceAnalystParams.ZValues[i]);
}
dict.Add("zValues", "[" + string.Join(",", list.ToArray()) + "]");
}
else
{
dict.Add("zValues", "[]");
}
if (geometrySurfaceAnalystParams.ParametersSetting != null)
{
dict.Add("extractParameter", SurfaceAnalystParametersSetting.ToJson(geometrySurfaceAnalystParams.ParametersSetting));
}
else
{
dict.Add("extractParameter", SurfaceAnalystParametersSetting.ToJson(new SurfaceAnalystParametersSetting()));
}
string resultSetting = string.Format(System.Globalization.CultureInfo.InvariantCulture, "\"dataReturnMode\":\"RECORDSET_ONLY\",\"expectCount\":{0}", geometrySurfaceAnalystParams.MaxReturnRecordCount);
resultSetting = "{" + resultSetting + "}";
dict.Add("resultSetting", resultSetting);
dict.Add("resolution", geometrySurfaceAnalystParams.Resolution.ToString(System.Globalization.CultureInfo.InvariantCulture));
return dict;
}