加载 ArcGIS 数字化影像 [英] Load ArcGIS digitized image
问题描述
我是 GIS 平台的新手.
I am New to GIS platform.
在我的项目(一个 Windows 应用程序)中,我试图在 PictureBox(一个区域的无人机图像)中加载一个大约 950+ MB 的 GeoTIFF 格式的图像.该图像数字化(标记每个房屋的边界并标有房屋编号)并在 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();
}
}
推荐答案
第一:加载巨幅图片需要金字塔或瓷砖切割;如果您希望您的应用程序显示完整图像,请切割瓷砖或构建金字塔,然后将其显示在 mapcontrol 中,在 dotspatial 或 sharpmap图书馆.
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屋!