ArcGIS Pro SDK根据Xml/Json文件反向生成几何

需求:

geometry文件导出后的xml,在另一台电脑上反向生成geometry

解决方案:

MapPoint minPointImport = MapPointBuilderEx.FromXml(xml);

线

包络线

Envelope envelopeImport = EnvelopeBuilderEx.FromXml(xml);

var geometryBag = PolygonBuilderEx.FromXml(mfGeometryXmlNew);
Polygon mfPolygon = geometryBag as Polygon;

其他

const string jsonString = "{\"geometries\":[{\"x\":1,\"y\":2},{\"rings\":[[[0,0],[0,4],[3,4],[3,0],[0,0]]]}],\"spatialReference\":{\"wkid\":4326,\"latestWkid\":4326}}";
//At 2.x - GeometryBag geometryBag = GeometryBagBuilder.FromJson(jsonString);
var geometryBag = GeometryBagBuilderEx.FromJson(jsonString);

string xml = geometryBag.ToXml();
//At 2.x - GeometryBag xmlString = GeometryBagBuilder.FromXML(xml);
var xmlString = GeometryBagBuilderEx.FromXml(xml);

参考文献:

ToXml 方法(几何)—ArcGIS Pro

你可能感兴趣的:(arcgisprosdk,arcgis,xml,arcgisprosdk)