public RstReader(string filename) { _geoImage = IGeoImage.GeoOpen(filename); GeoImage g = _geoImage as GeoImage; _fullEnvelope = new Envelope(g.MinX, g.MinY, g.MaxX, g.MaxY); _coordType = g.IsProjected ? enumCoordinateType.Projection : enumCoordinateType.Geographic; _sref = SpatialReferenceFactory.GetSpatialReferenceByWKT(g.ProjectDescription, enumWKTSource.GDAL); _byteCountPerPixel = GetBandCount(_geoImage.DataType); }
public void Dispose() { if (_cachebitmap != null) { _cachebitmap.Dispose(); _cachebitmap = null; } _geoImage.Dispose(); _geoImage = null; }
public override void Execute() { try { OpenFileDialog dlg = new OpenFileDialog(); dlg.Filter = "LDF File(*.ldf)|*.ldf|Image File (*.rst)|*.rst|(*.img)|*.img|(*.tif)|*.tif|(*.*)|*.*"; if (dlg.ShowDialog() == DialogResult.OK) { PluginGeoVisWnd viewer = _smartSession.SmartWindowManager.ActiveViewer as PluginGeoVisWnd; if (viewer == null) { return; } else { vis = viewer.Controls[0] as UCGeoVIS; vis.Img = IGeoImage.GeoOpen(dlg.FileName); if (vis.Img == null) { return; } vis.Img.SetPara(3, new int[] { 6, 2, 1 }, new float[] { 0, 0, 0 }, new float[] { 1000, 1000, 1000 }); OViewNode node = vis.Viewer.CreateViewNode(ViewNodeType.GeoQuadTileSet); node.Name = Path.GetFileNameWithoutExtension(dlg.FileName); node.Tag = vis.Img; vis.Viewer.Root.InsertNode(vis.Viewer.Root.ChildrenCount, node); double alt = GeoVisViewer.Radius * Math.Abs(Math.Sin(Angle.DegreeToRadians * ((vis.Img.CurGeoRegion.MaxLon - vis.Img.CurGeoRegion.MinLon)))); EarthGoto(vis.Img.CurGeoRegion.CenterLatitude, vis.Img.CurGeoRegion.CenterLongitude, alt); } } } catch (Exception ex) { MsgBox.ShowInfo(ex.Message); } }