@Override protected SQLDialect createSQLDialect(JDBCDataStore dataStore) { return new GeoPkgDialect(dataStore, writerConfig); }
@Override public void encodeGeometryEnvelope(String tableName, String geometryColumn, StringBuffer sql) { encodeColumnName(null, geometryColumn, sql); }
Geometry geometry(byte[] b) throws IOException { return geometry(null, b, null, null); }
int srid = currentSRID != null ? currentSRID : -1; int dimension = currentDimension != null ? currentDimension : -1; dialect.prepareGeometryValue( (Geometry) literalValue, dimension, srid, Geometry.class, sb); } else if (Time.class.isAssignableFrom(literalValue.getClass())) { sb.append("date(?,'localtime')"); } else if (encodingFunction) { dialect.prepareFunctionArgument(clazz, sb); } else { sb.append("?");
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); } }
dialect.encodeTableName( "rtree_" + featureType.getTypeName() + "_" + attribute.getLocalName(), sb); String spatial_index = sb.toString(); dialect.encodeColumnName(null, attribute.getLocalName(), sb); String encodedPropertyName = sb.toString(); out.write(
final GeometryDescriptor searchAttribute = simpleSpatialSearch(filter, schema); if (searchAttribute != null) { Envelope envelope =
@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); } }
int srid = currentSRID != null ? currentSRID : -1; int dimension = currentDimension != null ? currentDimension : -1; dialect.prepareGeometryValue( (Geometry) literalValue, dimension, srid, Geometry.class, sb); } else if (Time.class.isAssignableFrom(literalValue.getClass())) { sb.append("date(?,'localtime')"); } else if (encodingFunction) { dialect.prepareFunctionArgument(clazz, sb); } else { sb.append("?");
dialect.encodeTableName( "rtree_" + featureType.getTypeName() + "_" + attribute.getLocalName(), sb); String spatial_index = sb.toString(); dialect.encodeColumnName(null, attribute.getLocalName(), sb); String encodedPropertyName = sb.toString(); out.write(
final GeometryDescriptor searchAttribute = simpleSpatialSearch(filter, schema); if (searchAttribute != null) { Envelope envelope =
@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); } }
@Override public Envelope decodeGeometryEnvelope(ResultSet rs, int column, Connection cx) throws SQLException, IOException { Geometry g = geometry(rs.getBytes(column)); return g != null ? g.getEnvelopeInternal() : null; }
@Override public void encodeGeometryEnvelope(String tableName, String geometryColumn, StringBuffer sql) { encodeColumnName(null, geometryColumn, sql); }
@Override protected SQLDialect createSQLDialect(JDBCDataStore dataStore) { return new GeoPkgDialect(dataStore, writerConfig); }
GeoPackage geopkg = geopkg(); try { geopkg.addGeoPackageContentsEntry(fe);
@Override public Geometry decodeGeometryValue( GeometryDescriptor descriptor, ResultSet rs, int column, GeometryFactory factory, Connection cx, Hints hints) throws IOException, SQLException { return geometry(descriptor.getType().getBinding(), rs.getBytes(column), factory, hints); }
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); } }
Geometry geometry(byte[] b) throws IOException { return geometry(null, b, null, null); }
@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); } }