*/
private double getGridSpacingInKm(String type) {
double value = gds.getDouble(type);
if (Double.isNaN(value)) return value;
String gridUnit = gds.getParam(GridDefRecord.GRID_UNITS);
SimpleUnit unit = null;
if (gridUnit == null || gridUnit.length() == 0) {
unit = SimpleUnit.meterUnit;
} else {
unit = SimpleUnit.factory(gridUnit);
}
if (unit != null && SimpleUnit.isCompatible(unit.getUnitString(), "km")) {
value = unit.convertTo(value, SimpleUnit.kmUnit);
}
return value;
}