存储嵌入式地图应用程序的图像
我有不同分辨率的光栅化地图,其中包含 15K/60K/240K 图片,每个尺寸为 256x256,并且我有可以显示地图的 .NET Compact Framework 应用程序。 但是将300k文件复制到SD卡需要很多时间,大约需要35-60小时(我只复制了15K,花了大约2到2.5小时),而且我担心它会破坏FAT16文件系统(硬件不支持) FAT32,所以我无法将 fat16 切换到 fat32),否则复制所有内容后运行速度会非常慢。
所有图片都这样存储: /mapdata/res{resolution}/x{x_coord}/y{y_coord}.png
任何嵌入式数据库都可以帮助我吗?或者我应该将图像打包成 zip 像 /storage/res1/x12.zip 并存档所有 y*.png 吗?或者我应该用所有这些图片创建 ISO 映像,然后将 ISO 逐字节复制到 SD?
I have rasterized map in different resolutions, which consists of 15K/60K/240K pictures each sized 256x256, and i have .NET Compact Framework application which can display the map.
But it takes a lot of time to copy 300k files to SD card, approximately 35-60 hours (i copyied just 15K and it took ~ 2 to 2.5 hours), and i'm afraid it will ruin FAT16 filesystem (hardware does not support FAT32, so i can't switch fat16 to fat32) or after copying everything will work very slow.
All pictures are stored like this: /mapdata/res{resolution}/x{x_coord}/y{y_coord}.png
Can any embeddable DB help me? Or should i pack images into zip like /storage/res1/x12.zip with all y*.png archived? Or i just should create ISO-image with all these pictures and just copy iso to SD byte-to-byte?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
FAT16 仅限于 65,535 个簇,每个文件至少需要一个簇,这将排除仅使用平面文件的可能性。
我假设您的地图图块是只读的,所以我会采取一种为您控制的图块创建自定义文件格式的方法(可能还具有需要更多努力来分解的额外好处,应该它落入错误的手中)。
也许是这样的:
查找给定图块的偏移量,并在报告流结束时覆盖流以执行“正确的事情”,这将是相对轻量级的 - 如果您要编码,您甚至可以对“无图块”图片使用相同的偏移量无法完全融入正方形的区域(例如英国)
FAT16 is limited to 65,535 clusters, and a minimum of a single cluster is required per file, which will rule out just using flat files.
I'm assuming your map tiles are to be read-only, so I would take a route of creating a custom file format for your tiles that you control (may also have the added benefit of requiring a bit more effort to take apart, should it fall into the wrong sort of hands).
Maybe something along the lines of:
It would be relatively lightweight to look up the offsets for a given tile, and override a Stream to do "the right thing" when reporting end of the Stream - you could even use the same offset for "no tile" pictures should you be encoding an area that doesn't fit neatly into a square (like, say, Great Britain)