示例#1
0
        public static ILucidGeometry Create(string geometryJson)
        {
            if (geometryJson.Contains("\"x\""))
            {
                return(LucidPoint.Create(geometryJson));
            }
            if (geometryJson.Contains("\"xmax\""))
            {
                return(LucidExtent.Create(geometryJson));
            }
            if (geometryJson.Contains("\"paths\""))
            {
                return(LucidLine.Create(geometryJson));
            }
            if (geometryJson.Contains("\"rings\""))
            {
                return(LucidPolygon.Create(geometryJson));
            }

            throw new Exception($"Unrecognized geometry type {geometryJson}");
        }
示例#2
0
        /// <summary>
        /// Returns a circular buffer geometry for a point with the provided radius and vertex count.
        /// </summary>
        /// <param name="point">The point to buffer.</param>
        /// <param name="radius">The radius to buffer the point by.</param>
        /// <param name="edgeCount">The number of vertices, complexity, of the produced circular buffer.</param>
        /// <returns></returns>
        public static ILucidPolygon BufferPoint(IPoint point, double radius, int edgeCount = 24)
        {
            var path = CircularPathFromPoint(point, radius, edgeCount);

            return(LucidPolygon.Create(path.Vertices));
        }
示例#3
0
 public static LucidPolygon Create(Map geometry, LucidSpatialReference spatialReference = null)
 {
     return(LucidPolygon.Create(geometry.ToString(), spatialReference));
 }
示例#4
0
 public ILucidPolygon AsPolygon()
 {
     return(LucidPolygon.Create(Vertices, SpatialReference));
 }