in2Trans.shpConversion.SHP2Array¶
- SHP2Array(infile, defname=None)[source]¶
Read shapefile and convert it to a python dictionary
Dictionary contains the name of the paths in the shape file, the np array with the coordinates of the path points (all stacked in the same array) and information about the startin index and length of each path
- Parameters
infile (str) – path to shape file
defname (str) – name to give to the feature in the shape file
- Returns
SHPdata – SHPdata[‘Name’] : list of feature names SHPdata[‘Coord’] : np array of the coords of points in feature SHPdata[‘Start’] : list of starting index of each feature in Coord SHPdata[‘Length’] : list of length of each feature in Coord
- Return type
dict