Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it is possible to convert query on postgresql database to geopackage file

I am working on postgresql database with postgis. I was generate csv file from the database which includes geo information but I need now to generate geopackage file instead. I searched on this but I did not found any tools making something like that directly. I know I can use gdal to convert from csv to geopackage file but I do not need to make that. I need to generate the geopackage file direct from the database. Can anyone help me in that?

Thanks

like image 389
Mina Tadros Avatar asked Oct 28 '25 12:10

Mina Tadros


1 Answers

gdal support also generate geopackage file from the table/view direct using command like the following:

ogr2ogr -f "GPKG" mynewfilename.gpkg \
PG:"host=localhost user=postgres dbname=postgres password=mypassword" "mytablename"
like image 97
Mina Tadros Avatar answered Oct 31 '25 02:10

Mina Tadros