def geom_dict_to_array_dict(geom_dict, coord_names=['<STR_LIT>', '<STR_LIT>']):
x, y = coord_names<EOL>geom = geom_dict['<STR_LIT>']<EOL>new_dict = {k: v for k, v in geom_dict.items() if k != '<STR_LIT>'}<EOL>array = geom_to_array(geom)<EOL>new_dict[x] = array[:, <NUM_LIT:0>]<EOL>new_dict[y] = array[:, <NUM_LIT:1>]<EOL>if geom.geom_type == '<STR_LIT>':<EOL><INDENT>holes = []<EOL>for interior in geom.interiors:<EOL><INDENT>holes.append(geom_to_array(interior))<EOL><DEDENT>if holes:<EOL><INDENT>new_dict['<STR_LIT>'] = [holes]<EOL><DEDENT><DEDENT>elif geom.geom_type == '<STR_LIT>':<EOL><INDENT>outer_holes = []<EOL>for g in geom:<EOL><INDENT>holes = []<EOL>for interior in g.interiors:<EOL><INDENT>holes.append(geom_to_array(interior))<EOL><DEDENT>outer_holes.append(holes)<EOL><DEDENT>if any(hs for hs in outer_holes):<EOL><INDENT>new_dict['<STR_LIT>'] = outer_holes<EOL><DEDENT><DEDENT>return new_dict<EOL>
Converts a dictionary containing an geometry key to a dictionary
of x- and y-coordinate arrays and if present a list-of-lists of
hole array.