dimanche 30 novembre 2014

ogr2ogr: Can I add a field when I import to PostGIS?


I have a bunch of GeoJSON files that I want to import to a PostGIS database.


I can import individual files perfectly as follows:



ogr2ogr -f PostgreSQL PG:"host=x user=x dbname=x password=x" myfile.geojson -nln my_table


But as I import them, I want to add an extra column to these rows in my_table for the filename, so that I know which source file each field came from.


Is this possible using ogr2ogr?





Aucun commentaire:

Enregistrer un commentaire