[GRASS-user] r.out.arc: small issue

Hi
I just lost few hours importing data from grass to Arc
for som resons I must it transver as Arc ASCII Grid
Generally the reason of problems was that grass output ASCII grid as LF, but Arc (and some other applications) Requiers CL RF (linux - windows problem)
generally unix2dos utility solve that problem after r.out.arc

maybe this message will be usfull for somebody.........

Jarek

Jarek Jasiewicz wrote:

Hi
I just lost few hours importing data from grass to Arc
for som resons I must it transver as Arc ASCII Grid
Generally the reason of problems was that grass output ASCII grid as
LF, but Arc (and some other applications) Requiers CL RF (linux -
windows problem)
generally unix2dos utility solve that problem after r.out.arc

I think r.out.arc has been around since the days when Arc/Info commonly
ran on UNIX, and I've never had that problem with the module's output,
so I suspect this is a new bug in Arc. Which version of Arc has the
error? We can add the hint to the help page.

Besides unix2dos, you can work around the problem with this patch:

Index: raster/r.out.arc/main.c

RCS file: /home/grass/grassrepository/grass6/raster/r.out.arc/main.c,v
retrieving revision 2.8
diff -u -r2.8 main.c
--- raster/r.out.arc/main.c 28 Oct 2006 20:33:33 -0000 2.8
+++ raster/r.out.arc/main.c 5 Jun 2007 04:17:35 -0000
@@ -196,11 +196,11 @@
         if(!flag.singleline->answer)
          fprintf (fp, " ");
         else
- fprintf (fp,"\n");
+ fprintf (fp,"\r\n");
         }

        if(!flag.singleline->answer)
- fprintf (fp,"\n");
+ fprintf (fp,"\r\n");

        /*
         for (col = 0; col < ncols; col++)

Hamish

Hamish wrote:

Jarek Jasiewicz wrote:
  

Hi
I just lost few hours importing data from grass to Arc
for som resons I must it transver as Arc ASCII Grid
Generally the reason of problems was that grass output ASCII grid as
LF, but Arc (and some other applications) Requiers CL RF (linux -
windows problem)
generally unix2dos utility solve that problem after r.out.arc
    
I think r.out.arc has been around since the days when Arc/Info commonly
ran on UNIX, and I've never had that problem with the module's output,
so I suspect this is a new bug in Arc. Which version of Arc has the
error? We can add the hint to the help page.

Besides unix2dos, you can work around the problem with this patch:

Index: raster/r.out.arc/main.c

RCS file: /home/grass/grassrepository/grass6/raster/r.out.arc/main.c,v
retrieving revision 2.8
diff -u -r2.8 main.c
--- raster/r.out.arc/main.c 28 Oct 2006 20:33:33 -0000 2.8
+++ raster/r.out.arc/main.c 5 Jun 2007 04:17:35 -0000
@@ -196,11 +196,11 @@
         if(!flag.singleline->answer) fprintf (fp, " ");
         else
- fprintf (fp,"\n");
+ fprintf (fp,"\r\n");
         }
         if(!flag.singleline->answer)
- fprintf (fp,"\n");
+ fprintf (fp,"\r\n");
         /*
         for (col = 0; col < ncols; col++)

Hamish
  

Thanks
It concern ArcView 9.0 with SP2 with TauDEM installed (ie probably TauDEM has problem with reading that grid) also problem has TAS GIS - ASCII Arc is the only way to import data from GRASS (inspite it has more import option)

Jarek

Jarek wrote:

>> I just lost few hours importing data from grass to Arc
>> for som resons I must it transver as Arc ASCII Grid
>> Generally the reason of problems was that grass output ASCII grid
>> as LF, but Arc (and some other applications) Requiers CL RF (linux
>> - windows problem)
>> generally unix2dos utility solve that problem after r.out.arc

Hamish:

>
> I think r.out.arc has been around since the days when Arc/Info
> commonly ran on UNIX, and I've never had that problem with the
> module's output, so I suspect this is a new bug in Arc. Which
> version of Arc has the error? We can add the hint to the help page.
>
> Besides unix2dos, you can work around the problem with this patch:
>
> Index: raster/r.out.arc/main.c

..

> - fprintf (fp,"\n");
> + fprintf (fp,"\r\n");

Jarek:

It concern ArcView 9.0 with SP2 with TauDEM installed (ie probably
TauDEM has problem with reading that grid) also problem has TAS GIS -
ASCII Arc is the only way to import data from GRASS (inspite it has
more import option)

Ok,

I added the ArcView 9.0 import instructions to the r.out.arc help
page in Jan 2005, and it worked for me then. TauDEM appears to be GPL
open source, so if it's broken anyone can fix it.

r.out.gdal should give you a big pile of common format options:
  http://www.gdal.org/formats_list.html
including another implementation of the Arc GRID format:
  http://www.gdal.org/frmt_various.html#AAIGrid

Hamish