Spatial coding in two dimensions