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


C# Feature.GetShape方法代码示例

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


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

示例1: CheckOverlayWithinBounds

        void CheckOverlayWithinBounds(Feature feature)
        {
            var errors = new List<string>();
            _geoArray = GeoArray.FromWellKnownText(feature.GetWellKnownText());
            OnPropertyChanged("GeoArray");
#if false
            if (_writeKML)
            {
                var kml = new KMLRoot();
                var folder = new Folder("Overlay Segment Test");
                var segments = _geoArray.Segments.ToArray();
                for (var segment = 0; segment < segments.Length; segment++)
                {
                    segments[segment].Placemark.name = string.Format("Segment {0}", segment);
                    folder.Add(segments[segment].Placemark);
                }
                kml.Document.Add(folder);
                var savePath = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments), "Overlay Segment Tests", "OverlaySegmentTest.kml");
                kml.Save(savePath);
                _writeKML = false;
            }
#endif
            if (_geoArray.HasCrossingSegments && !AreCrossingSegmentsAllowed) errors.Add("Perimeter segments may not cross");
            if (_locationBoundsRectangle != null && !_locationBoundsRectangle.Contains(feature.GetShape())) errors.Add("Perimeter must be within location bounds");
            var areaStyle = errors.Count > 0 ? _errorAreaStyle : _normalAreaStyle;
            _wpfMap.EditOverlay.EditShapesLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = areaStyle;
            _wpfMap.EditOverlay.EditShapesLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
            Errors = errors.Count == 0 ? string.Empty : string.Join("\n", errors);
            HasErrors = errors.Count > 0;
            if (HasErrors) Debug.WriteLine(string.Format("Errors: {0}", Errors));
        }
开发者ID:AuditoryBiophysicsLab,项目名称:ESME-Workbench,代码行数:31,代码来源:EditablePolygonOverlayViewModel.cs

示例2: CalculateResizeControlPointsCore

 protected override IEnumerable<Feature> CalculateResizeControlPointsCore(Feature feature)
 {
     // Override the base method and modify the control points for resizing if the shape is the "custom"
     var resizeControlPoints = new Collection<Feature>();
     var polygonShape = feature.GetShape() as PolygonShape;
     if (polygonShape != null) foreach (var vertex in polygonShape.OuterRing.Vertices) resizeControlPoints.Add(new Feature(vertex, feature.Id));
     return resizeControlPoints;
 }
开发者ID:AuditoryBiophysicsLab,项目名称:ESME-Workbench,代码行数:8,代码来源:CustomEditOverlay.cs

示例3: DeleteCore

 protected override void DeleteCore(Feature feature)
 {
     int level = QTreeHelper.GetAppropriateLevel(maxExtent, feature.GetBoundingBox());
     ulong location = QTreeHelper.GetLocation(maxExtent, feature.GetShape(), level);
     if (location == 0 && qtree.ContainsKey(location))
     {
         qtree.Remove(location);
     }
 }
开发者ID:SCNU-R,项目名称:RoutingAlgorithm,代码行数:9,代码来源:QTreeSpatialIndex.cs

示例4: ResizeFeatureCore

 protected override Feature ResizeFeatureCore(Feature sourceFeature, PointShape sourceControlPoint, PointShape targetControlPoint)
 {
     // Override the base method and modify the logic for resizing if the shape is the "custom"
     var polygonShape = sourceFeature.GetShape() as PolygonShape;
     if (polygonShape != null)
     {
         // If the rectangle is horizontal or vertical, it will use the custom method.
         if (string.Equals(polygonShape.GetBoundingBox().GetWellKnownText(), polygonShape.GetWellKnownText()))
         {
             var fixedPointIndex = GetFixedPointIndex(polygonShape, sourceControlPoint);
             var fixedPointShape = new PointShape(polygonShape.OuterRing.Vertices[fixedPointIndex]);
             var newRectangleShape = new LineShape(new[] { new Vertex(fixedPointShape), new Vertex(targetControlPoint) }).GetBoundingBox();
             return base.ResizeFeatureCore(new Feature(newRectangleShape.GetWellKnownBinary(), sourceFeature.Id, sourceFeature.ColumnValues),
                                           targetControlPoint,
                                           targetControlPoint);
         }
     }
     return base.ResizeFeatureCore(sourceFeature, sourceControlPoint, targetControlPoint);
 }
开发者ID:AuditoryBiophysicsLab,项目名称:ESME-Workbench,代码行数:19,代码来源:CustomEditOverlay.cs

