generate spatial polygon from masked image maps