Converted https://github.com/timvideos/planet/commit/77e979f8a01561fcbef6140138bc803826c1555f