-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do I make it work to make mbtile file? #3
Comments
A typical mbtiles creation call would look like this (all on one line):
The |
Apparently some applications use a flipped Y axis with mbtiles files. Mapbox's mb-util package will by default create the same style of mbtiles file as meta2tile, but supports a Line 716 in 508b0e0
|
When I use meta2tile to make lots of stand alone tiles from the meta tiles, like this: all those subdirs and tiles are corrext (z,x,y). If it is a flipped Y axis problem when creating mbtile files, why is not same problem happening when creating lots of single tiles from the meta tiles - using meta2tile (works flawlessly)? I will look closer into the tiles in the generated mbtiles file - to see if the tiles have been flipped, and report back. |
I cannot explain what you describe. The code determines the Y coordinate in Line 537 in 508b0e0
Line 615 in 508b0e0
Line 716 in 508b0e0
|
Hi again. Looked more closely into the generated mbtile file that was generated by the meta2tile file where I changed two lines. When I downloaded the files that I used from this repository, I just went here: then I clicked on the file meta2tile.c, UPDATE: Just checked both the original meta2tile.c and the one I changed - both have the code intact regarding the ty variable. Thanks a lot for the quick replies. |
Okay, thouth I should give it a try by using then when I run make I got fatal error: zip.h: No such file or directory then make again and it gets compiled. and the mbtile is generated. |
Using mbutil (with --scheme=tms ) on the stand alone tiles generated by meta2tile fixed the flipped y issue. Thanks a lot for that quick fix suggestion. Next now will be to create a pull request so hopefully we can get the tms option in meta2tile. I will enter that request tomorrow. |
When I go to "Pull requests" I see this message: |
The "pull request" is for if you have solved the issue. If you cannot solve the issue and just want someone else to solve it, then things are ok as they are, we'll just leave this issue open until someone has the time to fix it. |
I have compiled meta2tile.c and got it working to make a lot of single tiles from the meta tiles directory.
But I would like to make an mbtile file. Could someone provide some examples on what syntax to use when running meta2tile to produce mbtile (hopefully without having to change the c code)?
I tried to do this:
./meta2tile --mbtiles /var/lib/mod_tile/default /media/test/tissd/mbtiles/wz12.db
that gives this error:
cannot create directory /media/tore/tissd/mbtiles/wz12.db/12: No such file or directory
So even if I use --mbtiles as parameter meta2tile still want to create single meta tiles inside a directory that does not exist - because the last part in the last parameter (wz12.db) is the target filename for the mbtile file to be created (and not an existing directory).
After some trail and error - I found some text inside the meta2tile.c file that said one must define WITH_MBTILES
So then I created a copy of meta2tile.c - named meta2mbtile.c and added:
#define WITH_MBTILES
compiled and run it without luck.
then I changed
static int mbtiles = 0
to
static int mbtiles = 1
and now it created an mbtile file without any other input from command line than meta-tile-dir and target file name:
like this:
./meta2mbtile /var/lib/mod_tile/default /media/test/tissd/mbtiles/wz12.db
and then the file reported creating same number of tiles as when creating single tiles. So far so good....
But by some reason the numbering in tile_row column in the wz12.db file is wrong.
zoom_level is set correct to 12
tile_column is set correct from 0 to 4095
tile_row is from 1248 to 3943 - but should have been from 158 to 2847
Is there something else I have to change i the c file to make it work to get the tile_row value (and corresponding tile_data) correct, or even better - if there was some examples on how to use the original file with some parameters when running it from command line - to produce mbtile.
The text was updated successfully, but these errors were encountered: