i am looking for c# routine where i will pass a big picture path and routine will break that picture in tile and save in file system and also save each small tile into into db.
1) so redirect me to routine which can break image into small tile 2) my db table would look for store tile data for each userid
ID UserID Z X Y
--- ------ --- ---- ----
1 Bob 0 0 0
2 Chris 1 1 1
the above data is a fake one. i am looking for a way which break big image data into tile and save tile info into right folder structure and also save image info including folder structure into db table as a result i could load tile from file system but based on store tile data into db table.
here i got a vb.net could which is loading tile data
How you generate and return the tiles is very flexible indeed
L.tileLayer('**http://localhost/tileserver/tile.aspx?z={z}&x={x}&y={y}**', {
minZoom: 7, maxZoom: 16,
attribution: 'My Tile Server'
}).addTo(map);
where Tiles.aspx
Option Strict On
Partial Class tile
Inherits System.Web.UI.Page
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
Dim z, x, y As Integer
z = CInt(Request.QueryString("z"))
x = CInt(Request.QueryString("x"))
y = CInt(Request.QueryString("y"))
Dim b() As Byte = DB.GetTile(z, x, y)
Response.Buffer = True
Response.Charset = ""
'Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.ContentType = "image/png"
Response.AddHeader("content-disposition", "attachment;filename=" & y & ".png")
Response.BinaryWrite(b)
Response.Flush()
Response.End()
End Sub
here i have one confusion that how the below code can load many small tile because when we break a big picture into small tiles then we need load all tiles or few tiles on page load but below code is looking for a specific tile
http://localhost/tileserver/tile.aspx?z={z}&x={x}&y={y}
L.tileLayer('**http://localhost/tileserver/tile.aspx?z={z}&x={x}&y={y}**', {
minZoom: 7, maxZoom: 16,
attribution: 'My Tile Server'
}).addTo(map);
any one can nicely explain how the above code can work when we need to load many tiles into map ?
i consult these post and url as follows How to store image tiles in file system for leaflet.js
How TO serve Map tiles from a database using Leafletjs
Using custom map image tiles in LeafletJS?
Thanks