AW: [OpenMap Users] ImageServer

From: Gubler, Rüdiger <rgubler@init-ka.de>
Date: Fri Feb 21 2003 - 01:29:23 EST

Hello,

I've added

        public void renderDataForProjection(Projection proj, Graphics g)
        {
                _projection = proj;
                _projID = proj.getProjectionID();

                // kill old list
                _omgraphics = null;

                // redo the layer
                computeLayer();
                if (_omgraphics != null)
                {
                        _omgraphics.project(proj);
                }
                paint(g);
        }

to the layers but the don't work. The logmessage from the first layer comes but not for the second.
The picture is empty too.

Yours Ruediger

-----Ursprüngliche Nachricht-----
Von: Hutson, Joe [mailto:Joe.Hutson@usigs.com]
Gesendet: Donnerstag, 20. Februar 2003 18:24
An: Keith Alphonso; "\"Gubler, Rüdiger\" "; Don Dietrick (E-Mail) ;
Openmap-Users (E-Mail)
Betreff: RE: [OpenMap Users] ImageServer

There is a default implementation of renderDataForProjection in Layer, but
doesn't do enough for the imageServer. I was using a layer modeled after
com.bbn.openmap.examples.simple.RouteLayer and added an implementation of
renderDataForProjection which included "omgraphics.project(proj);". Then it
worked for me.

-----Original Message-----
From: Keith Alphonso [mailto:kalphonso@diamonddata.com]
Sent: Thursday, February 20, 2003 10:19 AM
To: '"Gubler, Rüdiger" '; 'Don Dietrick (E-Mail) '; 'Openmap-Users
(E-Mail) '
Subject: RE: [OpenMap Users] ImageServer

 I had a similar problem and it turned out that I was not implementing the
renderDataForProjection. This is necessary for image generation.

-----Original Message-----
From: "Gubler, Rüdiger"
To: Don Dietrick (E-Mail); Openmap-Users (E-Mail)
Sent: 2/20/03 1:58 AM
Subject: [OpenMap Users] ImageServer

Hello,

I use the following code to get an image:

              ImageFormatter imageFormatter = null;
                Projection proj = null;
                Vector layerVec = null;
                Layer[] layers = null;
                byte[] data = null;

                layerVec = new Vector();
                layerVec.add(new WayLayer("Ways"));
                layerVec.add(new AreaLayer("Urban",
GisUrbanArea.class));

                layers = (Layer[]) layerVec.toArray(new
Layer[layerVec.size()]);
                imageFormatter = new SunJPEGFormatter();
                ((SunJPEGFormatter) imageFormatter).setImageQuality(1f);

                proj = ProjectionFactory.makeProjection(projType,
latitide, longitude, scale, width, hight);

                ImageServer imageServer = new ImageServer(layers,
imageFormatter);
                imageServer.setDoAntiAliasing(true);
                data = imageServer.createImage(proj, -1, -1);

                try
                {
                        OutputStream fos = new
FileOutputStream("C:/GisImageTest/Test.jpg");
                        fos.write(data);
                        fos.close();
                }
                catch (FileNotFoundException fnfex)
                {
                        Logger.defaultLogger.log(Level.ERROR,
fnfex.getMessage(), fnfex);
                }
                catch (IOException ioex)
                {
                        Logger.defaultLogger.log(Level.ERROR,
ioex.getMessage(), ioex);
                }

The problem is that only the background is painted and the Layers (which
worked great in a MapBean) do nothing. I have added some
logmessages into the computeGraphics() method of the layers.

What is going wrong?

Yours Rüdiger

--
[To unsubscribe to this list send an email to "majdart@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@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@bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Fri Feb 21 01:31:35 2003

This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:34 EDT