示例5: AddCore

 protected override void AddCore(Feature feature)
 {
     int level = QTreeHelper.GetAppropriateLevel(maxExtent, feature.GetBoundingBox());
     ulong location = QTreeHelper.GetLocation(maxExtent, feature.GetShape(), level);
     if (location != 0)
     {
         QuadCell cell = QTreeHelper.GetCellByLocation(maxExtent, location);
         lock (sync)
         {
             if (!qtree.ContainsKey(location))
             {
                 lock (sync)
                 {
                     QuadTreeNode node = new QuadTreeNode(cell.Location, cell.BoundingBox, feature.Id);
                     qtree.Add(location, node);
                 }
                 if (maxLevel < level)
                 {
                     maxLevel = level;
                 }
             }
         }
     }
 }
开发者ID:SCNU-R,项目名称:RoutingAlgorithm,代码行数:24,代码来源:QTreeSpatialIndex.cs

示例6: GetAppropriateLevel

 //public static string GetLocation(RectangleShape extent, BaseShape shape, int level)
 //{
 //    RectangleShape extentBoundingBox = SquaredExtent(extent);
 //    RectangleShape shapeBoundingBox = shape.GetBoundingBox();
 //    string location = string.Empty;
 //    if (shapeBoundingBox.IsWithin(extentBoundingBox))
 //    {
 //        location += "0";
 //        int currentlevel = 1;
 //        while (currentlevel < level)
 //        {
 //            RectangleShape upperLeft = GetUpperLeftQuater(extentBoundingBox);
 //            RectangleShape uppperRight = GetUpperRightQuater(extentBoundingBox);
 //            RectangleShape lowerLeft = GetLowerLeftQuater(extentBoundingBox);
 //            RectangleShape lowerRight = GetLowerRightQuater(extentBoundingBox);
 //            if (shapeBoundingBox.IsWithin(upperLeft))
 //            {
 //                location += "1";
 //                currentlevel++;
 //                extentBoundingBox = upperLeft;
 //            }
 //            else if (shapeBoundingBox.IsWithin(uppperRight))
 //            {
 //                location += "2";
 //                currentlevel++;
 //                extentBoundingBox = uppperRight;
 //            }
 //            else if (shapeBoundingBox.IsWithin(lowerLeft))
 //            {
 //                location += "3";
 //                currentlevel++;
 //                extentBoundingBox = lowerLeft;
 //            }
 //            else if (shapeBoundingBox.IsWithin(lowerRight))
 //            {
 //                location += "4";
 //                currentlevel++;
 //                extentBoundingBox = lowerRight;
 //            }
 //            else
 //            {
 //                break;
 //            }
 //        }
 //    }
 //    return location;
 //}
 public static int GetAppropriateLevel(RectangleShape extent, Feature feature)
 {
     return GetAppropriateLevel(extent, feature.GetShape());
 }
开发者ID:SCNU-R,项目名称:RoutingAlgorithm,代码行数:51,代码来源:QTreeHelper.cs

示例7: GetLocation

 public static ulong GetLocation(RectangleShape extent, Feature feature, int level)
 {
     return GetLocation(extent, feature.GetShape(), level);
 }
开发者ID:SCNU-R,项目名称:RoutingAlgorithm,代码行数:4,代码来源:QTreeHelper.cs

示例8: GetIntersectingCells

 public static Collection<QuadCell> GetIntersectingCells(RectangleShape extent, Feature feature, int startLevel, int endLevel)
 {
     return GetIntersectingCells(extent, feature.GetShape(), startLevel, endLevel);
 }
开发者ID:SCNU-R,项目名称:RoutingAlgorithm,代码行数:4,代码来源:QTreeHelper.cs

示例9: GetLineShapes

        internal static Collection<LineShape> GetLineShapes(Feature feature)
        {
            Collection<LineShape> lineShapes = new Collection<LineShape>();

            LineBaseShape lineBaseShape = feature.GetShape() as LineBaseShape;
            if (lineBaseShape is MultilineShape)
            {
                MultilineShape multiLineShape = lineBaseShape as MultilineShape;
                lineShapes = multiLineShape.Lines;
            }
            else if (lineBaseShape is LineShape)
            {
                lineShapes.Add((LineShape)lineBaseShape);
            }
            else
            {
                throw new NotSupportedException("Only the data which includes the line shapes is supported.");
            }

            return lineShapes;
        }
开发者ID:SCNU-R,项目名称:RoutingAlgorithm,代码行数:21,代码来源:GeometryHelper.cs


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