On mercredi 30 novembre 2016 16:21:42 CET Neumann, Andreas wrote:
> Hi,
> 
> I want to convert a whole Postgis schema to a geopackage. This works
> fine with
> 
> ogr2ogr -f GPKG av_1700.gpkg PG:'dbname=dbname host=localhost
> schemas=schemaname'
> 
> Now - my problem is that the schema contains 64 tables and I want to
> convert all tables except one table.
> 
> Is there a trick with an exclude option? I know that I can list all
> tables that I want to convert in the sense of a white list with
> 'tables=tab1,tab2,tab3', etc. - but this is complicated for this many
> tables.
> 
> I hope that there is / could be some black list option - or the
> possibility of specifying a pattern for selection the tables to be
> converted.

Andreas,

There's no such option (there's no real technical hurdle if one would want to 
add one, but 
one can wonder how common this use case is)
The easiest way currently would be to drop the unwished tables after the import 
: ogrinfo 
your.gpkg -sql "DROP TABLE table_name". Since GDAL 2.1.2, this not only drops 
the table but 
also all references to it in GPKG system tables.
You could also do a tiny script to list the tables and remove the one(s) you 
don't want from 
the list before calling ogr2ogr / gdal.VectorTranslate()

Even


-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to