[GRASS-user] r.out.gdal problem of grass6.3 in windows xp

maven apache apachemaven0 at gmail.com
Mon Jun 15 21:28:38 EDT 2009


Thank you !
I have consider the space problem,and I try to avoid it:

  String filePath=file.getAbsolutePath();  // F:\anzhuang\Tomcat 5.5\....tif
  String creatLocation=System.currentTimeMillis()+"location";
  filePath=filePath.replace("\\", "\\\\"); //no matter I add this line or
not the filepath is splitted ever
  String cmd="g.proj -c georef="+filePath+" location="+creatLocation+"
datumtrans=0";
2009/6/16 Glynn Clements <glynn at gclements.plus.com>

>
> maven apache wrote:
>
> > When I use the commond r.out.gdal to export a raster map to tiff, I often
> > got a black blank image, however when I use the commond r.out.tiff I can
> get
> > a viewable tiff image.
> > I want to know it is caused by my commond of something else?
> >
> > ps:
> > some commond run normally can not run in a programe.
> > forexample:
> > g.proj -c {georef=F:\anzhuang\Tomcat 5.5\1245076611265.tif}
> > location=1245076611265location datumtrans=0
> > I copy this command to the grass gui ,and it create a new location as I
> > wanted. but in my programe from the log I get the following errors:
> >
> > Sorry, <{georef> is not a valid parameter
> > Sorry <5.5\1245076611265.tif}> is not a valid option
>
> 1. "georef=F:\anzhuang\Tomcat 5.5\1245076611265.tif" must be passed to
> g.proj as a single argument. If you try to invoke g.proj via e.g.
> system(), the string will be split into multiple arguments due to
> spaces.
>
> 2. The braces {...} are Tcl's quoting syntax; they prevent the string
> from being split into multiple arguments within Tcl, but it won't work
> for other languages.
>
> For system(), try:
>
>        system("g.proj -c \"georef=F:\\anzhuang\\Tomcat
> 5.5\\1245076611265.tif\"");
>
> or:
>
>        const char *filename = "F:\\anzhuang\\Tomcat
> 5.5\\1245076611265.tif";
>        char buf[1024];
>
>        sprintf(buf, "g.proj -c \"georef=%s\"", filename);
>        system(buf);
>
> --
> Glynn Clements <glynn at gclements.plus.com>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20090616/64104d4d/attachment.html


More information about the grass-user mailing list