1

I'm trying to export a raster map in order to use it in the Flo-2d program. This program needs a .pts DTM file, do you know how I can create it?

Alternatively, I can use a XYZ file looking like this one:

6413334.59 1936112.79 81.81
6413388.62 1936112.00 81.57
6413500.78 1936108.47 81.29
...........

but if I use the r.out.xyz command, I get a confused file, looking like an endless row in which the x value is fixed, while the y and z ones changes.

I hope I made it clear, thanks in advance for your help!

  • Thanks for your answer, I found out that the file produced by Grass was fine, I just visualized it wrongly using Windows notepad. When I open it with xemacs, the problem doesn't exist! But still, The file produced by Grass can't be opened by the Flo-2D program, and I still can't figure out why :( Thanks for your support! Chiara – Chiara Nov 7 '13 at 9:25
2

With r.out.xyz, you can fix the separator:

  • with comma

enter image description here

with this example

r.out.xyz input=test10-3-250@testresolution output=/Users/Shared/testexport.txt fs=,

and the result is:

enter image description here

  • with space(s) as you want

enter image description here

with this example

r.out.xyz input=test10-3-250@testresolution output=/Users/Shared/testexport2.txt fs=  

and the result is:

enter image description here

but the most important is:

This module, as all GRASS raster modules, will export cells based on the current region settings.

So fix the region with g.region() before to match the raster map or a portion of the raster, or...

enter image description here

g.region rast=test10-3-250@testresolution
| improve this answer | |
0

A valide alternative of GRASS GIS r.out.xyz is gdal_translate:

gdal_translate -of XYZ input.tif output.xyz
| improve this answer | |

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.