Closed mackoj closed 9 years ago
Here's an example that I used the other day: ImageChopper world.topo.200408.3x21600x10800.png world_4level world_4level -multires 3 -outSize 256 -outformat jpeg
That takes a whole world image, chops it up 4 levels (0-3) and writes it to a directory named "world_4level" and also calls the resulting image set "world_4level". Output images are 256 pixels and the output format is jpeg.
There's one bug that I'm aware of, though. The plist file it creates will claim the images are tiff. Right now you you just go into the plist and change that to "jpg".
Great ! Thanks and for loading them I just use addSphericalEarthLayerWithImageSet ?
Right.
-outformat is not recognize so I'm trying with -texTool /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/texturetool instead.
If you're not using the develop branch, you should switch to that.
Ok so I switch to develop_2_2 and now the command works perfectly but the images don't seems to load even after modifying the plist.
Use develop, not develop_2_2. That's the 2.2 development tree and it's fairly unstable.
However, that's probably not the problem. Make sure the plist and all the individual images are imported into your project.
Ok I will switch again. I but in the code you don't seems to use maxLevel property from the plist.
Sorry but I still don't succeed to make it work.
But I think I figure where it bug.
It quit in TextureGroup.mm.
if (x >= numX || y >= numY)
return nil;
And if I hide this two line it returns /path_blablabla/mapWithIsland_4level_0x0 instead of /path_blablabla/mapWithIsland_4level_0x0x0.
My mistake above. You should be calling addQuadSphericalEarthLayerWithImageSet That one invokes a quad tree paging layer, which is what you need for that variety of image set.
Ok, now it's bugging in [ImageDataSource initWithInfo:] the info dict is nil.
That means it didn't load the dictionary. Make sure you're passing in the right name and the plist is in the bundle.
I fix it with this.
- (id)initWithInfo:(NSString *)infoName
{
self = [super init];
if (self)
{
NSString *fullPath = [[NSBundle mainBundle] pathForResource:infoName ofType:@"plist"];
// This should be the info plist. That has everything
NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:infoName ofType:@"plist"]];
if (!dict)
{
return nil;
}
// If the user specified a real path, as opposed to just
// the file, we'll hang on to that
basePath=[fullPath stringByDeletingLastPathComponent];
ext = [dict objectForKey:@"format"];
baseName = [dict objectForKey:@"baseName"];
maxZoom = [[dict objectForKey:@"maxLevel"] intValue];
pixelsSquare = [[dict objectForKey:@"pixelsSquare"] intValue];
borderPixels = [[dict objectForKey:@"borderSize"] intValue];
}
return self;
}
I just fix basePath with the good fullPath .
It's expecting you to pass in the full path, rather than just the base name. But that's fine.
Thanks for the help.
Just a note for myself. Fix the bad image type coming out of ImageChopper. Try multiple search paths in SphericalEarthQuadLayer.mm
I'm just deprecating ImageChopper. Better to use TileMill or a command line GDAL tool.
Hi,
How can I do and use multires images ?
Best regards,