public static Geometry updateZ ( Geometry geometry , double z , int updateCondition ) throws SQLException { if ( geometry == null ) { return null ; } if ( updateCondition == 1 || updateCondition == 2 || updateCondition == 3 ) { Geometry outPut = geometry . copy ( ) ; outPut . apply ( new UpdateZCoordinateSequenceFilter ( z , updateCondition ) ) ; return outPut ; } else { throw new SQLException ( "Available values are 1, 2 or 3.\n" + "Please read the description of the function to use it." ) ; } }
Replace the z value depending on the condition .