|2.3.8 - MBTiles support||Igor Brejc||8/6/12 11:19 AM|
I've just released a new version which comes with a new command: http://maperitive.net/docs/Commands/GenerateMBTiles.html
Play with it and let me know how it behaves. You can also create a free account at MapBox that lets you upload up to 50 MB of tiles (http://mapbox.com/plans/).
The next thing I'm planning to do is to write my own PNG encoder since I'm not satisfied with the one provided by .NET. Hopefully this encoder will produce smaller PNGs and will also work in Mono.
Although for my demo MapBox map (https://tiles.mapbox.com/breki/map/hiking-demo) I used 8-bit PNGs, this is a far from ideal solution - once you have hillshading, there are many more colors than the 256 palette allows, so everything else is dithered. Since dithering is done per-tile, this produces various artifacts (see the lake tiles, for example). So I want to go with a different solution, if possible.
|Re: [Maperitive] 2.3.8 - MBTiles support||Simone Cortesi||8/6/12 3:25 PM|
On Mon, Aug 6, 2012 at 8:19 PM, Igor Brejc <igor....@gmail.com> wrote:Thanks Igor,
Any other way of display MBTiles beside using mapbox? any plugin to leaflet?
|Re: 2.3.8 - MBTiles support||tomgiam||8/6/12 7:16 PM|
It's working fine for me.
I was able to generate an MBTiles file from a map of central London.
Number of tiles=5,576
Tiles per second=7.2
I was able to view it on Windows using MBTilesViewer
I was able to use it in my ios application
Comments and observations:
It only used 4 out of my 8 threads on I7 2600k
I have an 8GB Windows 7 64 bit system . Would more memory help? It was using about 7.2GB.
Can you provide a 6 bit PNG option?
Have you tried using a PNG optimizer like PNGSlim?
|Re: [Maperitive] 2.3.8 - MBTiles support||Igor Brejc||8/7/12 1:39 AM|
This is a server-side thing - the web server that hosts tiles needs to know how to get each tile the browser (user) has requested. In a "normal" map hosting, the tiles are just files on the disk and the web request simply fetches them directly. When using MBTiles, however, the map server has to open the SQLite file, find appropriate tile row and then return the image data.
So there's no Leaflet plugin, no. The browser doesn't really know it's dealing with MBTiles map server and it doesn't need to know.
For the server-side, look at https://github.com/mapbox/mbtiles-spec/wiki/Implementations, I think there is at least this one: https://github.com/mapbox/tilestream
This is why I was asking about MBTiles hosting last week (https://groups.google.com/group/maperitive/browse_thread/thread/304141fe547fce90). I have some ideas on how the MBTiles map serving could be improved even further.
|Re: [Maperitive] 2.3.8 - MBTiles support||Simone Cortesi||8/7/12 1:42 AM|
On Tue, Aug 7, 2012 at 10:39 AM, Igor Brejc <igor....@gmail.com> wrote:There seems to be something which works with OL though:
|Re: [Maperitive] Re: 2.3.8 - MBTiles support||Igor Brejc||8/7/12 1:46 AM|
On Tue, Aug 7, 2012 at 4:16 AM, tomgiam <liqui...@gmail.com> wrote:
This is because tile generation currently works on one thread only. Only in cases of contours labeling does it use other threads.
I've implemented an experimental multi-thread tiles generation a while back, but it has some serious issues and it complicates the code a lot, so I've put it on hold for now.
In general, not really. The memory is only an issue if you have a large map.
There's no 6 bit PNG :). The minimum bitness is 8 bit. But I'm working on a better PNG encoding, which should reduce PNG sizes a lot without loosing the quality.
Have you seen http://braincrunch.tumblr.com/post/22037453467/maperipy-sample-generate-tiles-and-then-optimize-with
The problem is that this is too slow. It would be even slower for MBTiles, since I would need to write PNGs as files to disk first, then use an optimizer, and only then store them to MBTiles. Not worth it.
The best way to optimize PNGs is to create them optimized right at the start.
|Re: [Maperitive] 2.3.8 - MBTiles support||Igor Brejc||8/7/12 1:50 AM|
On Tue, Aug 7, 2012 at 10:42 AM, Simone Cortesi <sim...@cortesi.com> wrote:
Yes, but this still requires the server side (PHP script):
Create TMS layer with PHP script to fetch images from MBTiles sqlite database file
|Re: [Maperitive] 2.3.8 - MBTiles support||Simone Cortesi||8/7/12 2:24 AM|
On Tue, Aug 7, 2012 at 10:50 AM, Igor Brejc <igor....@gmail.com> wrote:Yes, but php comes in pretty much any webhosting system. It is not
such a big prerequisite.
|Re: [Maperitive] 2.3.8 - MBTiles support||Igor Brejc||8/7/12 3:06 AM|
On Tue, Aug 7, 2012 at 11:24 AM, Simone Cortesi <sim...@cortesi.com> wrote:
I agree, although I'm not sure that script is good enough for running it on a production server. Opening the SQLite file for each HTTP request seems to be a bit wasteful for me.
|Re: [Maperitive] Re: 2.3.8 - MBTiles support||tomgiam||8/7/12 6:26 AM|
|Re: [Maperitive] Re: 2.3.8 - MBTiles support||Igor Brejc||8/7/12 7:00 AM|
Most of those improvements are the result of converting their 8-bit .png map tile sample down to 6-bit (64) color,
This is a bit misleading. Yes, you can reduce the palette to 64 colors or even 1 color, but each pixel still uses the whole byte (8 bits) as an index to that color in the palette.
So the only real saving you get is the reduced palette (256-64) * 3 = 576 bytes. Given that you loose a lot of colors, I don't see this as a being very worthwhile tradeoff.
There is no other 6bit support in PNG, the specs are pretty strict about that.
|Re: 2.3.8 - MBTiles support||Christoph Matthei||8/7/12 7:05 AM|
Thanks a lot for this feature. I hope it is going to make map updates much faster.
Could anyone post some bit of example code to make a website for testing these mbtiles-files? I would like to test it on my own server and not just on mapbox. Some kind of a slippy map with openlayers?
|Re: [Maperitive] Re: 2.3.8 - MBTiles support||Igor Brejc||8/8/12 1:52 AM|
This all depends on what web server you have, what kind of access to it etc.
One approach was posted by Simone yesterday. I googled out another, more complicated one: http://nelsonslog.wordpress.com/2011/09/20/serving-mbtiles-tiles-for-slippy-maps/
... and this one: http://blog.perrygeo.net/2012/03/25/working-with-mbtiles-in-python/
|Re: 2.3.8 - MBTiles support||Thomas Langner||8/15/12 8:11 AM|
die Nutzung von MBTiles in Mobac 1.9 funktioniert sehr gut. So kann man sehr schön offline Karten mit mehreren Layern erstellen. Siehe folgendes Beispiel:
p.s. hoffentlich meckert jetzt keiner, weil ich auf deutsch geschrieben habe...
|Re: [Maperitive] Re: 2.3.8 - MBTiles support||Igor Brejc||8/15/12 11:33 PM|
Thanks for the info.If anyone complains about German, they can always Google-translate it ;)
Anyway, here's translation:
the use of MBTiles in Mobac 1.9 works very well. So you can create very nice offline maps with multiple layers. See the following example:
<name> hybrid MBTiles </ name>
<sourceFile> D: \ GPS \ Maperitive \ Tiles \ Overlay.mbtiles </ sourcefile>
<atlasType> MBTiles </ atlas type>
<backgroundColor> # 000000 </ backgroundColor>
P.S. I hope no one complains now because I've written in German ...