Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 加载ArcGIS数字化图像_C#_.net_Winforms_Gis_Arcgis - Fatal编程技术网

C# 加载ArcGIS数字化图像

C# 加载ArcGIS数字化图像,c#,.net,winforms,gis,arcgis,C#,.net,Winforms,Gis,Arcgis,我不熟悉地理信息系统平台 在我的项目(一个windows应用程序)中,我试图在PictureBox(一个区域的无人机图像)中加载一个图像,它的格式是GeoTIFF,大约950+MB。该图像数字化(标记每个房屋的边界并标记房屋编号)和导入Shapefile中的数据。我使用以下代码提取XY坐标数据。我将原始图像的大小减小到大约40-45MB,并转换为JPG格式 现在我必须在我的windows应用程序中,在新的缩小图像上绘制XY坐标数据 我应该如何实现这个场景? 我到底该怎么办? 我无法加载950+M

我不熟悉地理信息系统平台

在我的项目(一个windows应用程序)中,我试图在PictureBox(一个区域的无人机图像)中加载一个图像,它的格式是GeoTIFF,大约950+MB。该图像数字化(标记每个房屋的边界并标记房屋编号)和导入Shapefile中的数据。我使用以下代码提取XY坐标数据。我将原始图像的大小减小到大约40-45MB,并转换为JPG格式

现在我必须在我的windows应用程序中,在新的缩小图像上绘制XY坐标数据

我应该如何实现这个场景? 我到底该怎么办? 我无法加载950+MB左右的原始图像

用于从Shapefile获取XY坐标的代码

private void ReadShapeFile(字符串路径)
{
ShapeFile.MapFilesInMemory=true;
//打开shapefile
EGIS.ShapeFileLib.ShapeFile sf=新的EGIS.ShapeFileLib.ShapeFile(路径);
尝试
{
sf.RenderSettings=new EGIS.ShapeFileLib.RenderSettings(路径“”,this.Font);
EGIS.ShapeFileLib.DbfReader dbfr=sf.RenderSettings.DbfReader;
使用(System.IO.StreamWriter writer=new System.IO.StreamWriter(“output.txt”))
{
EGIS.ShapeFileLib.shapefilenumerator sfEnum=sf.getshapefilenumerator();
int-recordIndex=0;
while(sfEnum.MoveNext())
{
字符串rec=“”;
字符串NoOfCord=“”;
字符串坐标=”;
rec=string.Format(“记录:{0}”,记录索引);
WriteLine(string.Format(“记录:{0}”,记录索引));
System.Collections.ObjectModel.ReadOnlyCollection pointRecords=sfEnum.Current;
foreach(pointRecords中的PointD[]pts)
{
Write(string.Format(“[NumPoints:{0}]”,pts.Length));
NoOfCord=string.Format(“[NumPoints:{0}]”,pts.Length);
对于(int n=0;n0)writer.Write(',');
writer.Write(pts[n].ToString());
如果(n>0)坐标+=“,”;
coord+=pts[n].ToString();
}
writer.WriteLine();
}
AddDataToDataTable(recordIndex、rec、NoOfCord、coord);
++记录索引;
}
sfEnum.Dispose();
}
MessageBox.Show(“数据加载成功”);
}
catch(异常ex){Debug.WriteLine(“错误消息-”+enl+ex.Message+enl+“错误堆栈跟踪-”+enl+ex.StackTrace+enl);}
最后
{
sf.Close();
sf.Dispose();
}
}

首先:加载巨大图像需要金字塔或瓷砖切割;如果希望应用程序显示完整图像,请剪切平铺或构建金字塔,然后在dotspatialsharpmap库中的mapcontrol中显示


Second:如果未剪切图像,处理后的图像将与原始图像具有相同的真实范围。您可以计算图像中任何像素的实际位置;您还可以将真实位置(纬度/经度或投影坐标)转换为图像坐标参考(左上角为(0,0))。

我不确定我是否理解了您问题的每一点。JPEG不已经包含房屋的xy坐标吗?因此,您可以在winforms应用程序中显示这一点。为什么需要原始GeoTIFF?在arcGIS中数字化的图像..因此在数字化过程中,房屋点(即多边形)被绘制..因此xy坐标不包含在JPEG文件中..@HimBromBeereSo JPEG包含什么?无论如何,图像只是一个光栅(包含列和行),而数字化是处理矢量数据的工作。因此,数字化JPEG不适合在一起,但是Shapefile和数字化适合在一起,因为Shapefile是一种矢量格式。因此,如果您正在处理光栅或矢量数据,请明确说明。Winforms无法显示形状文件,但可以显示图像(=光栅数据).我在GeoTIFF img上使用ArcGIS对数据进行数字化..我创建了这个的shpfile..这是ArcGIS应用程序的唯一工作..现在我想在winforms中显示img,还想在winforms上显示我的标记..为此,我将img转换为JPEG,以便可以在winforms上加载..并使用shpfile提取xy Coords..使用它坐标我正试图在我的.net应用程序(即winforms)中在图像上绘制多边形…现在的问题是xy坐标超出了图像的范围..在这种情况下,什么对我有用?那么实际上,你想在winforms应用程序中显示GeoTIFF和house多边形的压缩版本吗?
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();
    }
}