I have a folder full of shapefiles that I want to import into a single PostGIS table. This table should have the following columns:
id, filename, multipolygon
I can bulk import all shapefiles using the SPIT plugin for QGIS, but each shapefile has different attributes, thus they are placed in different tables and I cannot append them into just one. I don't really want any of the attributes, I just want each polygon to be associated with the file from which it came.
I've tried two basic strategies, and neither looks very promising to me:
- Import all files normally and use SQL queries to extract the information I want from each table. My SQLfu is not strong enough to do this yet. In particular, how do I get the name of the file associated with the corresponding rows?
- Programmatically generate .dbf files with the associated filename as an attribute. Then import all files normally and append to a single table. Seems quite hacky.
I realize very similar questions have been posted before, but none of them seem to address this issue. I am just starting with GIS tools
