1

enter image description here I am a beginner to GIS systems and am trying to calculate the surface area of a dem using r.surf.area command of GRASS GIS. The surface area it is giving me is unacceptable as it is very small. It is around 0.04 kmsq. What I did was: I created a track and converted it to the .gpx file. I updated elevation values in .gpx file using an online tool and took the file to QGIS. In QGIS I converted it to shapefile. Then used SAGA-> Natural Neighbour to create a DEM. I took the DEM to GRASS GIS in a new location and selected to automatically read from georeferenced data and executed r.surf.area on it and not getting required area. I even tried to execute r.surf.area on a DEM downloaded from the internet but still, I am getting a very small area. –

What is wrong?

  • 2
    Most likely your layer is in a geographic CRS, thus the area is measured in square-degree. Reproject it to a projected CRS, or include a projected CRS in the calculation-command. – Erik May 14 at 15:17
  • How do we do it. Please tell the procedure for the same. Thanks a lot. – Mukund Anand May 14 at 15:36
  • 1
    raster -> projection -> transform, then run r.surf.area again. – Erik May 14 at 15:39
  • What I did was: I created a track and converted it to .gpx file. I updated elevation values in .gpx file using an online tool and took the file to QGIS. In QGIS I converted it to shape file. Then used SAGA-> Natural Neighbour to create a DEM. I took the DEM to GRASS GIS in a new location and selected to automtically read from georeferenced data and executed r.surf.area on it and not getting required area. – Mukund Anand May 14 at 15:50
  • 2
    Please edit your question, so that it contains this informations. This way answering will be easier for other users. – Erik May 14 at 15:55
0

I'm pretty sure that the r.surf.area module does not do any conversion from degrees to metric units. (It would be inaccurate do do so, anyway). So the numbers you are getting are assuming location units are meters, but in a Long/Lat location the units are decimal degrees. To do this right you should create a new projected location (for example UTM), and project your GPX file to that location.

I would also add that your procedure seems somewhat convoluted. The back and forth that you decribed from GPX to Saga to QGIS to GRASS all seems unnecessary to me. You could download an SRTM file from the USGS download service and create your surface area from that directly. This can be done easily in GRASS with the r.in.srtm.region addon. You need to register on the USGS download server to get a username and password in advance, then you can get the elevation tile you need directly.

So to summarize:

  1. Start grass in a longitude/latitude location
  2. Import your GPX file directly into GRASS: v.in.ogr input=<your_track.gpx> output=<your_track>
  3. Install the r.in.srtm.region addon: g.extension r.in.strm.region
  4. Download the required SRTM tile: r.in.srtm.region -1 output=srtm username=<your registered name> password=<your registered password> url=https://e4ftl01.cr.usgs.gov/MEASURES/SRTMGL1.003/2000.02.11/

Now you need to restart GRASS and define a new location in a projected coordinate system that matches where your data are. (the correct UTM zone for example). In this new location you do:

  1. Reproject the srtm to this location. First you need to get the new region settings: r.proj -g input=srtm location=<your long/lat> mapset=<your previous mapset> output=srtm
  2. Use the output of the command above to set the region: g.region n=... s=... e=... w=... just as it appears in the output from the step above.
  3. Reproject the gpx layer: `v.proj input= location= mapset= output=
  4. ReSet the computation region to the GPX file extent: g.region -p vect=gpx
  5. And now you can get the raster surface area correctly: r.surf.area raster=srtm units=kilometers

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.