using Community.Model.Calc;
|
using System;
|
using System.Collections.Generic;
|
using System.IO;
|
using System.Linq;
|
using System.Web;
|
|
namespace Community.cs
|
{
|
public class CalcVolume
|
{
|
public static readonly string BaseDir = System.AppDomain.CurrentDomain.BaseDirectory;
|
|
public static List<Triangle> GetPoints(string type, string wkt)
|
{
|
string fileName = string.Format("files\\hbks_up{0}.shp", type);
|
string shp = Path.Combine(BaseDir, fileName);
|
if (!File.Exists(shp))
|
{
|
return null;
|
}
|
|
GdalOp op = new GdalOp();
|
List<Triangle> list = op.ReadShp(shp, wkt);
|
if (list == null || list.Count == 0)
|
{
|
return null;
|
}
|
|
string tif_up = Path.Combine(BaseDir, "tif\\hbks_up02.tif");
|
if (File.Exists(tif_up))
|
{
|
op.ReadTif(tif_up, list, "Z1");
|
}
|
|
string tif_down = Path.Combine(BaseDir, "tif\\hbks_down02.tif");
|
if (File.Exists(tif_down))
|
{
|
op.ReadTif(tif_down, list, "Z2");
|
}
|
|
return list;
|
}
|
}
|
}
|