我试图从Java代码运行另一个程序:
String[] command = {"gdal_polygonize.py", "/home/user/myoldfiles/proceeded.tiff", "-mask", "/home/user/myoldfiles/biomass_02.08.14.tif", "-f", "'ESRI Shapefile'", "/home/user/myoldfiles/proceeded.shp", "DN"};
Process p = Runtime.getRuntime().exec(command);
我没有在/ home / user / myoldfiles /中创建的文件proceededed.shp 使用BufferedReader获得的命令输出如下所示:
Creating output /home/user/myoldfiles/proceeded.shp of format 'ESRI Shapefile'.
当我在终端(Ubuntu)中运行下一个命令时
gdal_polygonize.py '/home/user/myoldfiles/proceeded.tiff' -mask '/home/user/myoldfiles/biomass_02.08.14.tif' -f 'ESRI Shapefile' '/home/user/myoldfiles/proceeded.shp'
打印
Creating output /home/user/myoldfiles/proceeded.shp of format ESRI Shapefile.
0...10...20...30...40...50...60...70...80...90...100 - done.
并成功创建了proceeded.shp文件。我在Java代码中做错了什么?