parse and sort shape coordinates