View Single Post
gnuite's Avatar
Posts: 1,245 | Thanked: 421 times | Joined on Dec 2005
#53
Originally Posted by ioan View Post
Here is an idea.
Make in the db where you want to keep the map tiles two tables.
one coordinates and CRC of the image tile and in the second table the CRC of the image and the image. This way you can exclude duplicates, we'll have only one tile that is blue... or white... or whatever.

you make the CRC as a unique key in the images table.
when you insert, you insert in both tables, in the image table the insert will fail (if the CRC is already there). this way you won't have to check if the image is already in the table before inserting.

What do you think?
Sounds like a good idea, although I'll probably reserve it for tiles that are 103 bytes large, since those are the only ones that are a solid color. All that CRC calculation would be such a waste of CPU.