本文整理汇总了C#中Features.New方法的典型用法代码示例。如果您正苦于以下问题:C# Features.New方法的具体用法?C# Features.New怎么用?C# Features.New使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Features
的用法示例。
在下文中一共展示了Features.New方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetFeaturesInView
public System.Collections.Generic.IEnumerable<IFeature> GetFeaturesInView(BoundingBox box, double resolution)
{
var features = new Features();
IRaster raster = null;
var view = new Viewport { Resolution = resolution, Center = box.GetCentroid(), Width = (box.Width / resolution), Height = (box.Height / resolution) };
if (TryGetMap(view, ref raster))
{
IFeature feature = features.New();
feature.Geometry = raster;
features.Add(feature);
}
return features;
}
示例2: GetFeaturesInView
public IEnumerable<IFeature> GetFeaturesInView(BoundingBox box, double resolution)
{
//If there are no layers (probably not initialised) return nothing
if (Capabilities.layers == null)
return new Features();
IFeatures features = new Features();
IRaster raster = null;
IViewport viewport = new Viewport { Resolution = resolution, Center = box.GetCentroid(), Width = (box.Width / resolution), Height = (box.Height / resolution) };
if (TryGetMap(viewport, ref raster))
{
var feature = features.New();
feature.Geometry = raster;
features.Add(feature);
}
return features;
}
示例3: FetchTiles
public IFeatures FetchTiles(BoundingBox boundingBox, double resolution)
{
Extent extent = new Extent(boundingBox.Min.X, boundingBox.Min.Y, boundingBox.Max.X, boundingBox.Max.Y);
int level = BruTile.Utilities.GetNearestLevel(source.Schema.Resolutions, resolution);
IList<TileInfo> tiles = source.Schema.GetTilesInView(extent, level);
ICollection<WaitHandle> waitHandles = new List<WaitHandle>();
foreach (TileInfo info in tiles)
{
if (bitmaps.Find(info.Index) != null) continue;
if (queue.Contains(info.Index)) continue;
AutoResetEvent waitHandle = new AutoResetEvent(false);
waitHandles.Add(waitHandle);
queue.Add(info.Index);
Thread thread = new Thread(GetTileOnThread);
thread.Start(new object[] { source.Provider, info, bitmaps, waitHandle });
//!!!ThreadPool.QueueUserWorkItem(GetTileOnThread, new object[] { source.Provider, info, bitmaps, waitHandle });
}
//foreach (WaitHandle handle in waitHandles)
// handle.WaitOne();
IFeatures features = new Features();
foreach (TileInfo info in tiles)
{
byte[] bitmap = bitmaps.Find(info.Index);
if (bitmap == null) continue;
IRaster raster = new Raster(bitmap, new BoundingBox(info.Extent.MinX, info.Extent.MinY, info.Extent.MaxX, info.Extent.MaxY));
IFeature feature = features.New();
feature.Geometry = raster;
features.Add(feature);
}
return features;
}
示例4: MemoryProvider
/// <summary>
/// Initializes a new instance of the <see cref="MemoryProvider"/>
/// </summary>
/// <param name="geometry">Geometry to be in this datasource</param>
public MemoryProvider(Geometry geometry)
{
_Features = new Features();
IFeature feature = _Features.New();
feature.Geometry = geometry;
_Features.Add(feature);
}