[GIS] Importing .kmz file into PostgreSQL

kmlkmzogr2ogrpostgresqlpython

I have several (100+) .kmz files that I would like to import into my PostgreSQL database. I have this ogr2ogr command that works fine getting it into the database, but creates a new table every time:

C:\Radio Stations>ogr2ogr -f "PostgreSQL" PG:"host=localhost user=postgres dbname=postgres password=password port=5433" "file.kmz"

What do I put in that cmd to put all of the .kmz files into the same table?

I'm using PostGIS 2.2.1, PostgreSQL 9.5.1, Python 3.6.1

Best Answer

The Table name needs to be set in the command to load many kmz into one table.

C:\Radio Stations>ogr2ogr -f "PostgreSQL" PG:"host=localhost user=postgres dbname=postgres password=password port=5433" "file.kmz" -nln mytable

-nln mytable command will specify a table name to load into.

Related Question