Class ShapeFileNullMapper

java.lang.Object
nz.org.riskscape.engine.output.ShapeFileNullMapper

public class ShapeFileNullMapper extends Object

The Shapefile format does not support null values. Some shapefile readers such as ogr appear to handle nulls. ESRI software maps a null value to placeholder values on writing.

  • Field Details

    • NULL_VALUE_TEXT

      public static final String NULL_VALUE_TEXT
      See Also:
    • NULL_VALUE_NUMBER

      public static final Number NULL_VALUE_NUMBER
    • NULL_VALUE_BOOLEAN

      public static final Boolean NULL_VALUE_BOOLEAN
    • NULL_VALUE_DATE

      public static final Date NULL_VALUE_DATE
    • NULL_VALUE_GEOMETRY

      public static final org.locationtech.jts.geom.Geometry NULL_VALUE_GEOMETRY
  • Constructor Details

    • ShapeFileNullMapper

      public ShapeFileNullMapper()
  • Method Details

    • mapValueIfNecessary

      public Object mapValueIfNecessary(Object value, nz.org.riskscape.engine.types.Type type)

      Returns the value, or a mapped value should it be null. The mapped value is safe to be used in shapefiles instead of the actual null value.

      Parameters:
      value - to map
      type - the Type that value should be
      Returns:
      value or a mapped value if it is null and a mapping is known