Image Cropping
ozcan-durak opened this issue · 8 comments
Hi,
my actual image size : 4096 x 2048
I m trying to slice the image with tileSize : 512,
in this case it should create "32" tiles. but instead creating 89 files with blank images. how can i prevent that.
To make sure that applications don't return 404's mapslice creates full size square maps at the moment. so instead of 4096 x 2048 it thinks this map should be 4096 x 4096 and centers your image in there. This means it will create 8x8 (4096/512) = 64 tiles at its original size. Then it will scale it down in half: 2048 (4096/2) create 4x4 (2048/512) = 16 tiles at 50% scale factor. Then it will do that for 2x2 (1024/512) = 4 tiles at 25% scale factor and 1 tile at 12.5% scale factor. 64 + 16 + 4 + 1 = 85 files. Not quite sure how you get to 89 files (:smile: probably my mistake, have not touched it in a while). With those files you should be able to use a map viewer like that. If this is not what you want: I.e. you want to just tile one level then we need to adopt this application. Can you give a suggestion how this should look like?
Hi thanks for the reply, Glad you calculated that :)
Actualy i m trying to create a service to serve sliced image into pieces. I have 2 millions image which will be (4096x2048) and need to slice them by (512x512) into 32 pieces. In my case i dont need a zoom level. just need to tile them with cordinate. Is it possible create that with your library.
Regards
It needs to be adopted. The technicality the features are there but it will need to be slightly rewritten (i.e. zoomLevels=100,50
and ignoreEmpty
). How would it suit you?
i would be grateful if you can help with that.
What sort of help do you need?
you said that the mapslice creates a fullsize square maps 4096x4096. is it possible to set that to 4096x2048 ?
Well: that would be the former mentioned ignoreEmpty
or lets call it dropEmpty
where the tiles that "are 100% empty" would be deleted. Additionally you would need to specify a mode that specifies the required scale levels or zoom levels.
Closing this issue, mapslice supports now skipEmptyTiles