Hydrolysis of the 6-sulfate groups of the N-acetyl-D-glucosamine 6-sulfate units of heparan sulfate and keratan sulfate. Binds 1 Ca(2+) ion per subunit. The conversion to 3-oxoalanine (also known as C-formylglycine, FGly), of a serine or cysteine residue in prokaryotes and of a cysteine residue in eukaryotes, is critical for catalytic activity. Belongs to the sulfatase family.