Opened 18 years ago

Closed 18 years ago

Last modified 15 years ago

#475 closed bug (fixed)

square raster's pixels not square on display = rasters of different res are displaced

Reported by: tutey@… Owned by: nobody
Priority: major: does not work as expected Milestone:
Component: Rasters Version: Trunk
Keywords: Cc:
Must Fix for Release: Yes Platform: Debian
Platform Version: Ubuntu Dapper Awaiting user input: no

Description

  1. add a a raster with *square* pixels
  1. change QGIS window's proportion to be taller-than-wide, or vice versa
  1. zoom in
  1. see how the pixels are not displayed square (too_wide.png, too_narrow.png)
  1. now display one raster of 5m and one of 10m resolution
  1. see how they are misplaced against each other; set some transparance to see this clearly (misplaced.png)

BTW, these are GRASS rasters I used for examples here, created with r.mapcalc. In QGIS the r.mapcalc output is displayed B&W, while in GRASS (see GRASS_mon.png) it is color with "rainbow" pallete. Note that after I run 'r.colors rules=rainbow' for the raster displayed B&W in QGIS and color in GRASS, it is displayed color in both from then on... weird. Ideas where is the bug (GRASS, GDAL, QGIS, gdal-grass)?

Maciek

Attachments (6)

too_tall.png (15.9 KB ) - added by tutey@… 18 years ago.
too_wide.png (14.4 KB ) - added by tutey@… 18 years ago.
displaced.png (16.5 KB ) - added by tutey@… 18 years ago.
GRASS_mon.png (5.1 KB ) - added by tutey@… 18 years ago.
5res.tif (3.0 KB ) - added by tutey@… 18 years ago.
10res.tif (2.9 KB ) - added by tutey@… 18 years ago.

Download all attachments as: .zip

Change History (18)

by tutey@…, 18 years ago

Attachment: too_tall.png added

by tutey@…, 18 years ago

Attachment: too_wide.png added

by tutey@…, 18 years ago

Attachment: displaced.png added

by tutey@…, 18 years ago

Attachment: GRASS_mon.png added

comment:1 by timlinux, 18 years ago

Does the problem correct itself after the next pan / zoom?

comment:2 by gsherman, 18 years ago

I can't duplicate the problem described in steps 1-4, using either a TIFF or GRASS raster.

GDAL 1.3.2, GRASS 6.2.0

in reply to:  1 comment:3 by anonymous, 18 years ago

Replying to timlinux:

Does the problem correct itself after the next pan / zoom?

No.

in reply to:  2 comment:4 by anonymous, 18 years ago

Replying to gsherman:

I can't duplicate the problem described in steps 1-4, using either a TIFF or GRASS raster.

And I can reproduce it with any raster. Why you can't I don't know.

Pan to the edge of your raster, maybe then you'll see it better. If you still can't see it, measure the pixel dimensions; one axis will be longer (while both should be equal).

GDAL 1.3.2

Same here.

GRASS 6.2.0

I don't think this matters. The bug is in displaying all rasters.

Maciek

comment:5 by gsherman, 18 years ago

I don't need to measure the pixels. I can see that they are still square and I did try it from various locations in the raster.

in reply to:  5 ; comment:6 by tutey@…, 18 years ago

Well then can you display 2 rasters with identical cells allignment, but of different resolution, set the transparency, and reproduce steps 5, 6?

in reply to:  6 ; comment:7 by gsherman, 18 years ago

Replying to tutey@o2.pl:

Well then can you display 2 rasters with identical cells allignment, but of different resolution, set the transparency, and reproduce steps 5, 6?

I don't have any suitable test data....

in reply to:  7 comment:8 by tutey@…, 18 years ago

Replying to gsherman:

I don't have any suitable test data....

Attached are 2 such rasters. One is 5m, the other is 10m. Both have exactly the same extent. Open them in QGIS and set transparency for both. Zoom and pan around a bit. Let me know if you can see how missalligned they are against each other. I can. The missalignment is different depending on zoom level and view center point location. It dissapears after zooming to either rasters full extent.

Maciek

by tutey@…, 18 years ago

Attachment: 5res.tif added

by tutey@…, 18 years ago

Attachment: 10res.tif added

comment:9 by g_j_m, 18 years ago

This problem can be seen in another way that doesn't require two images.

  • load the 5res.tif image
  • click on the zoom in tool to get a cross-hair cursor
  • place the cursor over the bottom right corner of the image and note down the x/y coordinates (should be 481510, 4180530)
  • pan the image so that the bottom right corner of the image is in the middle of the map
  • click on the zoom in tool to get a cross-hair cursor again
  • place the cursor over the same corner and note the x/y coords. They are different. This is the underlying cause of the mis-matched images.

The x/y coordinate of that corner varies with panning and zooming of the image.

comment:10 by anonymous, 18 years ago

Further note: this problem only occurs when the image is panned so that some of the image is off the visible map.

comment:11 by g_j_m, 18 years ago

Resolution: fixed
Status: newclosed

Fixed in 0.8 branch (r6359) and head (r6358).

comment:12 by (none), 15 years ago

Milestone: Version 0.8

Milestone Version 0.8 deleted

Note: See TracTickets for help on using tickets.