gvSIG CE and SEXTANTE GIS Bug Tracker on MantisBT
Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000379SEXTANTEAlgorithms (geoprocessing)public2013-05-06 11:552013-05-09 20:43
Reporterfpuga 
Assigned Tovolaya 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Platformwindows_intelx86OSWindows 32 bitOS Version2000/XP/Vista/7
Product Version 
Target Version1.0.1Fixed in Version 
Summary0000379: GridCalculator does not work with models in batch mode
DescriptionOn Windows, trying to make a batch execution of a model that uses the grid calculator, taking the raster files from the disk, instead of the View an error is thrown.

In the "GridCalculatorAlgorithm" some "tweaks" are done to avoid bad characters in the names of the layers, like:

sFormula = sFormula.toLowerCase().replaceAll(" ", "");
sFormula = sFormula.replaceAll("\\[", "_");
sFormula = sFormula.replaceAll("\\]", "_");

In Windows, when a layer is taken from the disk the name that is assigned to it is the full path (FileTools.java, open method):

final FLayer layer = openLayer(sFilename, sFilename, Project.getDefaultProjection());

so, the name of the layer is like: "c:\myfolder\myraster.tiff" and the ":" characters is throwing an error when it's parsed.

My suggestion to fix this issue is that instead, of remove the ":" in the grid calculator, the name of the layer when is taken from disk should be just the name and not the full path:

final FLayer layer = openLayer(sFilename, new File(sFilename).getName(), Project.getDefaultProjection());

This is working for me.

I attach a patch.
TagsNo tags attached.
Attached Filespatch file icon FileTools.patch [^] (741 bytes) 2013-05-06 11:55 [Show Content]

- Relationships

-  Notes
(0000228)
benducke (developer)
2013-05-09 09:47

Patch applied to SVN.

- Issue History
Date Modified Username Field Change
2013-05-06 11:55 fpuga New Issue
2013-05-06 11:55 fpuga Status new => assigned
2013-05-06 11:55 fpuga Assigned To => volaya
2013-05-06 11:55 fpuga File Added: FileTools.patch
2013-05-09 09:47 benducke Note Added: 0000228
2013-05-09 09:47 benducke Status assigned => resolved
2013-05-09 09:47 benducke Resolution open => fixed
2013-05-09 20:43 josecanalejo Target Version => 1.0.1


Copyright © 2000 - 2011 MantisBT Group
Hosted by Sourceforge.netPowered by Mantis Bugtracker