setup_geometry function

Compute geometries and label locations