better masking for spatial queries