Leaflet Raster Tiles

623 views
Skip to first unread message

Valerio De Luca

unread,
Dec 17, 2015, 11:48:20 AM12/17/15
to Leaflet
hi guys,
this is a raster on leaflet test:


I used qgis2.8 and qgis2leaf. I tryed qgis2web but it doesn't export raster. I'd like open leaflet without slow loading raster. I need a plugin or script that create tiles for every zoom level. A plugin or a python script. So leaflet doen't read the big png in data folder (of export forlder) but leaflet read a set of folder any for zoom level with inside tiles for that zoom level. So I upload not the big png on my server online but tiles in folders. (for server I use Digital Ocean).
This is the way for my other application: photosfere:


I don't upload the big jpg sphere (equirectangular format). Before I trasform the big sphere in tiles with a py script(generate.py). And the sphere loading so fast! ("Using generate.py to create multires panoramas" at https://github.com/mpetroff/pannellum).

Do you know a way for get tiles for leaflet? To have a fast upload.
Tks so much
best
Valerio

Valerio De Luca

unread,
Dec 18, 2015, 9:16:29 AM12/18/15
to Leaflet
I m trying fast uploading of raster on leaflet. This is my demo online:
http://vdlmap.com/leaflet/lr/index.html
...but is not fast!
So this:
http://www.cityplanner.it/tilemill-alla-mappa-online/
https://github.com/mapbox/mbutil

I m on windows7, with python27.
I installed in this way:
download https://github.com/mapbox/mbutil/archive/master.zip
from cmd:
cd C:\leaflet\mbutil
setup.py install
and run:
cd C:\leaflet\mbtiles (where is my file.mbtiles)
set path=%path%;C:\Python27\
mb-util C:\leaflet\mbtiles\open-streets-dc.mbtiles C:\leaflet\mbtiles


file.mbtiles is about 11mb. Now is in processing...
I create file.mbtiles with TileMill, but from standard template! How create .mbtiles from my own jpg (with jgw) or tif (with tfw)?
tks man
best
valerio 

Matt Travis

unread,
Dec 19, 2015, 11:21:52 AM12/19/15
to Leaflet

Valerio De Luca

unread,
Jan 2, 2016, 12:04:50 PM1/2/16
to Leaflet
fix it!

Leaflet Raster Tiles

http://vdlmap.com/leaflet/lr/tile4/tile4.html

http://www.cityplanner.it/tilemill-alla-mappa-online/

=======================================

webgis

leaflet

raster tiles

cartella webgis - leaflet - progetto - data - raster/vector

1 raster georeferenziato tif jpg

2 progetto qgis salvare in /progetto/progetto.gqs

3 importare il raster in qgis

4 raster nella cartella /progetto/data/raster/raster1/raster.tif

5 meglio riproiettare tutti i raster in

- wgs84z33 - 32633

- wgs84z32 - 32632

6 impostare il progetto qgis in uno di questi due sistemi di riferimento sopraelencati

7 abilita la riproiezione al volo

8 nelle proprietà del progetto abilitare anche altri sistemi di riferimento

progetto - proprietà progetto - server ows -

capabilities wms - estensione pubblicata - imposta all'estensione della mappa

restrinzioni sr - (+) - 32632/32633

- 3004/3003

- 4326

- 3857

-ok

9 Plugin qgis qtiles

output - scegliere directory /progetto/data/raster/raster1/tile/

- tileset name "tile"

extent - layer extent

- minimum zoom 10

- maximum zoom 20

parametri -tile width 256 blocca rapporto 1:1

- format png

- background transparency 255

- write leaflet-based viewer

- ok

10 viene genererato un file tile.html

aprire con notepad++

cambiare questa riga con

vecchia : varmytile = L.tilelayer('[[[[[[[[[[file:///C:/webgis/leaflet/progetto/data/raster/raster1/tile/]]]]]]tile/{z}/{x}/{y}.png')

nuova : [[[[[[['http://mysite.com/leaflet/progetto/data/raster/raster1/tile/']]]]]]]]]]]]]/{z}/{x}/{y}.png'

provare a caricare questa mytile anche in un altro progetto leaflet html magari esportato da qgis2leaf

=======================================

Reply all
Reply to author
Forward
0 new messages