added debug parameter, made passed geo use native layer SRID for performance