Extract map and fix the dimension problems