[GRASS-user] ASC files - Contours lines on elevation map on GRASS 7.4/Ubuntu 16.04

Dear list,

I’m quite new to GRASS and Ubuntu, it might be an easy question.

I’m trying to display contour lines on a map of the piece of land I’m buying.

The data used is 4 .asc files with respective .prj files created under ARCGis on Windows, projection RGFG95 UTM 22N. They’re imported into Grass using the r.import command.

I can load them and managed to display contour lines using r.contour on one or the other, but not the four tiles altogether:


Are there any steps I’m missing?

Thanks for your time!

Kevin

It’s been a while since I used ARC so I might be a bit confused here. The ASC file you have is a GRIDASCII correct? That is why you are importing it using r.import?

Anyway, during r.import you can crop the image to the current region settings (using the extent parameter). Check to see if that is not the case. Thus, in your r.import command use extent=input or just don’t use that option at all, since that is the default.

Another thing that might help is if you patch the MNT rasters, you can set a nicer colortable. Take a look at r.patch

Cheers

Daniel

On Wed, Feb 21, 2018 at 7:31 AM Kevin Labre <kxmlab@gmail.com> wrote:

Dear list,

I’m quite new to GRASS and Ubuntu, it might be an easy question.

I’m trying to display contour lines on a map of the piece of land I’m buying.

The data used is 4 .asc files with respective .prj files created under ARCGis on Windows, projection RGFG95 UTM 22N. They’re imported into Grass using the r.import command.

I can load them and managed to display contour lines using r.contour on one or the other, but not the four tiles altogether:

Screenshot from 2018-02-20 20-24-10.jpg


Are there any steps I’m missing?

Thanks for your time!

Kevin


grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Am 21. Februar 2018 11:31:15 MEZ schrieb Kevin Labre <kxmlab@gmail.com>:

Dear list,

I'm quite new to GRASS and Ubuntu, it might be an easy question.

I'm trying to display contour lines on a map of the piece of land I'm
buying.

The data used is 4 .asc files with respective .prj files created under
ARCGis on Windows, projection RGFG95 UTM 22N. They're imported into
Grass
using the r.import command.

I can load them and managed to display contour lines using r.contour on
one
or the other, but not the four tiles altogether:



Are there any steps I'm missing?

Did you set your region to the extent of all 4 elevation maps ?

For us to help you, we need some more info. Could you give us the output of:

- g.region -p
- r.info on each of the contour files

?

Moritz

HI Daniel, Moritz,

Thanks a lot for your quick replies.

I did not set the region to the extent of my maps, because I didn’t know what values to use

Following Moritz’s advice, I’ve attached a .txt file with the output g-region -p, r-info on each of the raster files and v.info on the 4 contour vector files.

Daniel I’ll try the r.patch command as soon as I have a moment.

Have a good evening,

Kevin

(attachments)

grass_cmd_output.txt (21.2 KB)

···

On Wed, Feb 21, 2018 at 10:18 AM, Moritz Lennert <mlennert@club.worldonline.be> wrote:

Am 21. Februar 2018 11:31:15 MEZ schrieb Kevin Labre <kxmlab@gmail.com>:

Dear list,

I’m quite new to GRASS and Ubuntu, it might be an easy question.

I’m trying to display contour lines on a map of the piece of land I’m
buying.

The data used is 4 .asc files with respective .prj files created under
ARCGis on Windows, projection RGFG95 UTM 22N. They’re imported into
Grass
using the r.import command.

I can load them and managed to display contour lines using r.contour on
one
or the other, but not the four tiles altogether:



Are there any steps I’m missing?

Did you set your region to the extent of all 4 elevation maps ?

For us to help you, we need some more info. Could you give us the output of:

  • g.region -p
  • r.info on each of the contour files

?

Moritz

On 22/02/18 02:18, Kevin Labre wrote:

HI Daniel, Moritz,

Thanks a lot for your quick replies.

I did not set the region to the extent of my maps, because I didn't know what values to use

g.region rast=MNT_Kourou_50cm_000517,MNT_Kourou_50cm_000518,MNT_Kourou_50cm_000551,MNT_Kourou_50cm_000552

and then running r.contour on each MNT should do the trick.

Following Moritz's advice, I've attached a .txt file with the output g-region -p, r-info on each of the raster files and v.info <http://v.info> on the 4 contour vector files.

g.region -p shows that the region is set to encompass only the two southern MNT's. However, I don't understand the output of v.info Contours517@K which shows that there are 22 lines in a bounding box with 0 E-W extension ( E: 322072.25, W: 322072.25), while the region is defined with

west: 322072
east: 322572.5

i.e. it goes to the western edge of MNT_517. Maybe the region that was set when r.contour was run was not the same as the one you see now ?

Daniel I'll try the r.patch command as soon as I have a moment.

This is probably the easiest for you:

r.patch in=MNT_Kourou_50cm_000517,MNT_Kourou_50cm_000518,MNT_Kourou_50cm_000551,MNT_Kourou_50cm_000552 out=myMNT

g.region rast=myMNT

r.contour in=myMnt

Moritz

Hi Kevin,

I guess it is a problem with your region. Once you imported your four ascii files into your mapset, you have to define a region to fit the extension and resolution of your four raster layers, before performing any kind of analysis.

So, you should execute the following command in order to adapt your region to your files:

$ g.region rast=MNT_Kourou_50cm_000552,MNT_Kourou_50cm_000551,MNT_Kourou_50cm_000517,MNT_Kourou_50cm_000518

Then you can patch your raster files into a single raster layer:

$ r.patch input=MNT_Kourou_50cm_000552,MNT_Kourou_50cm_000551,MNT_Kourou_50cm_000517,MNT_Kourou_50cm_000518 out=MNT_Kourou_50cm_patch

And finally apply the r.contour tool.
Hope this helps!

Cheers,
Lluís

El dc 21 de 02 de 2018 a les 07:31 -0300, en/na Kevin Labre va escriure:

Dear list,

I’m quite new to GRASS and Ubuntu, it might be an easy question.

I’m trying to display contour lines on a map of the piece of land I’m buying.

The data used is 4 .asc files with respective .prj files created under ARCGis on Windows, projection RGFG95 UTM 22N. They’re imported into Grass using the r.import command.

I can load them and managed to display contour lines using r.contour on one or the other, but not the four tiles altogether:

Are there any steps I’m missing?

Thanks for your time!

Kevin

_______________________________________________
grass-user mailing list
[grass-user@lists.osgeo.org](mailto:grass-user@lists.osgeo.org)
[https://lists.osgeo.org/mailman/listinfo/grass-user](https://lists.osgeo.org/mailman/listinfo/grass-user)

Lluís Vicens
Servei de Sistemes d’Informació Geogràfica

Universitat de Girona - SIGTE

Pl. Ferrater Mora 1
17071 Girona
Tel +34 972 418 039 (7025 intern)
lluis.vicens@udg.edu

Lloc web: http://www.sigte.udg.edu
Twitter: http://twitter.com/SIGTE_UDG