Questions on ImageTileLayer

View: New views
5 Messages — Rating Filter:   Alert me  

Questions on ImageTileLayer

by Adams Tan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all, 

I have been playing around with ImageTileLayer and I noticed once I set the layer to be visible, it will take quite a while (assuming I have a huge 30MB png sliced into 300 tiles, about 100KB per slice) where I will see small boxes appearing one by one. At this stage, does the images already get loaded into the memory heap? If not, why would this process take so long? I assume that the images are only loaded (on demand) when the current scale matches the cut-off scale specified, hence, this long delay seems unnecessary.
cale goes lower than what I specified in the cut-off scale,

Another issue that I noticed is the cut off scale does not seems to make much diff on when the image is actually displayed (pre-loaded or not, i'm not sure). A setting of 100,000 (default) and 1,000,000 does not seems to affect when each images are displayed. Often I see partial display of tiles even though i set the cache size to 50. Sometimes I count the number of squares and they are lower than the cache size that I set. Shouldn't all the tiles in the current map view be displayed as long as they are below my specified cache size?

Thanks,
Adams

Re: Questions on ImageTileLayer

by Don Dietrick :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Adams,

The intention of the code is that the images shouldn't be loaded in to  
memory until they need to be viewed.  As far as I can tell, the delay  
you are seeing is the JAI code running through the file finding the  
geospatial tags, trying to find out where the images go.  I have some  
tiles (similar sizes) that are handled really quickly, and others that  
are pretty slow.  I haven't been able to find out what the difference  
between the two files are, or what JAI is doing differently for those  
slower files.

I haven't noticed an issue with the scale settings, I'll take a look  
at it, though.

- Don



On Sep 27, 2009, at 6:52 AM, Adams Tan wrote:

> Hi all,
>
> I have been playing around with ImageTileLayer and I noticed once I  
> set the layer to be visible, it will take quite a while (assuming I  
> have a huge 30MB png sliced into 300 tiles, about 100KB per slice)  
> where I will see small boxes appearing one by one. At this stage,  
> does the images already get loaded into the memory heap? If not, why  
> would this process take so long? I assume that the images are only  
> loaded (on demand) when the current scale matches the cut-off scale  
> specified, hence, this long delay seems unnecessary.
> cale goes lower than what I specified in the cut-off scale,
>
> Another issue that I noticed is the cut off scale does not seems to  
> make much diff on when the image is actually displayed (pre-loaded  
> or not, i'm not sure). A setting of 100,000 (default) and 1,000,000  
> does not seems to affect when each images are displayed. Often I see  
> partial display of tiles even though i set the cache size to 50.  
> Sometimes I count the number of squares and they are lower than the  
> cache size that I set. Shouldn't all the tiles in the current map  
> view be displayed as long as they are below my specified cache size?
>
> Thanks,
> Adams

--
[To unsubscribe to this list send an email to "majdart@..."
with the following text in the BODY of the message "unsubscribe openmap-users"]

Re: Questions on ImageTileLayer

by Adams Tan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Don, thanks for the prompt reply.

So i can assume with a max cache size of X, at any one time, only X tiles are kept in mem (with the rest unloaded and waiting for GC)? In that case, is there a reason for the partial loading behavior?

On the other hand, I was looking through the code and I noticed getBufferedImage was called twice (once when the small squares will loading up, once when i zoom in enough for the images to be displayed). Do you think this accounts for the initial delay. In that case, wouldn't all the images be already loaded in memory (thought not displayed) once I set the layer to be visible.

Adams

On Sun, Sep 27, 2009 at 10:49 PM, Don Dietrick <dietrick@...> wrote:
Hi Adams,

The intention of the code is that the images shouldn't be loaded in to memory until they need to be viewed.  As far as I can tell, the delay you are seeing is the JAI code running through the file finding the geospatial tags, trying to find out where the images go.  I have some tiles (similar sizes) that are handled really quickly, and others that are pretty slow.  I haven't been able to find out what the difference between the two files are, or what JAI is doing differently for those slower files.

I haven't noticed an issue with the scale settings, I'll take a look at it, though.

- Don




On Sep 27, 2009, at 6:52 AM, Adams Tan wrote:

Hi all,

I have been playing around with ImageTileLayer and I noticed once I set the layer to be visible, it will take quite a while (assuming I have a huge 30MB png sliced into 300 tiles, about 100KB per slice) where I will see small boxes appearing one by one. At this stage, does the images already get loaded into the memory heap? If not, why would this process take so long? I assume that the images are only loaded (on demand) when the current scale matches the cut-off scale specified, hence, this long delay seems unnecessary.
cale goes lower than what I specified in the cut-off scale,

Another issue that I noticed is the cut off scale does not seems to make much diff on when the image is actually displayed (pre-loaded or not, i'm not sure). A setting of 100,000 (default) and 1,000,000 does not seems to affect when each images are displayed. Often I see partial display of tiles even though i set the cache size to 50. Sometimes I count the number of squares and they are lower than the cache size that I set. Shouldn't all the tiles in the current map view be displayed as long as they are below my specified cache size?

Thanks,
Adams



Re: Questions on ImageTileLayer

by Adams Tan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Don,

Any help on the following?

On Mon, Sep 28, 2009 at 9:18 AM, Adams Tan <nikida78@...> wrote:
Hi Don, thanks for the prompt reply.

So i can assume with a max cache size of X, at any one time, only X tiles are kept in mem (with the rest unloaded and waiting for GC)? In that case, is there a reason for the partial loading behavior?

On the other hand, I was looking through the code and I noticed getBufferedImage was called twice (once when the small squares will loading up, once when i zoom in enough for the images to be displayed). Do you think this accounts for the initial delay. In that case, wouldn't all the images be already loaded in memory (thought not displayed) once I set the layer to be visible.

Adams


On Sun, Sep 27, 2009 at 10:49 PM, Don Dietrick <dietrick@...> wrote:
Hi Adams,

The intention of the code is that the images shouldn't be loaded in to memory until they need to be viewed.  As far as I can tell, the delay you are seeing is the JAI code running through the file finding the geospatial tags, trying to find out where the images go.  I have some tiles (similar sizes) that are handled really quickly, and others that are pretty slow.  I haven't been able to find out what the difference between the two files are, or what JAI is doing differently for those slower files.

I haven't noticed an issue with the scale settings, I'll take a look at it, though.

- Don




On Sep 27, 2009, at 6:52 AM, Adams Tan wrote:

Hi all,

I have been playing around with ImageTileLayer and I noticed once I set the layer to be visible, it will take quite a while (assuming I have a huge 30MB png sliced into 300 tiles, about 100KB per slice) where I will see small boxes appearing one by one. At this stage, does the images already get loaded into the memory heap? If not, why would this process take so long? I assume that the images are only loaded (on demand) when the current scale matches the cut-off scale specified, hence, this long delay seems unnecessary.
cale goes lower than what I specified in the cut-off scale,

Another issue that I noticed is the cut off scale does not seems to make much diff on when the image is actually displayed (pre-loaded or not, i'm not sure). A setting of 100,000 (default) and 1,000,000 does not seems to affect when each images are displayed. Often I see partial display of tiles even though i set the cache size to 50. Sometimes I count the number of squares and they are lower than the cache size that I set. Shouldn't all the tiles in the current map view be displayed as long as they are below my specified cache size?

Thanks,
Adams




Re: Questions on ImageTileLayer

by Adams Tan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I start looking closely and I think I know why the scale settings couldn't work.
I referred to http://openmap.bbn.com/doc/api/com/bbn/openmap/layer/imageTile/ImageTileLayer.html
where the example was to use:

# optional - image cutoff scale specifies the scale that...
imageTileLayer.imageCutoffScale=1000000

However it seems that in the code, the actual property key is
imageCutoffRatio and not imageCutoffScale. BTW, I'm trying to figure
out what is the unit for this ratio, is it a per imagetile scale?

----

Anyway, I was looking at ImageTile.java (line 132) and it seems that
for similar sized tiles at the same projection, the imageScale was
sometimes calculated differently (with alarming differences of nearly
twice). That prob resulted in some tiles appearing partially (and
randomly) at certain scale.

---

Adams


On Mon, Sep 28, 2009 at 9:18 AM, Adams Tan <nikida78@...> wrote:

> Hi Don, thanks for the prompt reply.
> So i can assume with a max cache size of X, at any one time, only X tiles
> are kept in mem (with the rest unloaded and waiting for GC)? In that case,
> is there a reason for the partial loading behavior?
> On the other hand, I was looking through the code and I noticed
> getBufferedImage was called twice (once when the small squares will loading
> up, once when i zoom in enough for the images to be displayed). Do you think
> this accounts for the initial delay. In that case, wouldn't all the images
> be already loaded in memory (thought not displayed) once I set the layer to
> be visible.
> Adams
>
> On Sun, Sep 27, 2009 at 10:49 PM, Don Dietrick <dietrick@...> wrote:
>>
>> Hi Adams,
>>
>> The intention of the code is that the images shouldn't be loaded in to
>> memory until they need to be viewed.  As far as I can tell, the delay you
>> are seeing is the JAI code running through the file finding the geospatial
>> tags, trying to find out where the images go.  I have some tiles (similar
>> sizes) that are handled really quickly, and others that are pretty slow.  I
>> haven't been able to find out what the difference between the two files are,
>> or what JAI is doing differently for those slower files.
>>
>> I haven't noticed an issue with the scale settings, I'll take a look at
>> it, though.
>>
>> - Don
>>
>>
>>
>> On Sep 27, 2009, at 6:52 AM, Adams Tan wrote:
>>
>>> Hi all,
>>>
>>> I have been playing around with ImageTileLayer and I noticed once I set
>>> the layer to be visible, it will take quite a while (assuming I have a huge
>>> 30MB png sliced into 300 tiles, about 100KB per slice) where I will see
>>> small boxes appearing one by one. At this stage, does the images already get
>>> loaded into the memory heap? If not, why would this process take so long? I
>>> assume that the images are only loaded (on demand) when the current scale
>>> matches the cut-off scale specified, hence, this long delay seems
>>> unnecessary.
>>> cale goes lower than what I specified in the cut-off scale,
>>>
>>> Another issue that I noticed is the cut off scale does not seems to make
>>> much diff on when the image is actually displayed (pre-loaded or not, i'm
>>> not sure). A setting of 100,000 (default) and 1,000,000 does not seems to
>>> affect when each images are displayed. Often I see partial display of tiles
>>> even though i set the cache size to 50. Sometimes I count the number of
>>> squares and they are lower than the cache size that I set. Shouldn't all the
>>> tiles in the current map view be displayed as long as they are below my
>>> specified cache size?
>>>
>>> Thanks,
>>> Adams
>>
>
>

--
[To unsubscribe to this list send an email to "majdart@..."
with the following text in the BODY of the message "unsubscribe openmap-users"]