How-to get "redundant tiles" into MBTiles's sqlight tile view? - ios

At MBTiles Link there is a section:
Using views to reference redundant images
MBTiles can reduce the amount of space used by these redundant tiles drastically by implementing the tiles table as a view
If I have z/x/y folder of png tiles how to i get the "mbutil" to import identical png images
into the tiles view? Or would I have to do it by myself after "mbutil" has done its import into sqlite? if yes are there any scripts available for this?

Currently mbutil does not support compression like TileMill does - the code is there, but not connected to the executable you get when you install it. An enterprising Python developer could do the wiring to make it possible; otherwise, TileMill is the main application that outputs compressed MBTiles.

Related

How to import single tileset image into xCode (Sprite Kit)?

Example of tileset:
http://www.rpg-studio.org/wiki/images/9/92/Tileset.png
How to import these images into this grid in Xcode?
https://koenig-media.raywenderlich.com/uploads/2016/06/AdjacencyTileGrid.png
The problem is Xcode doesn't understand that there is a lot of subimages inside parent image.
I've already saw a lot of examples which use tiled map editor but it has its own format and you can't design such levels in Xcode's visual editor. So they are not appropriate for me.
I also saw that people always avoid to use tilesets - they somewhere get a lot of separate images instead and doesn't describe what to do with a single big tileset.
The simplest solution might be to just start with individual images that can feed into Xcode’s image handling pipeline.
My understanding of the Tilesets you’ve described is they are produced from individual images with a tool like TexturePacker which is then consumed by the Tiled Map Editor. The tmx maps produced by the Tiled Map Editor are consumed in Xcode using SKTiled for Swift or JSTileMap for Objective-C.

Software to open titled geo PNG file?

I'm trying to extract some a data (a map image) from a PNG file which is tiled somehow. The file itself is only 256x256 pixels (according to 'get info' on the mac) but is is 23MB. It is from an iPad app called Mud Map and it contains a map that I purchased but I've lost the original that I converted to this format. When I view this file (renamed to a .PNG) I see one section of the map - 256x256px.
I'm asking this question on StackOverflow because I want to know more about these tiled images. How does one create a tiled PNG and what is the software that will open and or create these things. I'm interested in what metadata is required too. I'm loving the outdoors and mapping!!
The answer to this question, is that it cannot be done in manner I have described.
The images in the PNG are not tiled, the the files are just merged together which is no doubt an individual feature of the program as is it does not appear to be any kind of standard.
I have no access to application you mentioned in IPad. Just share some thought about possible situation here.
1) Map tiles are commonly used in GIS web application such as Google maps and so on. It is used to improve the performance especially when user pan very often. A map displayed typical map window is divided into for instance 4*4 separate calls. So maybe only 4 call will be made when user just pan a little bit instead of get the whole map for the 16 tiles.
The source image for this tiles can be in pre-generated tiles or just one static map.
2) Assemble separate images to one in GIS is called image mosaic function. GIS server can read a collection of images and mosaiced them into one with the overlapping part handle based on a certain rule. And the images are in pre defined grid format which are seamless and no overlapping, then it is called tiled images. We could pre-generated the tiles from one mosaiced image, or we can server it on the fly. Some GIS server/library/application does have the tile server function built in.

SpriteKit Map Creation Through Image Pixels

I recently downloaded a project made by apple with SpriteKit to have a look at their code and I noticed something that looked quite interesting. They created their entire map using an image
(project link below- image found at AdventureShared/Assets/Environment/map_level.png)
by taking it apart pixel by pixel. I can't seem the find the code by which they do this in the project but would like some idea on how to do something similar. If anyone could either show me where i can find the code in the project or advise me on how i could replicate the procedure, it would be greatly appreciated. I will give a link to the project below as i am not sure if i can show the code as it is pre-release for iOS8. Thanks a lot!
https://developer.apple.com/library/prerelease/ios/samplecode/Adventure-Swift/Listings/Adventure_Adventure_Shared_AI_ChaseAI_swift.html#//apple_ref/doc/uid/TP40014639-Adventure_Adventure_Shared_AI_ChaseAI_swift-DontLinkElementID_4
Take a look at code:Explained Adventure in there the developers break down exactly how the world generation works, including the pixel mapping and why they chose that method.
Some additional info on how it can be done:
This picture is merely to guide the game designer in the construction of the .sks file
https://developer.apple.com/library/mac/documentation/GraphicsAnimation/Conceptual/CodeExplainedAdventure/Art/map_collision_2x.png
However these images below are texture atlases made by dividing an image of size 4096 by 4096 into 32 tiles by 32,(approximately a 1000 tiles in total).
https://developer.apple.com/library/mac/documentation/GraphicsAnimation/Conceptual/CodeExplainedAdventure/Art/background_texture_atlas_2x.png
To generate these tiles I used gimp. I downloaded a script called to grid to guides and then after using that new tool to make a grid across the image, I went to Filters>Web>Slice and generated all the Tiles. Swift automatically takes the individual tiles and configures them into a texture atlas if they are contained in a file called name.atlas

UIImage -drawAtPoint: very slow for large images

So I have a massive UIImage, maybe 10,000x10,000 px (I know they're not supposed to exceed 1024x1024 apparently, but anyway that's not the main problem). Moving this around the screen (constantly drawing at different points using -drawAtPoint) is very slow.
So I split the image into 100x100 px UIImages, and decided to draw them all separately using drawAtPoint. The result was even worse.
Is there a more efficient way of drawing UIImages to screen like this? Or a more efficient method of managing the images? Thanks.
EDIT.. When I broke it into tiles I was only drawing the tiles that were in view.
Apple has this really nice sample code called PhotoScroller - it shows how to use CATiledLayers along with pre-tiled images. But, you have to create the hundreds of tiles before hand, and either include them in your app bundle or download each.
There is another project on github called PhotoScrollerNetwork that has the ability to download massive jpeg only images and do all the various tiling for you, as it downloads. It leverages another open source library, libjpegturbo.

Create tiled images for CATiledLayer

I am creating a kind of 'map' in my app. This is basically only viewing an image with an imageView/scrollView. However, the image is huge. Like 20,000x15,000 px or something. How can I tile this image so that it fits? When the app tiles by itself, it uses way too much memory, and I want this to be done before the app I launched, and just include the tiled, not the original image. Can photoshop do this?
I have not done a complete search for this yet, as I am away, and typing on an iPhone with limited network connection..
Apple has a project called PhotoScroller. It supports panning and zooming of large images. However, it does this by pre-tiling the images - if you look in the project you will see hundreds of tiles for various zoom sizes. The project however does NOT come with any kind of tiling utility.
So what some people have done is create algorithms or code that anyone can use to create these tiles. I support an open source project PhotoScrollerNetwork that allows people to download huge jpegs from the network, tile them, then display them as PhotoScroller does, and while doing research for this I found several people who had posted tiling software.
I googled "PhotoScroller tiling utility" and got lots of hits, including one here on SO
CATiledLayer is one way to do it and of course the best if you can pre-tile the images downloading them from the internet (pay attention on how many connection you are going to open) or embedding them(increasing overall app size), the other is memory map the image on the file system (but an image with that res could take about 1GB), take a look at this question it could be an intersteing topic SO question about low memory scenario

Resources