当前位置: 首页>>代码示例>>C#>>正文


C# JObject.SetGeometry方法代码示例

本文整理汇总了C#中Newtonsoft.Json.Linq.JObject.SetGeometry方法的典型用法代码示例。如果您正苦于以下问题:C# JObject.SetGeometry方法的具体用法?C# JObject.SetGeometry怎么用?C# JObject.SetGeometry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Newtonsoft.Json.Linq.JObject的用法示例。


在下文中一共展示了JObject.SetGeometry方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ReadElementElement

        public IEnumerable<JObject> ReadElementElement(IAixmConverter converter, JObject currentObject, XElement element)
        {
           
            var elementElement = element.Elements().ToArray();
            if(elementElement.Length != 1)
            {
                throw new NotSupportedException("ReadElementElement do not support more than one nested element");
            }
         
            var id = currentObject["properties"]["id"];
            currentObject.SetGeometry(new JObject());
            var obj = new JObject(new JProperty("properties",new JObject(
                new JProperty("elementSource",elementElement[0].Name.LocalName),
                new JProperty("parent", id is JObject ? id["#text"].ToString() : id.ToString())
                )));

            //Need to yield the current feature when going to sub types.
            //When no sub features are returned the current feature is automaticly returned for all other cases.
            yield return currentObject;

            foreach (var feature in converter.ReadElement(obj, elementElement[0].Elements()).ToList())
            {
                yield return feature;
            }
            
       
          
        }
开发者ID:s-innovations,项目名称:S-Innovations.Aixm,代码行数:28,代码来源:AIXMGeometriesConverter.cs

示例2: ReadSurfaceElement

        public IEnumerable<JObject> ReadSurfaceElement(IAixmConverter converter, JObject currentObject, XElement element)
        {
           
            //Convert ElevatedSurface to a GML Surface and convert to geojson.
            var geometry = GeometryFactory.GmlToGeometry(DownCastToSurfaceElement(element));

            //Set the geometry
            currentObject.SetGeometry(geometry);

            //Set the projection on the feature obj.
            currentObject.SetSrs(element);

            return Enumerable.Empty<JObject>();

          
        }
开发者ID:s-innovations,项目名称:S-Innovations.Aixm,代码行数:16,代码来源:AIXMElevatedSurfaceConverter.cs

示例3: ReadElement

        public IEnumerable<JObject> ReadElement(IAixmConverter converter, JObject currentObject, XElement element)
        {
            XNamespace aximNs = "http://www.aixm.aero/schema/5.1";

            //Convert ElevatedPoint to a GML Surface and convert to geojson.
            var geometry = GeometryFactory.GmlToGeometry(DownCastToPointElement(element));
                       
            //Set the geometry
            currentObject.SetGeometry(geometry);

            //Set the projection on the feature obj.
            currentObject.SetSrs(element);

            //Read elevation property and return
            return converter.ReadElement(currentObject, element.Elements(aximNs + "elevation"));
        }
开发者ID:s-innovations,项目名称:S-Innovations.Aixm,代码行数:16,代码来源:AIXMElevatedPointConverter.cs


注:本文中的Newtonsoft.Json.Linq.JObject.SetGeometry方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。