class LayerImporter {

    public ProgressReporter importLayers(GeoPackage geopackage, List<GeoPackageLayer> layers, CancellableTaskActivity ta)
    {
        List<String> featureTables = geopackage.getFeatureTables();
        List<String> tiles = geopackage.getTileTables();
        String path = geopackage.getPath();
        String packageName = geopackage.getName();

        Map<String, GeoPackageFeatureLayer> featureLayers = New.map();
        for (String featureTable : featureTables)
        {
            FeatureDao featureDao = geopackage.getFeatureDao(featureTable);
            GeoPackageFeatureLayer featureLayer = new GeoPackageFeatureLayer(packageName, path, featureTable, featureDao.count());
            layers.add(featureLayer);
            featureLayers.put(featureTable, featureLayer);
        }

        ExtensionsDao extensionsDao = geopackage.getExtensionsDao();
        List<Extensions> extensions = null;
        try
        {
            if (extensionsDao.isTableExists())
            {
                extensions = extensionsDao.queryForAll();
            }
        }
        catch (SQLException e)
        {
            LOGGER.error(e, e);
        }

        for (String tile : tiles)
        {
            TileDao tileDao = geopackage.getTileDao(tile);
            layers.add(buildTileLayer(tileDao, packageName, path, tile, extensions));
        }

        ProgressModel model = new ProgressModel();
        ProgressReporter reporter = new ProgressReporter(model, layers, ta);

        myFeatureImporter.importFeatures(geopackage, featureLayers, ta, model);

        DataModelCategory category = new DataModelCategory(path, packageName, GeoPackageLayer.class.getName());
        SerializableAccessor<GeoPackageLayer, GeoPackageLayer> layerAccessor = SerializableAccessor
                .getHomogeneousAccessor(GeoPackagePropertyDescriptors.GEOPACKAGE_LAYER_PROPERTY_DESCRIPTOR);
        DefaultCacheDeposit<GeoPackageLayer> deposit = new DefaultCacheDeposit<>(category, New.list(layerAccessor), layers, true,
                new Date(Long.MAX_VALUE), false);

        myRegistry.addModels(deposit);

        return reporter;
    }

    public  LayerImporter(DataRegistry registry);

}