in2Trans.shpConversion.SHP2Array
- SHP2Array(infile, defname=None)[source]
Read shapefile and convert it to a python dictionary
The dictionary contains the name of the paths in the shape file, the np array with the coordinates of the feature points (all stacked in the same array) and information about the starting index and length of each feature
- Parameters
infile (str) – path to shape file
defname (str) – name to give to the feature in the shape file
- Returns
SHPdata –
- sks :
projection information
- Namestr
list of feature names
- x1D numpy array
np array of the x coord of the points in the features
- y1D numpy array
np array of the y coord of the points in the features
- z1D numpy array
np array of zeros and same size as the x an y coordinates array
- Start1D numpy array
np array with the starting index of each feature in the coordinates arrays (as many indexes as features)
- Length1D numpy array
np array with the length of each feature in the coordinates arrays (as many indexes as features)
- thickness (optional)1D numpy array
np array with the (release or entrainment) thickness of each feature (as many values as features)
- idlist
list of oid as string for each feature
- ci95: list
list of 95% confidence interval of thickness value
- nParts: list
list of parts of polygon (added the total number of points as list item, so if multiple parts len>2)
- nFeatures: int
number of features per line (parts)
- Return type
dict