Re: [OpenMap Users] Some beginner questions

From: Don Dietrick <>
Date: Wed, 26 Oct 2005 11:41:04 -0400

Hi Stéphane,

On Oct 24, 2005, at 8:09 AM, Stéphane WASSERHARDT wrote:

> Hello list !!
> I’m new to OpenMap, and I have some questions before starting my
> OpenMap
> project :
> 1) TILING : It seems that OM doesn’t support tiled images (correct
> me if I’m
> wrong). Did someone already worked on tiled images, like Tiff or
> GeoTiff ?
> Is there a way to load only a region of an image when "repainting"
> a layer ?
> (instead of loading the whole image etc...)

You can use OMRasters or OMScalingRasters to display images in
OpenMap, tiled or not. If you use OMRasters, you have to make sure
that the projection of the image matches the projection set in the
MapBean. The OMScalingRaster will scale the image for you based on
the upper left and lower right corner coordinates, but again, the
projection types must match.

There isn't a built-in way to control which parts of the image are
loaded as they pertain to the map, but you could probably use JAI to
control that, and feed the resulting images into an OMScalingRaster
for display.

> 2) JPEG2000 support : I know there's no official JPEG2000 "Layer" or
> "Plugin" in OpenMap, but maybe some work has been done by someone.
> I think
> using JPEG2000 rasters would be great because this format allows
> direct
> reading of an image at a given scale ; it could save a lot of scaling
> processing time... (Note that JPG2K also supports tiling) If you
> have any
> information about this, it would be kind to let me know :)

I don't know of specific support for JPEG2000, but I think I'd take a
look at JAI for that first.

> 3) Viewer DEMO : I played a bit with the demo included in the OpenMap
> distribution, and saw that the refreshing time was quite long.
> That's not a
> problem for my application, but the most annoying thing is that
> when the
> view is refreshed, the map disappears. It would be better if the
> refresh
> process took place in a buffer and waited for all layers to be
> drawn on the
> buffer before refreshing the view on the screen... I saw in the doc
> that
> there are some "Buffered" classes. So I imagine that they are
> designed to
> avoid that kind of refreshing problems. But then, why weren't these
> classes
> used in the viewer demo ?? (I may be wrong : perhaps these classes
> ARE used
> in the demo, but they do not consider the problem exposed here...)

The Buffered classes weren't really designed to specifically avoid
that effect, but they should help with the overall response of
certain layers.

Even with it's buffered, the political boundary layer may take a
while to re-project, although I don't know what you consider to be a
long delay. When buffered, that shouldn't take more than a couple of
seconds. The buffering for that layer just keeps the file data
loaded into memory so the layer doesn't have to go back to the source
for new data for each projection (when unbuffered, it only uses what
it needs to display on the map).

i know some people don't care for this effect, but it's by design and
I view it more as a feature than a problem. This behavior lets you
see as much of the new map as possible when it is ready, instead of
holding the entire response for the slowest layer.

> 4) TRANSPARENCY : Is it possible to specify transparency for layers,
> including raster layers ? I really need this functionality, and I
> wasn't
> able to find it using the viewer demo except with the drawing layer
> (so I
> assume transparency is ok at least for vector layers, but what
> about raster
> layers ?)...

It's not hard to do, and is built into the next version of OpenMap.
You can create an instance of an AlphaComposite object with a
transparency value, and set it on the Graphics2D object before
rendering OMGraphics into it (in a Layer's paint() method). In the
next version of OpenMap, you can ask an OMGraphicHandlerLayer for
it's RenderPolicy and set the Composite object on it.

Hope this helps,


[To unsubscribe to this list send an email to ""
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Wed Oct 26 2005 - 11:44:29 EDT

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