in2Trans.shpConversion.readShapefile

readShapefile(inputShp)[source]

Read the fields, properties, geometries, and spatial reference of an input shapefile. To be used in combination with shapefile.Reader. Could be expanded upon to get e.g. shapeTypes, bounds, numFeatures and metadata if needed. This does pure reading, no special checks for valid attributes are performed.

Parameters

inputShp (pathlib.Path) – Path to input shapefile

Returns

  • fields (list) – the fields of the input shapefile

  • fieldNames (list) – the names of the fields

  • properties (list) – a list of dictionaries containing the properties of each feature

  • geometries (list) – a list of geometry objects

  • srs (str) – the spatial reference system fetched from eventual .prj file