public Integer getGeometrySRID( String schemaName, String tableName, String columnName, Connection cx) throws SQLException { try { FeatureEntry fe = geopkg().feature(tableName); return fe != null ? fe.getSrid() : null; } catch (IOException e) { throw new SQLException(e); } }
@Override public int getGeometryDimension( String schemaName, String tableName, String columnName, Connection cx) throws SQLException { try { FeatureEntry fe = geopkg().feature(tableName); if (fe != null) { return 2 + (fe.isZ() ? 1 : 0) + (fe.isM() ? 1 : 0); } else { // fallback - shouldn't happen return super.getGeometryDimension(schemaName, tableName, columnName, cx); } } catch (IOException e) { throw new SQLException(e); } }
@Override public void postDropTable(String schemaName, SimpleFeatureType featureType, Connection cx) throws SQLException { super.postDropTable(schemaName, featureType, cx); FeatureEntry fe = (FeatureEntry) featureType.getUserData().get(FeatureEntry.class); if (fe == null) { fe = new FeatureEntry(); fe.setIdentifier(featureType.getTypeName()); fe.setDescription(featureType.getTypeName()); fe.setTableName(featureType.getTypeName()); } GeoPackage geopkg = geopkg(); try { geopkg.deleteGeoPackageContentsEntry(fe); geopkg.deleteGeometryColumnsEntry(fe); } catch (IOException e) { throw new SQLException(e); } }
GeoPackage geopkg = geopkg(); try { geopkg.addGeoPackageContentsEntry(fe);
public Integer getGeometrySRID( String schemaName, String tableName, String columnName, Connection cx) throws SQLException { try { FeatureEntry fe = geopkg().feature(tableName); return fe != null ? fe.getSrid() : null; } catch (IOException e) { throw new SQLException(e); } }
@Override public int getGeometryDimension( String schemaName, String tableName, String columnName, Connection cx) throws SQLException { try { FeatureEntry fe = geopkg().feature(tableName); if (fe != null) { return 2 + (fe.isZ() ? 1 : 0) + (fe.isM() ? 1 : 0); } else { // fallback - shouldn't happen return super.getGeometryDimension(schemaName, tableName, columnName, cx); } } catch (IOException e) { throw new SQLException(e); } }
@Override public void postDropTable(String schemaName, SimpleFeatureType featureType, Connection cx) throws SQLException { super.postDropTable(schemaName, featureType, cx); FeatureEntry fe = (FeatureEntry) featureType.getUserData().get(FeatureEntry.class); if (fe == null) { fe = new FeatureEntry(); fe.setIdentifier(featureType.getTypeName()); fe.setDescription(featureType.getTypeName()); fe.setTableName(featureType.getTypeName()); } GeoPackage geopkg = geopkg(); try { geopkg.deleteGeoPackageContentsEntry(fe); geopkg.deleteGeometryColumnsEntry(fe); } catch (IOException e) { throw new SQLException(e); } }
GeoPackage geopkg = geopkg(); try { geopkg.addGeoPackageContentsEntry(fe);