public static double[] GetExtentValue(IMap map, IFeatureClass pFeatureClass)
{
double[] zbs = new double[4];
double Y = 0;
double S = 0;
double Z = 0;
double X = 0;
IFeatureCursor pFeatureCursor = pFeatureClass.Search(null, false);
IFeature pFeature = pFeatureCursor.NextFeature();
while (pFeature != null)
{
if (Y < pFeature.Extent.XMax)
{
Y = pFeature.Extent.XMax;
}
if (Z > pFeature.Extent.XMin)
{
Z = pFeature.Extent.XMin;
}
if (S < pFeature.Extent.YMax)
{
S = pFeature.Extent.YMax;
}
if (X > pFeature.Extent.YMin)
{
X = pFeature.Extent.YMin;
}
pFeature = pFeatureCursor.NextFeature();
}
zbs[0] = S;
zbs[1] = X;
zbs[2] = Z;
zbs[3] = Y;
if (S < 90 && Z < 108)
{
return zbs;
}
else
{
zbs[0] = GetGeo(map, Z, S).Y;
zbs[2] = GetGeo(map, Z, S).X;
zbs[1] = GetGeo(map, Y, X).Y;
zbs[3] = GetGeo(map, Y, X).X;
return zbs;
}
}
获得图层范围
最新推荐文章于 2024-11-07 08:51:26 发布