calculate grid coordinates only once per file while loading