in reply to Radar and Goo::Canvas

I have no idea what radar means as you describe it. At first thought I pictured a rotating line sweeping over the canvas, but you talk like you want some sort of locator grid, superimposed on the geotiff. This all sounds pretty complex, and at the very least you will need to show a basic code sample of what you want to do.

From your ideas, it sounds like you are making it too complicated with overlays. What you need to do is setup a coordinate-transformation system, between your geotiff and the canvas. Then just put a blinking red-dot at that point, and move it as needed.

The difficult part is figuring out the formulas to match the geotiff to the canvas, and I have no idea what geotiff does. Does it define the latitude and longitude of it's corners with smooth gradations from corner to corner? That is the sort of thing you will need to figure out.

As far as pixel size goes, I bellieve you would just do your calculations as a 1-1 pixel size, then when done multiply the x y values by the current zoom level. I havn't tested that.... the zoom may work automagically.


I'm not really a human, but I play one on earth CandyGram for Mongo

Replies are listed 'Best First'.
Re^2: Radar and Goo::Canvas
by Anonymous Monk on Jun 30, 2008 at 15:05 UTC
    probably wanted weather radar (green is rain ...)
      Yes!! I'm looking to add a WSR-88D (doppler radar) overlay to the application. Most radar data is in spherical coordinates which can be hard to transfer to gridded (lat lon) coordinates, but it is possible. The best thing I can think of to do is to overlay an image, such as a png, over the top of the application field. Is there a way to set a color in goo::canvas that will be invisible?
        Is there a way to set a color in goo::canvas that will be invisible?

        There are 2 different things you are talking about. An item (like a rectangle) will be transparent if you don't fill it with a color. But for an image, the transparency is set in the image. Look at the demo, and the torroid..... the edges and center are transparent because the torroid.png was created with black as transparent.

        So.... you will need to figure out what is the color of the background of the doppler overlay, and make it transparent. I don't know offhand if the Gtk2 will change transparency of an image (it probably does but the docs don't make it obvious) , or you can use ImageMagick, GD, or Imager to set the transparent color.

        You might want to ask this on the Perl/Gtk2 maillist. The Gtk2::Image can be loaded with a mask, but I don't have an example. The odds are you will either be setting white or black to be transparent, and I would guess the doppler image would already be setup for transparency. Have you tried to overlay the doppler image onto the geotiff yet? It may just work right out of the box. If you google for "gtk2 image transparent mask" you will find some php code you can adapt to Perl, that shows how to load an image with a transparency mask.


        I'm not really a human, but I play one on earth CandyGram for Mongo