<div>Thank you !</div>
<div>I have consider the space problem,and I try to avoid it:</div>
<div> </div>
<div> String filePath=file.getAbsolutePath(); // F:\anzhuang\Tomcat 5.5\....tif</div>
<div> String creatLocation=System.currentTimeMillis()+"location";</div>
<div> filePath=filePath.replace("\\", "<a>\\\\</a>"); //no matter I add this line or not the filepath is splitted ever<br> String cmd="g.proj -c georef="+filePath+" location="+creatLocation+" datumtrans=0";<br>
</div>
<div class="gmail_quote">2009/6/16 Glynn Clements <span dir="ltr"><<a href="mailto:glynn@gclements.plus.com">glynn@gclements.plus.com</a>></span><br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div class="im"><br>maven apache wrote:<br><br>> When I use the commond r.out.gdal to export a raster map to tiff, I often<br>> got a black blank image, however when I use the commond r.out.tiff I can get<br>> a viewable tiff image.<br>
> I want to know it is caused by my commond of something else?<br>><br>> ps:<br>> some commond run normally can not run in a programe.<br>> forexample:<br>> g.proj -c {georef=F:\anzhuang\Tomcat 5.5\1245076611265.tif}<br>
> location=1245076611265location datumtrans=0<br>> I copy this command to the grass gui ,and it create a new location as I<br>> wanted. but in my programe from the log I get the following errors:<br>><br>> Sorry, <{georef> is not a valid parameter<br>
> Sorry <5.5\1245076611265.tif}> is not a valid option<br><br></div>1. "georef=F:\anzhuang\Tomcat 5.5\1245076611265.tif" must be passed to<br>g.proj as a single argument. If you try to invoke g.proj via e.g.<br>
system(), the string will be split into multiple arguments due to<br>spaces.<br><br>2. The braces {...} are Tcl's quoting syntax; they prevent the string<br>from being split into multiple arguments within Tcl, but it won't work<br>
for other languages.<br><br>For system(), try:<br><br> system("g.proj -c \"georef=F:\\anzhuang\\Tomcat 5.5\\1245076611265.tif\"");<br><br>or:<br><br> const char *filename = "F:\\anzhuang\\Tomcat 5.5\\1245076611265.tif";<br>
char buf[1024];<br><br> sprintf(buf, "g.proj -c \"georef=%s\"", filename);<br> system(buf);<br><font color="#888888"><br>--<br>Glynn Clements <<a href="mailto:glynn@gclements.plus.com">glynn@gclements.plus.com</a>><br>
</font></blockquote></div><br>