加载ArcGIS数字化图像 [英] Load ArcGIS digitized image
问题描述
我是GIS平台的新手.
I am New to GIS platform.
在我的项目(Windows应用程序)中,我试图在PictureBox中加载图像(某个区域的无人机图像)为GeoTIFF格式,大约950+ MB.此图像被数字化(标记每个房屋的边界,并标记有房屋编号),并将数据导入Shapefile中.我使用以下代码提取了XY坐标数据.我将原始图像尺寸减小到40-45 MB,并转换为JPG格式.
In my project (A windows application) I'm trying to load an image in PictureBox(A drone image of an area) is in GeoTIFF format about 950+ MB's. This image digitized(mark boundries of every house and labelled with house no) and data imported in Shapefile. I extracted XY coordinate data using following code. I reduced the original image size to about 40-45 MB's and converted in JPG format.
现在,我必须在新缩小的图像上的Windows应用程序中绘制该XY坐标数据.
Now I have to plot that XY coordinate data in my windows application on the new reduced image.
我应该如何实现这种情况? 我到底该怎么办? 我无法加载大约950+ MB的原始图像?
How should I achieve this scenario? What exactly should I do? I am not able to load the Original image about 950+ MB's?
代码,用于从Shapefile获取XY坐标
private void ReadShapeFile(string path)
{
ShapeFile.MapFilesInMemory = true;
// open the shapefile
EGIS.ShapeFileLib.ShapeFile sf = new EGIS.ShapeFileLib.ShapeFile(path);
try
{
sf.RenderSettings = new EGIS.ShapeFileLib.RenderSettings(path, "", this.Font);
EGIS.ShapeFileLib.DbfReader dbfr = sf.RenderSettings.DbfReader;
using (System.IO.StreamWriter writer = new System.IO.StreamWriter("output.txt"))
{
EGIS.ShapeFileLib.ShapeFileEnumerator sfEnum = sf.GetShapeFileEnumerator();
int recordIndex = 0;
while (sfEnum.MoveNext())
{
string rec = "";
string NoOfCord = "";
string coord = "";
rec = string.Format("Record:{0}", recordIndex);
writer.WriteLine(string.Format("Record:{0}", recordIndex));
System.Collections.ObjectModel.ReadOnlyCollection<PointD[]> pointRecords = sfEnum.Current;
foreach (PointD[] pts in pointRecords)
{
writer.Write(string.Format("[NumPoints:{0}]", pts.Length));
NoOfCord = string.Format("[NumPoints:{0}]", pts.Length);
for (int n = 0; n < pts.Length; ++n)
{
if (n > 0) writer.Write(',');
writer.Write(pts[n].ToString());
if (n > 0) coord += ",";
coord += pts[n].ToString();
}
writer.WriteLine();
}
AddDataToDataTable(recordIndex, rec, NoOfCord, coord);
++recordIndex;
}
sfEnum.Dispose();
}
MessageBox.Show("Data Loaded Successfully");
}
catch (Exception ex) { Debug.WriteLine("Error Message - " + enl + ex.Message + enl + "Error StackTrace - " + enl + ex.StackTrace + enl); }
finally
{
sf.Close();
sf.Dispose();
}
}
推荐答案
首先:加载巨大的图像需要进行金字塔或平铺切割;如果您希望应用程序显示完整图像,请切割瓷砖或构建金字塔,然后在 dotspatial 或 sharpmap 中的 mapcontrol 中显示它库.
First: loading huge image needs pyramid or tile cutting; if you want your application to show the full image, please cut tile or build pyramid and then show it in mapcontrol which in the dotspatial or sharpmap libraries.
第二:如果尚未裁剪图像,则处理的图像将与原始图像具有相同的实际范围.您可以计算图像中任何像素的实际位置;您还可以将实际位置(纬度/经度或投影坐标)转换为图像坐标参考(左上角为(0,0)).
Second: if you have not cropped your images, the proccessed image would have the same real extent with original image. You can caculate the real position of any pixel in the image; you can also transform the real position (lat/lon or projection coordinate) to the image coordinate reference (which top-left is (0,0)).
这篇关于加载ArcGIS数字化图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!