zoukankan      html  css  js  c++  java
  • ArcEngine:The XY domain on the spatial reference is not set or invalid错误

    在创建数据集的时候,提示The XY domain on the spatial reference is not set or invalid错误。

    原因:未设置空间参考(ISpatialReference)的域范围(Domain)。

    解决方法:通过以下代码进行设置Domain即可:pSpatialReference.SetDomain(xmin, xmax, ymin, ymax);

    代码示例:

    ISpatialReferenceFactory pSpatialReferenceEnvironment = new SpatialReferenceEnvironment();
    pComReleaser.ManageLifetime(pSpatialReferenceEnvironment);
    ISpatialReference pSpatialReference = pSpatialReferenceEnvironment.CreateProjectedCoordinateSystem((int)esriSRProjCSType.esriSRProjCS_World_Mercator);
    pComReleaser.ManageLifetime(pSpatialReference);
    pSpatialReferenceEnvironment.CreateGeographicCoordinateSystem((int)esriSRGeoCSType.esriSRGeoCS_WGS1984);
    pSpatialReference.SetDomain(-60000000, 60000000, -60000000, 60000000);
    //创建要素数据集
    IFeatureDataset pFeatureDataset = PGeoDbGeneral.CreateFeatureDataset(pWorkspace, txtFtDataset.Text, pSpatialReference);
    pComReleaser.ManageLifetime(pFeatureDataset);

  • 相关阅读:
    Linux下对拍(A+B问题)
    洛谷 P1043 数字游戏 区间DP
    6.22 集训--DP复习一
    洛谷 P1220 关路灯 区间DP
    A*算法求K短路模板 POJ 2449
    点分治模板 POJ 1741
    HDU
    棋子游戏 51Nod
    数论习题总结
    CodeForces
  • 原文地址:https://www.cnblogs.com/Jingkunliu/p/4497616.html
Copyright © 2011-2022 走看看