Open jze opened 1 year ago
I did a little research. Here is code that collects information Here is code that lists the included layers and the attribute table data types.
import geopandas
import fiona
shapefile_path = 'Lichtsignalanlagen.zip'
layer_names = fiona.listlayers(f"zip://{shapefile_path}")
for layer_name in layer_names:
print(layer_name)
gdf = geopandas.read_file(shapefile_path, layer=layer_name)
column_info = []
for column_name, data_type in gdf.dtypes.iteritems():
column_info.append((column_name, str(data_type)))
for name, data_type in column_info:
print(f" name: {name}, type: {data_type}")
Here is an example of a shape file that contains more layers and data types: nag_fach_100.zip
Overview
A common format in which geo-related public sector data is provided is ESRI shape (shp). Those are ZIP files that contain the geometry and an additional attribute table. Usually only little information is know about the content of the attribute table. This is where Frcitionless could help. If you want to create statistical evaluations, you often do not need a full GIS program and you could treat the shp files like tables.
Using GeoPanadas it is simple to access the data contained in a shape file. Here is an example that uses a file with data on traffic lights:
This is the output:
Frictionless already understands the WKT in the
geometry
column.