public void OpenMap(string filename) { string[] paths = File.ReadAllLines(filename); for (int i = 0; i < paths.Length; i++) { string[] splitResult = paths[i].Split(' '); switch (splitResult[0]) { case "Point": PointLayer pointLayer = new PointLayer(); pointLayer.OpenLayer(splitResult[1]); pointLayer.Id = i; layers.Add(pointLayer); break; case "Line": LineLayer lineLayer = new LineLayer(); lineLayer.OpenLayer(splitResult[1]); lineLayer.Id = i; layers.Add(lineLayer); break; case "Polygon": PolygonLayer polygonLayer = new PolygonLayer(); polygonLayer.OpenLayer(splitResult[1]); polygonLayer.Id = i; layers.Add(polygonLayer); break; default: break; } } }
public void GetAttributes_WithFieldNames() { var fs = new FeatureSet(FeatureType.Point); fs.DataTable.Columns.Add("Column1"); fs.DataTable.Columns.Add("Column2"); fs.AddFeature(new Point(0, 0)); var fl = new PointLayer(fs); var target = new IndexSelection(fl); var attributesTable = target.GetAttributes(0, 1, new[] {"Column1"}); Assert.AreEqual(1, attributesTable.Columns.Count); Assert.AreEqual("Column1", attributesTable.Columns[0].ColumnName); }
public void GetAttributes_WithFieldNames() { var fs = new FeatureSet(FeatureType.Point); fs.DataTable.Columns.Add("Column1"); fs.DataTable.Columns.Add("Column2"); fs.AddFeature(new Point(0, 0)); var fl = new PointLayer(fs); var target = new IndexSelection(fl); var attributesTable = target.GetAttributes(0, 1, new[] { "Column1" }); Assert.AreEqual(1, attributesTable.Columns.Count); Assert.AreEqual("Column1", attributesTable.Columns[0].ColumnName); }
public void Get(PointLayer request) { string rtPath = AppDomain.CurrentDomain.BaseDirectory + @"Data/Tile/point/" + request.z + @"/" + request.x + "_" + request.y + "_" + request.z + ".png"; try { Bitmap bmp = Image.FromFile(rtPath) as Bitmap; if (bmp != null) { Response.ContentType = "image/png"; bmp.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Png); Response.OutputStream.Position = 0; Response.Flush(); } } catch { } }
/// <summary> /// 由带值点要素生成穹窿模型 /// </summary> private static void createFornixModelByPoint() { string path = @"E:\Users\LiuXianyu\Documents\ExperimentData\myProject\FornixModelingGDAL\Data\LingYanShan\Export\fornix1.obj"; string imgpath = @"E:\Users\LiuXianyu\Documents\ExperimentData\myProject\FornixModelingGDAL\Data\LingYanShan\lingyan.img"; _RasterPoints = DEMServer.getVersFromDEM(imgpath); //_RasterPoints = new VertexCollection(); //Vertex tempVer = new Vertex(); //tempVer.X(139741.0); //tempVer.Y(175806.0); //tempVer.Z(300.0); //tempVer.innerPoint = true; //_RasterPoints.addVer(tempVer); Fornix preFornix = null; ReadShp(@"E:\Users\LiuXianyu\Documents\ExperimentData\myProject\FornixModelingGDAL\Data\LingYanShan\codedata\vertex1\lyspv1.shp"); ReadShp(@"E:\Users\LiuXianyu\Documents\ExperimentData\myProject\FornixModelingGDAL\Data\LingYanShan\codedata\vertex1\lyspv2.shp"); ReadShp(@"E:\Users\LiuXianyu\Documents\ExperimentData\myProject\FornixModelingGDAL\Data\LingYanShan\codedata\vertex1\lyspv3.shp"); foreach (Layer PointLayer in layers) { //读入一个地层 Fornix fornix = new Fornix(PointLayer.GetName()); VertexCollection vcUp = new VertexCollection(); fornix.dip = PointLayer.GetFeature(0).GetFieldAsDouble("dip"); for (int i = 0; i < (int)PointLayer.GetFeatureCount(0); ++i) { Vertex vertex = new Vertex(); vertex.ID = _verNum++; vertex.X(PointLayer.GetFeature(i).GetFieldAsDouble("POINT_X")); vertex.Y(PointLayer.GetFeature(i).GetFieldAsDouble("POINT_Y")); //vertex.Z(PointLayer.GetFeature(i).GetFieldAsDouble("RASTERVALU")); vertex.Z(DEMServer.GetElevation(vertex.X(), vertex.Y())); vcUp.addVer(vertex); } if (vcUp.Count < 3) { MessageBox.Show("地层产状点不足!"); } //生成侧面上顶点 fornix.createOutSideUpvers(vcUp); //侧面生成 createSide(fornix, preFornix, fornix.dip); //将顶面边界点产状信息插回shp中 //SetShp(PointLayer, fornix); //组合 _fornixs.Add(fornix); preFornix = fornix; } foreach (Fornix fornix in _fornixs) { //基于相邻顶边,生成顶面 fornix.createUpFace(_RasterPoints); //基于相邻底边,生成底面 fornix.createDownFace(); } //打印obj ObjWriter.writeFornixObj(_fornixs, path, _verNum); }
public DrawPointTask(Workspace.Workspace workspace, PointLayer layer, MapExtent extent, int width, int height) : base(workspace, layer, extent, width, height) { }