This is a WIP. I know very little about Geo. Please review carefully, and feel free to disregard in favour of a better solution.
@brodock @patricio this is the patch mentioned in #1463 (comment 20634493). That comment and the commit message contain more of the reasoning for this.
This will create a new commit in order to revert the existing changes.