⬆️ ⬇️

Yandex Maps and Tile Preparation

The guys here have laid out a program for preparing the tile layer for the Yandex.Maps API



In this regard, I will lay out my utility for writing this summer for cutting a large card into pieces.



I spread it along with the sources, the program is written in Java using JAI and ImageIO .

')

Utility wrote specifically for Yota here for this card .



The compiled jar-nickname is in the / lib of the archive, there are also necessary libraries for working under Windows (if you need to run under Nix, download JAI and ImageIO and resubmit it next to the jar-nick).



Run:



java -Xms1024m -Xmx1024m -cp ./;./jai_core.jar;./jai_codec.jar;./clibwrapper_jiio.jar;./mlibwrapper_jai.jar;./jai_imageio.jar;./map_cutter.jar ru.ak.tools.MapCutter

[result image width] [result image height]

[rescaled map width] [rescaled map height]

[translation X] [translation Y]

[tile X] [tile Y]

[result alpha]

[result dir name]

[original map filename]




Respectively,

[result image width] [result image height] - the width / height of the resulting map (from which you need to cut tiles)

[rescaled map width] [rescaled map height] - as far as you need to reskalit original image

[translation X] [translation Y] - offset of rescaled card relative to the top-left corner of the result

[tile X] [tile Y] - the size of the tiles on which the result will be cut (cut from the top-left corner)

[result alpha] -% correction of alpha channel (set transparency of tiles)

[result dir name] - where to put the cut tiles

[original map filename] - original image



Tiles are cut in PNG format, the format of the name is XY.png, where X, Y are the coordinates of the tile from the top-left corner.

Source: https://habr.com/ru/post/79390/



All Articles