![]() To calculate density per zoom level (this is the Windows command, modify for Linux accordingly): identify -precision 16 -format "%%\n%%\n%%\n%%\n%%" source.pdf When rendering PDFs I prefer resizing using density. Resize it to each of the levels as described above. The result of this crop-and-append operation is a big high-res image of the map. Magick images\t-0.jpg images\t-1.jpg images\t-2.jpg images\t-3.jpg images\t-4.jpg images\t-5.jpg images\t-6.jpg images\t-7.jpg images\t-8.jpg images\t-9.jpg images\t-10.jpg -append images\t.jpg ![]() Then, when the tiles are cropped, append them to a large image: magick images\t-0-0.jpg images\t-1-0.jpg images\t-2-0.jpg images\t-3-0.jpg images\t-4-0.jpg images\t-5-0.jpg append images\t-0.jpg To figure out crop parameters load vertically and horizontally neighbouring tiles into a graphic editor, try to match them and check the offset coordinates. ![]() In this case you first have to crop the images: magick data\vk-0-0.jpg -crop 522x373 0x0 images\t-0-0.jpg This is an example, tiles are called vk-X-Y.jpg and are cut with some overlapping. This is typical in "old" map clients which you want to slippify. In some cases source images are already cut in tiles. If you have several zoom images for different zoom levels (I guess this will be the case for the MRI scans), choose the closest-zoomed source image. If your source is a high-res image simply use convert -resize with either x*256* or *256*x: convert images\source.jpg -resize x256 images\0.jpgĬonvert images\source.jpg -resize x512 images\1.jpgĬonvert images\source.jpg -resize x1024 images\2.jpgĬonvert images\source.jpg -resize x2048 images\3.jpgĬonvert images\source.jpg -resize x4096 images\4.jpgĬonvert images\source.jpg -resize x8192 images\5.jpg Be careful try to open these images in "normal" tools. Level 5 would be around 10 MB, level 6 around 20 MB, level 7 around 40 MB. You have to produce images with one of the dimensions equal to:Īttention: the result of this step are huge images. Next, render or resize your image for each of the zoom levels. The approache below is probably not suitable for more that 7-8 zoom levels. The more levels you produce, the higher hardware requirements you will have. This depends on the map, from my experience you need 5-7 zoom levels at most. ![]() Decide How Many Zoom Levels You Wantįirst, decide how many zoom levels you want. You also don't want any resizing in the browser, this will lead to poor quality.įortunately, creating tiles is quite easy with ImageMagick. You don't want huge images as layers as that will be to heavy for the browser. to produce tiles sized 256x256 for each of the zoom levels. To give you an example, here's a PDF map of European inland waterways with vector graphics and here's a slippy map of it.īasically, the most reasonable way is to make a standard tile set and let Leaflet show it. ![]() I wanted to write an article on this anyway, so let this answer be a sketch of the yet-to-be-written article. Here's my experience on how to create slippy maps from sources like PDFs or high-res images or non-slippy maps. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |