Space group constraints on weak indices in topological insulators