Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I’m trying to create contours from a raster layer in QGIS. On my first attempt, I cropped my raster layer in Photoshop and reimported it, but it lost coordinate data I think. I made the contours successfully and they were beautiful, but mirrored upwards from the raster layer.

The scale is way out. I discovered this when I imported some vector data. A distance that should be 0.04 degrees is now 30 degrees. This probably is why I’m having my next problem:

I eventually figured out a method for cropping the raster layer in QGIS so it’s at the right scale and location. However, when I make contours from this raster they appear square and pixellated, like they follow the pixel boundaries of the raster layer.

The pixel data for the two raters I used looks the same, so why is this one at the smaller scale now looking so different? Any idea how I can get the nice smooth contours that I got on my first attempt (albeit at the wrong scale)?

I’m very new to this, so I may be missing obvious things! I’d appreciate any help.

share|improve this question
2  
What tool are you using to generate the contours? –  Nathan W May 7 '12 at 0:35
    
It would also be a good idea to check and make sure that the cell size and other factors did not change during the cropping process. If the cell size increased significantly from the original, that could make the resulting contours very angular instead of having smooth curves. –  Get Spatial May 7 '12 at 6:33
    
I’m using the GDAL tools plugin to generate the contours (Raster > Extraction > Contour). –  Graham vdR May 7 '12 at 7:27
    
Ah, @GetSpatial, if I look at the metadata for the two raster layers I see the Pixel Size has increased hugely (though visually I see no difference). Any ideas on how to avoid this? –  Graham vdR May 7 '12 at 7:32
    
OK, problem solved! I used Raster > Extraction > Clipper to make the crop and the contours I generated subsequently are perfect. Obviously the method I had tried for cropping was not ideal. Thanks for your contributions, @NathanW and GetSpatial. –  Graham vdR May 7 '12 at 7:40

1 Answer 1

This answer summarizes the comments above, where the solution was discovered.

The problem turned out to be that during the cropping process on the raster, the cell size was increased dramatically. When the contour operation was run, it created very angular and pixellated lines.

I suggested:

It would also be a good idea to check and make sure that the cell size and other factors did not change during the cropping process. If the cell size increased significantly from the original, that could make the resulting contours very angular instead of having smooth curves.

Here is how @GrahamvdR found the problem:

Ah, @GetSpatial, if I look at the metadata for the two raster layers I see the Pixel Size has increased hugely (though visually I see no difference). Any ideas on how to avoid this?

Here is the solution as described by @GrahamvdR:

OK, problem solved! I used Raster > Extraction > Clipper to make the crop and the contours I generated subsequently are perfect. Obviously the method I had tried for cropping was not ideal.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.