Re: [OpenMap Users] Improve performance when dynamic layers are repainted

From: Ruben DF <rdocasalf_at_yahoo.es>
Date: Mon, 20 Sep 2010 09:25:51 +0000 (GMT)

Hi Don,

First of all, thanks for answering. I was devoting my work hours to other project therefore I couldn't do anything about this until now. I was trying some of advices you told me. I have a well-separated class which calls to rapaint every ten times per second (10hz) and my application manages three dinamic layers. The problem remains and I have new questions...I'm working with java 1.6...can this slow down the performance of Openmap? Because I've read this need java 1.4 to work properly. How Openmap repaints the elements of the layers? I mean, if I have thouse 3 dinamic layers and I call repaint only one of them...the others layers are repainted too in order not to leave a trace? I've also tried to call repaint with a well-defined area (x1,y1,x2,y2) but it seems to draw anything..

You know if Openmap 5 has improved regarding performance? Thanks in advance. You are doing a great job helping GIS community.



--- El vie, 16/7/10, Don Dietrick <dfdietrick_at_gmail.com> escribió:

De: Don Dietrick <dfdietrick_at_gmail.com>
Asunto: Re: [OpenMap Users] Improve performance when dynamic layers are repainted
Para: "Ruben DF" <rdocasalf_at_yahoo.es>
CC: openmap-users_at_bbn.com
Fecha: viernes, 16 de julio, 2010 19:57

Hi Ruben,

The first thing I would do is drop the refresh rate to make them happen further apart than 100ms.  Think about what you are trying to display on the map, what is changing and how far they actually move every 100ms.  You might need that fast of a turnaround, but you might not, too.

Secondly, if you know that you constantly need the map refreshed, stop calling repaint from the layer and have a separate component call repaint on the MapBean itself, on whatever interval you choose.  It's better to have a regular, simple update mechanism controlled by a single source - that way the awt queueing mechanism doesn't have to work to make sure all requests are handled.  The threads driving the layer updates should just prepare and generate the OMGraphicLists on the layers, and the layers simply paint whatever is there when the paint call comes through.

Hope this helps,

Don


On Jul 16, 2010, at 8:07 AM, Ruben DF wrote:

> Hi,
>
> I'm writing you because I have a huge performance problem when I repaint several dynamic layers each 100 milliseconds.
>
> I have static layers (which are defined in openmap.property) and dynamic layers which are defined in execution time. These dynamic layers contains a series of OMGraphics such as lines, polylines...etcetera.
>
> The process to repaint (each 100 milliseconds) that I'm using is (after adding/modifing elements to omGraphicList):
>
> omGraphicList = layer.prepare();
> layer.setList(omGraphicList);
> layer.repaint();
>
> I don't know if I'm repainting in the best way (for example, i dont know if I could paint only the elements which have changed its location), but when I call repaint, the map goes slowly (zoom, pan...etc)
>
> I'm using a MapBean (not BufferedMapBean), does it affect to the performance? (I have to say that I have no problem with static layers)
>
> Anybody can help me?
>
> Thanks in advance
> Regards
>

--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Mon Sep 20 2010 - 05:29:39 EDT

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:09 EDT