Skip to content
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

multires_image wont display more than one level #814

Open
avaziri opened this issue Feb 22, 2024 · 1 comment
Open

multires_image wont display more than one level #814

avaziri opened this issue Feb 22, 2024 · 1 comment

Comments

@avaziri
Copy link

avaziri commented Feb 22, 2024

My config files are attached. This example is of an architectural drawing pdf that was converted into images.

A few assumptions just to make sure I understand the file structure and config correctly following from this discussion:

  • The filenames must have exactly 5 bits for row and for column. So "tile00000x00000" no more or less.
  • The layers are saved in folders named "layer0" ... "layer4".
  • "layer0" is meant to be the finest level of detail with the most tiles
  • The tiles must be square aspect ratio
  • Every tile, regardless of layer, should all be the same number of pixels. e.g. If layer0 tiles are 512x512 then layer1 tiles should be as well. The exception is the highest layer where that image is allowed to not be square.
  • The image_width and image_height in the config are the total width and height if you combined all the tiles from "layer0" into one high-res image

I tried many variations on all of the above and the best I could get was to get either a single image from layer0 to display or with a different config four images from layer0 to display. I am happy to generate different images if any of my above assumptions were wrong.

See the attached configs

  • test_one_layer.geo configures the multrires_image to expect that 1 tile would cover the original image. It loads a single image from layer0. I think that seems like the expected behavior? (ignore the fact that the images is just of a corner of the pdf, that is because the files I provided assume you use all the layers)
  • test_two_layers.geo configures the multires_image to expect that 4 tiles would cover the original image. It loads four images from layer0 and no matter how much you zoom in our out it never loads something else. I would have expected it to load 1 image from layer1 until you zoom in enough to see four images from layer0.
  • test_three_layers.geo returns the following error in the CLI "Error: Failed to load image."
  • test_all_layers.geo never returns an error on the CLI, but never shows images either

example_map_viz_config.mvc.txt
example_tiles_and_multires_configs.zip

@DangitBen
Copy link
Contributor

For what it's worth, I don't think the image paths in your zip file are all correct. How did you go about creating them?

Your image file names almost look like they are assuming that the numbers are bits or flag? (all 0s or 1s):

tiles/layer0/tile00000x00000.jpg
tiles/layer0/tile00000x00001.jpg
...
tiles/layer0/tile01111x01111.jpg

But based on your .geo file, mapviz is expecting something more like row_numXcolumn_num:

tiles/layer0/tile00000x00000.jpg
tiles/layer0/tile00001x00000.jpg
tiles/layer0/tile00002x00000.jpg
...
tiles/layer0/tile00015x00015.jpg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants