private static void TileNorway() { var layer = new TiledVectorLayer("test2", WebMercator.BoundingBox1, 39135.75848201024 * 4); var store = new DiskTileStore(layer); store.Wipe(); var tiler = new VectorTiler(store, layer); var filename = FileLocator.FindFileInTree(@"data\norway.geojson"); FeatureCollection norway = JsonConvert.DeserializeObject <FeatureCollection>(File.ReadAllText(filename)); List <OmrådeMedGeometry> partOfNorway = new List <OmrådeMedGeometry>(); foreach (var feature in norway.Features) { partOfNorway.Add(new OmrådeMedGeometry(new Område(3581, AreaType.Land), DotSpatialGeometry.From(feature))); } foreach (var omg in partOfNorway) { omg.Område.Number = -5; } for (int zoom = 0; zoom < 6; zoom++) { foreach (OmrådeMedGeometry polygon in partOfNorway) { tiler.Update(polygon.Område, polygon.Geometry, zoom); } } }
public static TileCoordinates GetTileCoordinates(TiledVectorLayer layer, double x, double y, double resolution, bool reverseIntersectionPolicy, int z) { var scale = resolution / layer.GetResolution(z); var origin = layer.GetOrigin(z); return(GetTileCoordForXyAndResolution(x, y, resolution, reverseIntersectionPolicy, origin, scale, z)); }
public TileToDisk() { var layer = new TiledVectorLayer("test2", WebMercator.BoundingBox1, 39135.75848201024 * 4); var store = new DiskTileStore(layer); store.Wipe(); tiler = new VectorTiler(store, layer); }
public DiskTileStore(TiledVectorLayer layer) { this.layer = layer; var mapsPath = Config.Settings.Map.MapLayersPath; storagePath = Path.Combine(mapsPath, layer.Name); CreateDirectory(storagePath); }
public TilePolygonTest() { var layer = new TiledVectorLayer("", bbox, 39135.75848201024 * 4) { TileOverlapRatio = 0 }; store = new TestTileStore(layer); tiler = new VectorTiler(store, layer); }
public BoundingBox GetExtent(TiledVectorLayer layer) { var origin = layer.GetOrigin(ZoomLevel); double resolution = layer.GetResolution(ZoomLevel); double minX = origin.X + X * TiledVectorLayer.TileSize * resolution; double minY = origin.Y + Y * TiledVectorLayer.TileSize * resolution; double maxX = minX + TiledVectorLayer.TileSize * resolution; double maxY = minY + TiledVectorLayer.TileSize * resolution; return(new BoundingBox(minX, maxY, maxX, minY)); }
public BoundingBox GetExtent(TiledVectorLayer layer) { Point origin = layer.GetOrigin(ZoomLevel); double resolution = layer.GetResolution(ZoomLevel); double rminX = origin.X + minX * TiledVectorLayer.TileSize * resolution; double rmaxX = origin.X + (maxX + 1) * TiledVectorLayer.TileSize * resolution; double rminY = origin.Y + minY * TiledVectorLayer.TileSize * resolution; double rmaxY = origin.Y + (maxY + 1) * TiledVectorLayer.TileSize * resolution; return(new BoundingBox(rminX, rmaxY, rmaxX, rminY)); }
public TileRangeTest() { TiledVectorLayer layer = new TiledVectorLayer("", bbox, 39135.75848201024 * 4); tiler = new VectorTiler(new TestTileStore(layer), layer); }
public TestTileStore(TiledVectorLayer layer) { this.layer = layer; }
public static TileCoordinates GetTileCoordinates(double x, double y, double resolution, bool reverseIntersectionPolicy, TiledVectorLayer layer) { var z = layer.GetZForResolution(resolution); return(GetTileCoordinates(layer, x, y, resolution, reverseIntersectionPolicy, z)); }
public static TileRange GetTileRangeForExtentAndZ(IEnvelope extent, int z, TiledVectorLayer layer) { var resolution = layer.GetResolution(z); return(GetTileRangeForExtentAndResolution(extent, resolution, layer)); }
public static TileRange GetTileRangeForExtentAndResolution(IEnvelope extent, double resolution, TiledVectorLayer layer) { var z = layer.GetZForResolution(resolution); var ll = TileCoordinates.GetTileCoordinates(layer, extent.Minimum.X, extent.Minimum.Y, resolution, false, z); var ur = TileCoordinates.GetTileCoordinates(layer, extent.Maximum.X, extent.Maximum.Y, resolution, true, z); return(new TileRange(z, ll.X, ur.X, ll.Y, ur.Y)); }
public VectorQuadTile(TileCoordinates tile, TiledVectorLayer layer) : base(tile.GetExtent(layer), tile.ZoomLevel, tile.X, tile.Y) { }
public VectorTiler(IPersistStuff <VectorQuadTile> testTileStore, TiledVectorLayer layer) { this.layer = layer; tileStore = testTileStore; }