4

I am quite new to QGIS and need some help with this.

Basically I have the coordinates of a piece of land which I can find both through Google Earth and my country's mapping service website. I downloaded a .ECW file with an (raster) orthophotomap from the grid of rectangles of the country where the property is located. After this, I load this orthophoto as a raster layer and try to extract the piece of the map/aerial photo that actually contains the property by using Raster->Extract->Clipper. The result I get here though is not a clipped portion of the original map because QGIS issues an error message which I do not understand why nor what to do about (see attached image), so I can't do the following step to extract the actual contours.enter image description here

The coordinates that are used are directly input from the image in QGIS by dragging the cursor on the picture, so do not understand why the message about a negative width or hight. Can anyone help?

  • Look at your coordinates. The minY seems to be bigger than maxY. – user30184 May 19 '17 at 17:01
  • yes, but don't understand why? I am just dragging the mouse cursor on top of the image and a region (in red) is created, I assume that this region should have the right coodinates....that's what puzzles me! – Antonio Scotti May 20 '17 at 16:59
  • Hi, I drew the rectangle from the bottom up instead, and QGIS doesn't complain now ...but it only draws a black rectangle instead than a clipped rectangle of the region....any ideas why? – Antonio Scotti May 20 '17 at 19:23
  • 1
    I am not sure if it relevant at all to continue this path if your aim is to create contour lines. Hou can't find them from normal orthophotos. If hou want you can make a new question about how to clip a part of orthophoto with QGIS. Include gdalinfo report of the original image in that new question. – user30184 May 20 '17 at 20:02
3

Unless your ortophoto has an elevation values, I would suggest trying to get a Digital Elevation Model (DEM) of the specific area you are looking to make contour lines of. Once you have this resource, it is quite easy to then use any contour tool you prefer. You can chose the increment of the contour lines as well.

Here is an example with a DEM making contour lines at every 50 meter.

Firstly, you need your DEM to be projected as your contour tool will take the projection unit (feet, meters, etc.) as it's reference to apply to your DEM. In other words, if your DEM elevation is in feet, your contour lines will be in feet as well.

In my case, they are in meters. The tool I have used is GRASS GIS 7's r.contour.step and here are the parameters:

enter image description here

The result is a line shapefile and for me looks like this: enter image description here

  • I hope it works for what you want to do! DEMs are usually free around where I work (I work on data around most of North America) hopefully it's the same for you! Also, the higher the resolution of the DEM, the better (more precise) the result. What you see here is 10x10 meter pixels. – Louis May 19 '17 at 17:32
  • I am just seeing that for that to be useful I need to determine first the clipping rectangle that limits the area for which I need the contours..otherwise I will get contour lines for a huge area...I may try to clip that as well later...but..don't know.... – Antonio Scotti May 19 '17 at 18:22
  • I see you used a Lidar file in the other comments, that result is pretty much the same thing as a DEM, even better :) I didn't think of that alternative as I've never used Lidar yet! – Louis May 19 '17 at 19:12
1

I eventually managed to solve the issue. It had to do with using the right CRS.

When I created an intial raster of the territory where the property is, QGIS automatically assigned a WGS84 CRS to the image while the native and intended CSR of the image file source was ETRS89 with a UTM zone 31. This happened both when I tried to get a clip of the initial map and when I tried to get the contours from the LIDAR file. So thanks for all those who have tried to help me.

0

Have you tried using the Mask layer option instead of Extent?

There was a similar question in this post: Error message received when clipping raster, but it does not seem to match what you have done. I think the reason why the error says it is a negative width/height indicates that there is a problem with the CRS.

I've tried to reproduce the error myself, but have had no luck.

Is this question really about contours? You should use tags that are more appropriate for the question.

  • Well I need to extract contours..so in this sense it is. But I am also starting to think that the CRS has something to do with this issue. The one I am using is ETRS89, which is also part of the raster filename. If I change it to WGS84 then I do not get the error message, but the scale of the image changes a lot...also I manage to create a contour lines file .dxf but can't see any contour lines, just a colored rectangle overlapping the clipping rectangle..... – Antonio Scotti May 19 '17 at 17:44
  • What method are you using to generate contours? – Anonymous May 19 '17 at 17:54
  • I use a lidar file as input, than I use Raster->Extract->Contours – Antonio Scotti May 19 '17 at 18:23
  • Could you add a screenshot of that? If you haven't already looked at it, there is a tutorial here QGIS Tutorials and Tips that I found useful. – Anonymous May 19 '17 at 19:19
  • Don't know how to add an image here..... – Antonio Scotti May 20 '17 at 19:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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