GithubHelp home page GithubHelp logo

Large mbtiles about tileserver-php HOT 13 CLOSED

maptiler avatar maptiler commented on September 10, 2024
Large mbtiles

from tileserver-php.

Comments (13)

klokan avatar klokan commented on September 10, 2024

You have very probably incomplete MBTiles file - where some required fields are missing in the metadata table so the tileserver needs to detect it.
Fix you file. If you use MapTiler (http://www.maptiler.com/) you would not have this problem.

See #34

from tileserver-php.

klokan avatar klokan commented on September 10, 2024

BTW if I am wrong in any point @mantesat, please let me know and we reopen this ticket. ;-)

from tileserver-php.

mantesat avatar mantesat commented on September 10, 2024

Well, if I increase the timeout setting on the http server, the page finally loads, and the map works as expected. This mbtile file also works with tilemill. Are you sure this is not related with the file size?

from tileserver-php.

mantesat avatar mantesat commented on September 10, 2024

Also downloaded MapTiler free and tried to open the file. It opens normally. So this must be an issue of the initial tileserver webpage creation.

from tileserver-php.

klokan avatar klokan commented on September 10, 2024

Well, I just expect that internal metadata table inside of your MBTiles
files is incomplete - as described in #32 - where you also find command and
open-source utilities how to fix it.

Unrelated: Viewing your existing MBTiles file in MapTiler Free does not
imply anything in this case. You would need to generate the MBTiles files
inside MapTiler. I expect you file is not generated by TileMill either. It
was probably created with a different utility, right?

On Fri, Aug 7, 2015 at 1:55 PM, mantesat [email protected] wrote:

Also downloaded MapTiler free and tried to open the file. It opens
normally. So this must be an issue of the initial tileserver webpage
creation.


Reply to this email directly or view it on GitHub
#51 (comment)
.

Petr Pridal, Ph.D.
CEO

Klokan Technologies GmbH
Hofnerstrasse 98, 6314 Unterageri, Switzerland
Tel: +41 (0)41 511 26 12
Email: [email protected]
Web: http://www.klokantech.com/

from tileserver-php.

mantesat avatar mantesat commented on September 10, 2024

I believe it was generated with TileMill (didn't do it myself, a colleque gave me the file). Will try to check the metadata table as you suggested, and I'll let you know.

from tileserver-php.

mantesat avatar mantesat commented on September 10, 2024

Well, tried all sorts of tests, compared my files with TileMill files or mbutils generated files... metadata contain all necessary fields. I can't ignore that the larger the mbtiles file, the more the webpage takes to load (tried with 100MB, 1GB, 5GB, 15GB files). Note that by increasing the timeout parameter for my http server the page eventually loads as it should, and everything works as expected. It's just that the larger the files, the longer the delay needed for rendering the initial tileserver webpage.

from tileserver-php.

klokan avatar klokan commented on September 10, 2024

What is result of command:

$ sqlite3 yourfile.mbtiles 'SELECT * FROM metadata'

for your file?
I expect one of minzoom, maxzoom, format, bounds is missing.

This is an open-source project - you can examine the complete source code, identify the problem, fix it and submit a patch (pull request) so the community can benefit from your work and effort.

If you want us (@klokantech team) dig deeper into the problem we can also review the problem in detail and fix it as part of a contract.

from tileserver-php.

mantesat avatar mantesat commented on September 10, 2024

This is my output on the sqlite3 query:

$ sqlite3 ENCs.mbtiles 'select * from metadata';
bounds|18.281,34.312,30.932,42.033
center|23.8815,38.0545,8
minzoom|8
maxzoom|18
name|ENC Charts
description|
attribution|
template|
version|1.0.0
format|png

I believe no fields are missing. I also profiled the php script and I found that the delay is caused by a query: 'SELECT grid FROM grids LIMIT 1' which is located in tileserver.php:548. I tried to run the following command script for my file:

$ date;sqlite3 ENCs.mbtiles 'select grid from grids limit 1';date;

The result was:

Tue, Aug 11, 2015 11:17:09 AM
Tue, Aug 11, 2015 11:20:22 AM

So this means that this query causes the entire delay. Any ideas about this?

I'm not that proficient in PHP/sqlite3, if I was (and I had the available time), I could give it a try to dig more into it.

from tileserver-php.

klokan avatar klokan commented on September 10, 2024

Interesting.

Could you please try the speed of:
SELECT name FROM sqlite_master WHERE name='grids';

(tip from http://stackoverflow.com/questions/1601151/how-do-i-check-in-sqlite-whether-a-table-exists)

from tileserver-php.

mantesat avatar mantesat commented on September 10, 2024

Tried it, doesn't return anything. Opened the file using a visual sqlite viewer and saw that 'grids' is actually a view, not a table. Does this mean that the server script probably creates the view when the select query is executed?

Looking a little more, I saw that this is only used for UTFGrids. I suppose that if this functionality is disabled, things should be normal.

from tileserver-php.

klokan avatar klokan commented on September 10, 2024

Could you please try this file:
https://raw.githubusercontent.com/klokantech/tileserver-php/large-mbtiles/tileserver.php
?

It should be fast.

from tileserver-php.

mantesat avatar mantesat commented on September 10, 2024

Yes, it's very quick now, loads the webpage with my 15GB file instantly! Good job, thanks for looking into this. Glad I could help.

from tileserver-php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.