Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.7.1, 2.7.2, 8.0-M0, 8.0-M1
-
Component/s: process, unsupported, wps
-
Labels:None
-
Environment:OS: Ubuntu 11.04
Java: 1.6.0_26
CPU: x86_64
-
Testcase included:yes
Description
The execute method in VectorToRaster.java calls the convert method passing an the attribute parameter as an Expression. When the type of attribute is checked in the initialize method, it is always evaluated as an Expression and the transferType is never set. This causes a NullPointerException in the processFeature method when transferType is used in the switch statement. Unit tests bypass the execute method so they pass without this issue.
In the processFeature there is a missing break statement for POLYGON, LINESTRING, and POINT geometry types.
Float (and Double) values are not getting read properly in the flattenImageToFloat method.
Attached is a patch that fixes bugs above. The patch is applied to the 8.0-x releases after process-raster was separated out. The patch also includes a few more unit tests to test the execute method, float values, and String values that evaluate to a Number.