gvSIG bugs #4376

Raster calculator (sextante) creates empty layers

Added by Cesar Martinez Izquierdo over 7 years ago. Updated almost 7 years ago.

Status:Invalid% Done:

0%

Priority:NormalSpent time:-
Assignee:-
Category:Geoprocess
Target version:-
Severity:Minor Add-on version:
gvSIG version:2.3.0 Add-on build:
gvSIG build: Add-on resolve version:
Operative System: Add-on resolve build:
Keywords: Proyecto:
Has patch: Hito:
Add-on name:Unknown

Description

Steps to reproduce:
- Create a new raster layer of value 1, using Sextante Raster creation tools > Constant grid
Create a new raster layer of value 5, using Sextante Raster creation tools > Constant grid
Use the Sextante Raster calculator to multiply them (formula is: "layer1 Band 1" * "layer2 Band 1")

Expected result:
- The result layer should have a value of 5 in all its extent

Actual result:
- The result layer has a value of nodata (-99999.0) in all its extent

History

#1 Updated by Cesar Martinez Izquierdo over 7 years ago

There was a problem in the format of the bug. I paste again:
Steps to reproduce:
- Create a new raster layer of value 1, using Sextante Raster creation tools - > Constant grid
- Create a new raster layer of value 5, using Sextante Raster creation tools - > Constant grid
- Use the Sextante Raster calculator to multiply them (formula is: "layer1 Band 1" * "layer2 Band 1")

Expected result:
- The result layer should have a value of 5 in all its extent

Actual result:
- The result layer has a value of nodata (-99999.0) in all its extent

#2 Updated by Antonio Falciano over 7 years ago

Hi Cesar,
I've just tested your example workflow in build 2445 and it works as expected.
The only difference is the formula that I have applied: layer 1 Band 1 * layer 2 Band 1

#3 Updated by Cesar Martinez Izquierdo over 7 years ago

Hi, I've partially figured out the problem, I think it is caused a combination of factors:

- Sextante generates some layer names containing parenthesis (for instance the rasterize process creates layers names such as "layer1(rasterized)
- The raster calculator show an error if you try to operate on any of these layers including parenthesis (error message says: "Wrong or missing parameter definition")
- If you quote the layer name, then it produces empty layers as stated on this bug

Additionally, I think that for some reason my Sextante command history got corrupted (or maybe Sextante was getting confused because there were quoted commands in the history), so some processes were producing errors or empty results even working with unquoted layers.
I deleted the history and now it's fine.

Summarizing, as the history problem is difficult to track and reproduce, I would say there is 2 bugs:
- Sextante is no table to process layers having parenthesis in the name
- Sextante produces empty layers if the names are quoted

#4 Updated by Antonio Falciano over 7 years ago

Cesar Martinez Izquierdo wrote:

Hi, I've partially figured out the problem, I think it is caused a combination of factors:

- Sextante generates some layer names containing parenthesis (for instance the rasterize process creates layers names such as "layer1(rasterized)

Hi, it depends by how the [rasterizedo] i18n string is translated. For instance, there are round brackets in English or square ones in Italian or Spanish. But only the round parentheses are problematic, because they cause a Syntax Error (implicit multiplication not enabled).

- The raster calculator show an error if you try to operate on any of these layers including parenthesis (error message says: "Wrong or missing parameter definition")

It happens because the (round) parentheses should be used only in calculations, not in layer names.

- If you quote the layer name, then it produces empty layers as stated on this bug

Quoting the layer name should not be allowed. It should return a Syntax Error.

Additionally, I think that for some reason my Sextante command history got corrupted (or maybe Sextante was getting confused because there were quoted commands in the history), so some processes were producing errors or empty results even working with unquoted layers.
I deleted the history and now it's fine.
Summarizing, as the history problem is difficult to track and reproduce, I would say there is 2 bugs:
- Sextante is no table to process layers having parenthesis in the name

IMHO this is not a bug, because the round parentheses should be used only in calculations, while the square ones can be used without problems.

- Sextante produces empty layers if the names are quoted

True. The formula parser (and the log handler) could be refined further in order to do not accept the quoting or the round parentheses in layer names. In the meanwhile I'd suggest to use the element tree and the buttons available in the Raster Calculator GUI. They allow to type the formula with the right syntax.

#5 Updated by Cesar Martinez Izquierdo over 7 years ago

Antonio Falciano wrote:

Cesar Martinez Izquierdo wrote:

- The raster calculator show an error if you try to operate on any of these layers including parenthesis (error message says: "Wrong or missing parameter definition")

It happens because the (round) parentheses should be used only in calculations, not in layer names.

- If you quote the layer name, then it produces empty layers as stated on this bug

Quoting the layer name should not be allowed. It should return a Syntax Error.

I agree.

Additionally, I think that for some reason my Sextante command history got corrupted (or maybe Sextante was getting confused because there were quoted commands in the history), so some processes were producing errors or empty results even working with unquoted layers.
I deleted the history and now it's fine.
Summarizing, as the history problem is difficult to track and reproduce, I would say there is 2 bugs:
- Sextante is no table to process layers having parenthesis in the name

IMHO this is not a bug, because the round parentheses should be used only in calculations, while the square ones can be used without problems.

I disagree here. I think it is a bug, because I was not choosing the layer name, but Sextante was doing it automatically. And then Sextante was not able to further process its own layer.

In addition, I think it is a really weak behaviour if we can set a layer name in gvSIG that then Sextante is not able to process. So I think we should correct this Sextante behaviour OR to limit the allowed characters for layer names in gvSIG (plus correct the Sextante translations to avoid using strange characters on layer names).

- Sextante produces empty layers if the names are quoted

True. The formula parser (and the log handler) could be refined further in order to do not accept the quoting or the round parentheses in layer names. In the meanwhile I'd suggest to use the element tree and the buttons available in the Raster Calculator GUI. They allow to type the formula with the right syntax.

Agreed.

#6 Updated by Álvaro Anguix almost 7 years ago

I agree with the problem with "names" in Sextante, but this is open in another ticket...and I hope that we can fix ASAP, so I change this ticket to invalid.

#7 Updated by Álvaro Anguix almost 7 years ago

  • Status changed from New to Invalid

Also available in: Atom PDF