phl-microsat-dpad / image-browser

BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Use locally hosted tiles #11

Closed benjiao closed 8 years ago

benjiao commented 8 years ago

From @benjiao on November 25, 2015 9:39

Copied from original issue: phl-microsat-dpad/libra#6

benjiao commented 8 years ago

@rukku, @lkpanganiban and @chamthesleeptalker, have you done this before?

benjiao commented 8 years ago

From @lkpanganiban on November 25, 2015 10:20

Using GDAL2TILES: this generates a directory tree of static images which takes into account the zoom level that we want. The generated tiles can be hosted and accessed. We may need to automate the process of tiling and hosting the images - since this generates a lot images. We can have a cron job for new datasets since gdal2tiles is just a CLI and can be integrated to a script.

GDAL2TILES: http://www.gdal.org/gdal2tiles.html

Using GEOSERVER: we can upload our images to geoserver and it will handle the tiling procedure plus we can get the url of just the uploaded tile. Geoserver will serve as our hosting for these images. I have never tried automating the upload process of geoserver. So we may have trouble if we have a dataset which constantly updates.

GEOSERVER: http://geoserver.org/

benjiao commented 8 years ago

@lkpanganiban: I'd probably go with the directory tree of static images and stay away from Geoserver, since we probably won't need the search functionality (correct me if i'm wrong) and the overhead in maintaining it won't be worth it IMHO.

Re: Serving the images, we can probably let Nginx handle this. Since it's just a simple file system. Not sure about the changes we need to do on webapp end though.

Also, we won't have to update the tiles that often, right, @rukku?

benjiao commented 8 years ago

From @lkpanganiban on November 25, 2015 10:38

@benjiao oks :+1: gdal2tiles is python script so we can integrate it more easily. The performance of gdal2tiles.py depends on the size of the image to be 'tiled' and zoom level (so we may need to specify until what zoom level we are going to target). I have tried a 1GB tiff file of zoom level 19 and it took around 30-40 mins depending on the machine. We can use python's multiprocessing module to speed up the tiling process.

benjiao commented 8 years ago

@lkpanganiban pero once lang naman gagawin to 'diba? We just use it to build the file system, tapos bahala na 'yung app?

benjiao commented 8 years ago

From @rukku on November 25, 2015 10:48

Also, we won't have to update the tiles that often, right, @rukku? @benjiao Yup. We'll have to do it once a year or so. Unless may na-OC sa styling satin :laughing:

@lkpanganiban Alternatively, we can just use Tilemill for the styling and export the tiles as images and upload them to the server. Worst case, we can use Mapbox's hosting. I have coupons. haha. For the short term anyway.

I think the goal should be to use vector tiles in the future. Should solve most of our space issues.

https://thatgeospatialblog.wordpress.com/2015/10/12/self-hosting-openstreetmap-osm-vector-tiles/

benjiao commented 8 years ago

From @lkpanganiban on November 25, 2015 10:48

Yup. Primary assumption ko ay sariling tiles natin na galing microsat yung image (raw file). So ano pala yung i-host natin na tiles? We can make the landsat 8 images as 'tiles' parang Google satellite image na may date. Or puwede rin na 'i-download' natin yung mga tiles from other sources like yung mga tiles na featured dito https://leaflet-extras.github.io/leaflet-providers/preview/ (we may need to review the licenses for these images).

benjiao commented 8 years ago

From @rukku on November 25, 2015 10:49

@lkpanganiban I think it would be better to use street map tiles in the meantime. Like the one the Libra demo site uses..No need for satellite imagery.

benjiao commented 8 years ago

From @lkpanganiban on November 25, 2015 10:51

@rukku oks. :+1:

benjiao commented 8 years ago

sooo... @lkpanganiban at @chamthesleeptalker, inyo na to? :p

benjiao commented 8 years ago

From @lkpanganiban on November 25, 2015 11:5

@benjiao kahit sa akin na lng ito. I'll just test out osm tiles first.

benjiao commented 8 years ago

@lkpanganiban oks. :smile:

benjiao commented 8 years ago

@lkpanganiban @rukku: this looks good now, close ko na. thanks!