The standard way to find the orbital occupation of Jahn-Teller (JT) ions is to use structural data, with the assumption of a one-to-one correspondence between the orbital occupation and the associated JT distortion, e.g. in O6 octahedron. We show, however, that this approach in principle does not work for layered systems. Specifically, using the layered manganite La0.5Sr1.5MnO4 as an example, we found from our x-ray absorption measurements and theoretical calculations, that the type of orbital ordering strongly contradicts the standard local distortion approach for the Mn3+O6 octahedra, and that the generally ignored long-range crystal field effect and anisotropic hopping integrals are actually crucial to determine the orbital occupation. Our findings may open a pathway to control of the orbital state in multilayer systems and thus of their physical properties.