private void WriteWorldFile(double minx, double maxy, double resolutionx, double resolutiony, string filename, ISpatialReference spatial) { WorldFile worldFile = new WorldFile(); worldFile.CreatWorldFile(resolutionx, -resolutiony, minx, maxy, filename); worldFile.CreatXmlFile(spatial == null ? SpatialReference.GetDefault() : spatial, filename); }
private void WriteWorldFile() { double minx = doubleTextBox1.Value; //double.Parse(textBox3.Text); double maxy = doubleTextBox2.Value; //double.Parse(textBox4.Text); double xResolution = double.Parse(doubleTextBox5.Text); double yResolution = double.Parse(doubleTextBox6.Text); WorldFile worldFile = new WorldFile(); worldFile.CreatWorldFile(xResolution, -yResolution, minx, maxy, Filename); worldFile.CreatXmlFile(_spatial == null ? SpatialReference.GetDefault() : _spatial, Filename); }
private void WriteWorldFile(CoordEnvelope env, Size imgSize, ISpatialReference spatial, string bmpFilename) { try { double minx = env.MinX; double maxy = env.MaxY; double resolutionX = env.Width / imgSize.Width; double resolutionY = env.Height / imgSize.Height; WorldFile worldFile = new WorldFile(); worldFile.CreatWorldFile(resolutionX, -resolutionY, minx, maxy, bmpFilename); worldFile.CreatXmlFile(spatial == null ? GeoDo.Project.SpatialReference.GetDefault() : spatial, bmpFilename); } catch { } }
private void WriteWorldFile(IRasterDataProvider prd, string bmpFilename) { try { double minx = prd.CoordEnvelope.MinX; double maxy = prd.CoordEnvelope.MaxY; double resolutionX = prd.ResolutionX; double resolutionY = prd.ResolutionY; GeoDo.Project.ISpatialReference spatial = prd.SpatialRef; WorldFile worldFile = new WorldFile(); worldFile.CreatWorldFile(resolutionX, -resolutionY, minx, maxy, bmpFilename); worldFile.CreatXmlFile(spatial == null ? GeoDo.Project.SpatialReference.GetDefault() : spatial, bmpFilename); } catch { } }
private void CreatWorldFile(string fileName, ICanvas canvas, int width, int height) { if (string.IsNullOrEmpty(fileName)) { return; } if (canvas == null) { return; } if (canvas.PrimaryDrawObject == null) { return; } if (width == 0 || height == 0) { return; } WorldFile wf = new WorldFile(); if (canvas.PrimaryDrawObject.OriginalEnvelope == null) { return; } RasterDrawing drawing = canvas.PrimaryDrawObject as RasterDrawing; if (drawing == null) { return; } if (drawing.DataProvider == null) { return; } IRasterDataProvider prd = drawing.DataProvider; if (prd.SpatialRef == null) { return; } double bmpResolutionX = (prd.CoordEnvelope.MaxX - prd.CoordEnvelope.MinX) / width; double bmpResolutionY = (prd.CoordEnvelope.MaxY - prd.CoordEnvelope.MinY) / height; wf.CreatWorldFile(bmpResolutionX, -bmpResolutionY, prd.CoordEnvelope.MinX, prd.CoordEnvelope.MaxY, fileName); wf.CreatXmlFile(prd.SpatialRef, fileName); }
private void WriteWorldFile(GeoDo.RSS.Core.DrawEngine.CoordEnvelope envlope, ISpatialReference spatial, double resolutionX, double resolutionY, string bmpFilename) { try { double minx = envlope.MinX; double maxy = envlope.MaxY; //double resolutionX = prd.ResolutionX; //double resolutionY = prd.ResolutionY; //GeoDo.Project.ISpatialReference spatial = prd.SpatialRef; WorldFile worldFile = new WorldFile(); worldFile.CreatWorldFile(resolutionX, -resolutionY, minx, maxy, bmpFilename); worldFile.CreatXmlFile(spatial == null ? GeoDo.Project.SpatialReference.GetDefault() : spatial, bmpFilename); } catch { } }