前段时间做了arcgis bundle压缩地图数据的读取,方法如下,使用object C
+ (NSData *)getCompressedTile:(NSString *)filepath x:(NSString *)x y:(NSString *)y z:(NSString *)z { filepath = [NSString stringWithFormat:@"%@%@", filepath, @"Layers/_alllayers"]; NSString *bundlepath=filepath; bundlepath=[filepath stringByAppendingString:bundlepath]; NSString *lpadding = @"00"; NSString *lz=[NSString stringWithFormat:@"%@%@", lpadding, z]; NSString *l = [NSString stringWithFormat:@"L%@",[lz substringFromIndex:[lz length] - 2]]; int row = [y intValue]; int col = [x intValue]; int rGroup = 128 * (row / 128); NSString *r = [[NSString alloc] initWithFormat:@"%1x",rGroup]; while ([r hasPrefix:@"0"]) { r = [r substringFromIndex:1]; } int rLength = [r length]; if (rLength < 4) { r = [NSString stringWithFormat:@"0000%@", r]; r = [r substringFromIndex:[r length] - 4]; } r = [NSString stringWithFormat:@"R%@", r]; int cGroup = 128 * (col / 128); NSString *c = [[NSString alloc] initWithFormat:@"%1x",cGroup]; while ([c hasPrefix:@"0"]) { c =[c substringFromIndex:1]; } int cLength = [c length]; if (cLength < 4) { c = [NSString stringWithFormat:@"0000%@", c]; c = [c substringFromIndex:[c length] - 4]; } c = [NSString stringWithFormat:@"C%@", c];//@"R0a00" @"C3480" NSString *bundleBase = [NSString stringWithFormat:@"%@/%@/%@%@", filepath , l,r ,c]; NSString *bundlxFileName = [NSString stringWithFormat:@"%@.bundlx", bundleBase]; NSString *bundleFileName = [NSString stringWithFormat:@"%@.bundle", bundleBase]; NSFileManager *filemanager=[NSFileManager defaultManager]; //NSLog(@"bundle%@,bundlx%@,bundlx %@,%@,%@,%@",bundleFileName,bundlxFileName,c,l,r,bundleBase); // NSLog(@"bundle------:%@",bundleFileName); // NSLog(@"bundlx------:%@",bundlxFileName); if (![filemanager fileExistsAtPath:bundleFileName]||![filemanager fileExistsAtPath:bundlxFileName]) { // NSLog(@"地图bundle文件或bundlx文件不存在!"); return nil; } int index = 128 * (col - cGroup) + (row - rGroup); NSFileHandle* lxfileHandle=[NSFileHandle fileHandleForReadingAtPath:bundlxFileName]; [lxfileHandle seekToFileOffset: 16 + 5 * index]; Byte bufferbundlx[5]; NSData *data=[lxfileHandle readDataOfLength:5]; [data getBytes:bufferbundlx]; long offset = (long ) (bufferbundlx[0] & 0xff) + (long) (bufferbundlx[1] & 0xff) * 256 + (long) (bufferbundlx[2] & 0xff) * 65536 + (long) (bufferbundlx[3] & 0xff) * 16777216 + (long) (bufferbundlx[4] & 0xff) * 4294967296LL; // NSLog(@"%ld",offset); NSFileHandle *lefileHandle=[NSFileHandle fileHandleForReadingAtPath:bundleFileName]; [lefileHandle seekToFileOffset:offset]; Byte bufferbundle[4]; NSData *bundleIndex=[lefileHandle readDataOfLength:4]; [bundleIndex getBytes:bufferbundle]; int length = (int) (bufferbundle[0]& 0xff) + (int) (bufferbundle[1] & 0xff) * 256 + (int) (bufferbundle[2] & 0xff) * 65536 + (int) (bufferbundle[3] & 0xff) * 16777216; // NSLog(@"dddddddddd%d",length); NSData *result=[lefileHandle readDataOfLength:length]; //关闭文件流 [lxfileHandle closeFile]; [lefileHandle closeFile]; return result; }
相关推荐
.tpk格式的ArcGIS切片包后缀名改为.zip,利用java程序读取bundlx文件中的图片偏移量和bundle文件中的4字节图片长度和图片内容,并将图片输出
利用C#实现的读取ARCGIS SERVER 紧凑型缓冲文件BUNDLE的类。
ArcGIS 安卓和IOS客户端读取ArcGIS Server 后台服务配置
利用java程序解析ArcGIS切片包,较之前两版的更新完整版 利用java程序解析ArcGIS切片包,较之前两版的更新完整版
Arcgis 10.3破解文件,使用方法: 1、自行安装lm,关闭服务,拷贝破解文件①② 2、自行安装desktop,拷贝破解文件③,启动lm服务。 破解覆盖文件所在路径: ①service.txt--->C:\Program Files (x86)\ArcGIS\...
arcgis for ios demo 官方例子
Arcgis10.2.2破解文件
ArcGIS 10.1 破解文件。在你安装完ArcGIS 10.1 for Desktop.iso后使用的。
ArcGIS 10.1 破解文件
arcgis 加载tif文件,tif文件必须得在动态资源文件夹里面,无需重启服务,动态加载服务器文件里面的tif图片
arcgis 9.3许可文件arcgis 9.3许可文件arcgis 9.3许可文件arcgis 9.3许可文件arcgis 9.3许可文件
ArcGIS 加载百度地图算法 代码简单易用
ArcGIS API For iOS 2.2.1及26个例程源代码 ArcGIS API for iOS 使您可使用 Objective C 构建多种应用程序(这些应用程序将运用 ArcGIS Server 提供的强大制图、地理编码、地理处理和自定义功能)并将它们部署到 ...
ARCGIS enterprise授权文件(含server和portal),亲测可用
ArcGIS10.2破解文件ArcGIS10.2破解文件ArcGIS10.2破解文件ArcGIS10.2破解文件
ArcGIS For iOS 开发的配置,操作系统使OS X 10.9,Xcode 5,SDK 7.0
arcgis10.2许可文件
arcgis全系列授权文件,最新弄到的。
ArcGIS 10.3破解文件及破解说明