* @param tracer Attribute tracer
* @param request Request
*/
@Override
protected void updateAttribute(AttributeInterface attribute, AttributeTracer tracer, HttpServletRequest request) {
CoordsAttribute coordsAttribute = (CoordsAttribute) attribute;
String x = this.getValueFromForm(attribute, tracer, GeoRefSystemConstants.COORDS_ATTRIBUTE_X, request);
if (x != null && x.trim().length()>0) {
try {
coordsAttribute.setX(Double.parseDouble(x));
} catch (NumberFormatException e) {
throw new RuntimeException("Error in extracting coordinate x", e);
}
} else {
coordsAttribute.setX(0);
}
String y = this.getValueFromForm(attribute, tracer, GeoRefSystemConstants.COORDS_ATTRIBUTE_Y, request);
if (y != null && y.trim().length()>0) {
try {
coordsAttribute.setY(Double.parseDouble(y));
} catch (NumberFormatException e) {
throw new RuntimeException("Error in extracting coordinate y", e);
}
} else {
coordsAttribute.setY(0);
}
String z = this.getValueFromForm(attribute, tracer, GeoRefSystemConstants.COORDS_ATTRIBUTE_Z, request);
if (z != null && z.trim().length()>0) {
try {
coordsAttribute.setZ(Double.parseDouble(z));
} catch (NumberFormatException e) {
throw new RuntimeException("Error in extracting coordinate z", e);
}
} else {
coordsAttribute.setZ(0);
}
}