Re: [OpenMap Users] Render Type Problem

From: Don Dietrick <dietrick_at_bbn.com>
Date: Mon, 1 Nov 2004 10:46:10 -0500

On Nov 1, 2004, at 7:08 AM, Gatrell, Mark (UK) wrote:

>
> Hi Don
>
> Thanks for the help.. I think my problem was that I was creating my
> own omGraphicList and not adding the omGraphics to the main list.. (I
> think!).
> After reading the docs a bit bit more I have done the following to
> display my omGraphics..
>
> 1. I created a list of omGraphics specific to my layer.
> 2. I add this list to the main list using the getlist method and then
> the add method.
> 3. When I want to modify my omGraphics I modify there parameters(lat
> lon for instance) and call the regenerate method using the projection
> returned from getProjection.
> 4. I then call repaint to display the modified omGraphic.
>
> All this works fine,except for the code placing of these procedures...
>
> In the documentation for OmGraphicHandlerLayer that I am extending, It
> suggests that I generate my list of omGraphics within the Generate
> method and return them. If I do this they do not appear on the map..
> Any Ideas?
>
> I generate my omGraphs in my init method instead and this works fine.

The OMGraphicHandlerLayer sets the OMGraphicList returned from the
prepare() method as the list. The default prepare() method, however,
simply returns the OMGraphicList it gets from the getList() method,
calling generate(getProjection()) on it first.

You don't want to be using the ListResetProjectionChangePolicy on your
layer, it will clear out the list when it receives the new projection
before calling prepare(). You want to keep the default,
StandardPCPolicy.

I don't really have a good idea of how you are managing your
OMGraphicList and what threads are updating that data. The prepare()
method is usually used to handle projection changes in the SwingWorker
thread, so the default implementation should be good enough for you if
you are creating your OMGraphics in the layer constructor. If you know
your layer is always going to be on the map, creating them in the layer
init() method is also OK. I usually create OMGraphics in the prepare()
method, so I don't create them until the layer is actually added to the
map. A null OMGraphicList from getList() is my flag to know when the
layer goes active, and initialization work needs to be done.

Your description of how you are implementing the OMGraphic changes
seems sound, though.

> Apart from the above I have noticed a strange behaviour.. To test the
> speed of update of my new 4.6 version, I update my omGraphics lat lon
> continuously every 100 ms moving it around in a circle.. I have
> noticed that if I show the demo layer it causes a few missed positions
> being shown on the map. I would expect some performance degradation
> but I notice if I zoom out then the problem improves! I would have
> expected it to worsen as it has to draw more of the map?

It probably depends on how zoomed in you are, and what other layers are
doing as well. Java rendering clipping could be slowing things down
if your layer or other layers are really drawing things far off-screen.

> Another performance problem I have noticed is when I try to display a
> CSVTiledImagePlugin layer referencing an image only 2.5MB. Basically I
> cant, it reports out of memory.
> I have displayed at least 16MB images in 4.5.4 without any problem.

I run with a Java heap of 256 Mb, so I don't usually see
OutOfMemoryExceptions that often. I think there are clipping
improvements in the OMScalingRaster render algorithm in 4.6.1, which is
being pushed out the door as I type this. But with scaling rasters,
it's not always so much the size of the original image as it can also
be the rendered size, too.


- Don
>
> -----Original Message-----
> From: Don Dietrick [mailto:dietrick_at_bbn.com]
> Sent: 28 October 2004 17:34
> To: Gatrell, Mark (UK)
> Cc: Openmap-Users (E-mail)
> Subject: Re: [OpenMap Users] Render Type Problem
>
>
> *** WARNING ***
>
> This mail has originated outside your organization,
> either from an external partner or the Global Internet.
> Keep this in mind if you answer this message.
>
> I'd check and make sure the coordinates are floats, and aren't getting
> interpreted as integers.
>
> - Don
>
> On Oct 28, 2004, at 10:55 AM, Gatrell, Mark (UK) wrote:
>
>>
>> Hi All
>> I am in the process of upgrading my existing application using
>> OpenMap4.5.4 to a version using OpenMap4.6.
>> My problem, is that if I create an OmText graphic and place it on the
>> map, although I set the render type to latlon the graphic does not
>> re-project to the correct location if I zoom in (for instance) , It
>> stays at the same xy position on the screen.
>>
>> Any ideas what it is I'm doing wrong?
>>
>> Your help is appreciated.. Thanks
>>
>> Regards
>>
>> Mark.
>>
>> ********************************************************************
>> This email and any attachments are confidential to the intended
>> recipient and may also be privileged. If you are not the intended
>> recipient please delete it from your system and notify the sender.
>> You should not copy it or use it for any purpose nor disclose or
>> distribute its contents to any other person.
>> ********************************************************************
>> --
>> [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"]
>>
>>
>
>
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> Don Dietrick, dietrick_at_bbn.com
> BBN Technologies, Cambridge, MA
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
>
>
> ********************************************************************
> This email and any attachments are confidential to the intended
> recipient and may also be privileged. If you are not the intended
> recipient please delete it from your system and notify the sender.
> You should not copy it or use it for any purpose nor disclose or
> distribute its contents to any other person.
> ********************************************************************
> --
> [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"]
>
>


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Don Dietrick, dietrick_at_bbn.com
BBN Technologies, Cambridge, MA
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

--
[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 Nov 01 2004 - 10:47:08 EST

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