$qgis_dir = "<chemin vers une version de QGIS, exemple : ${env:ProgramFiles}\QGIS 3.28.3>"

$ogr = "$qgis_dir\bin\ogr2ogr.exe"
$env:GDAL_DATA = "$qgis_dir\apps\gdal\share\gdal\"
$env:PROJ_LIB = "$qgis_dir\share\proj\"

$pghost = '<serveur, exemple : localhost>'
$pgport = '<port, exemple : 5432>'
$pgdbname = '<base de données, exemple : pgquadogeo_db>'
$pguser = '<utilisateur, exemple : pgquadogeo_user>'
$pgpassword = '<mot de passe, exemple : 2345>'

Write-Host "Import D30 - troncon_de_route - 2021.12.15.gpkg" -ForegroundColor green
& "$ogr" `
    -f "PostgreSQL" `
    "PG:host=$pghost port=$pgport dbname=$pgdbname user=$pguser password=$pgpassword" `
    "$PSScriptRoot\D30 - troncon_de_route - 2021.12.15.gpkg" `
    -sql "select * from troncon_de_route" `
    -nln bdtopo_troncon_de_route_20211215 `
    -s_srs EPSG:2154 `
    -t_srs EPSG:2154 `
    -lco OVERWRITE=yes `
    -lco GEOMETRY_NAME=geom
    
Write-Host "Import D30 - troncon_de_route - 2022.12.15.gpkg" -ForegroundColor green
& "$ogr" `
    -f "PostgreSQL" `
    "PG:host=$pghost port=$pgport dbname=$pgdbname user=$pguser password=$pgpassword" `
    "$PSScriptRoot\D30 - troncon_de_route - 2022.12.15.gpkg" `
    -sql "select * from troncon_de_route" `
    -nln bdtopo_troncon_de_route_20221215 `
    -s_srs EPSG:2154 `
    -t_srs EPSG:2154 `
    -lco OVERWRITE=yes `
    -lco GEOMETRY_NAME=geom

Write-Host "Import D30 - highway - 2023.02.26.gpkg" -ForegroundColor green
& "$ogr" `
    -f "PostgreSQL" `
    "PG:host=$pghost port=$pgport dbname=$pgdbname user=$pguser password=$pgpassword" `
    "$PSScriptRoot\D30 - highway - 2023.02.26.gpkg" `
    -sql "select * from highway" `
    -nln osm_highway_20230226 `
    -s_srs EPSG:2154 `
    -t_srs EPSG:2154 `
    -lco OVERWRITE=yes `
    -lco GEOMETRY_NAME=geom