null
+ * @param crs CRS of the stored geometries, can be null
+ * @param srid PostGIS spatial reference identifier, must not be null
+ */
+ public GpkgGeometryConverter( String column, ICRS crs, String srid ) {
+ this.column = column;
+ this.crs = crs;
+ this.srid = srid;
+ }
+
+ @Override
+ public String getSelectSnippet( String tableAlias ) {
+ if ( tableAlias != null ) {
+ return tableAlias + "." + column;
+ }
+ return column;
+ }
+
+ @Override
+ public String getSetSnippet( Geometry particle ) {
+ return null;
+ }
+
+ @Override
+ public Geometry toParticle( ResultSet rs, int colIndex )
+ throws SQLException {
+ ByteBuffer bb = ByteBuffer.wrap( rs.getBytes( colIndex ) );
+ if ( bb == null ) {
+ return null;
+ }
+ try {
+ int[] header = parseGpkgHeader( bb );
+ int headerLength = header[0];
+ int endian = header[1];
+ return parseGpkgGeometry( bb, headerLength, endian );
+ } catch ( Throwable t ) {
+ throw new IllegalArgumentException( t.getMessage(), t );
+ }
+ }
+
+ private int[] parseGpkgHeader( ByteBuffer pgb )
+ throws Exception {
+ byte bytes = pgb.get( 3 );
+ int endian = bytes & 0x01;
+ int headerLength = getFlags( bytes );
+ return new int[] { headerLength, endian };
+ }
+
+ private int getFlags( byte bytes )
+ throws Exception {
+ int flags = ( bytes & 0x0E ) >> 1;
+ return getHeaderLength( flags );
+ }
+
+ @SuppressWarnings("unchecked")
+ private int getHeaderLength( int flag )
+ throws Exception {
+ Mapnull
+ * @param filter Filter to use for generating the WHERE clause, can be null
+ * @param sortCrit criteria to use for generating the ORDER BY clause, can be null
+ * @param allowPartialMappings if false, any unmappable expression will cause an {@link UnmappableException} to be thrown
+ * @throws FilterEvaluationException if the expression contains invalid {@link ValueReference}s
+ * @throws UnmappableException if allowPartialMappings is false and an expression could not be mapped to the db
+ */
+ public GpkgWhereBuilder( GpkgDialect dialect, PropertyNameMapper mapper, OperatorFilter filter,
+ SortProperty[] sortCrit, boolean allowPartialMappings )
+ throws FilterEvaluationException,
+ UnmappableException {
+ super( dialect, mapper, filter, sortCrit );
+ build( allowPartialMappings );
+ }
+
+ /**
+ * Translates the given {@link PropertyIsLike} into an {@link SQLOperation}
+ *
+ * @param op comparison operator to be translated, must not be null
+ * @return corresponding SQL expression, never null
+ * @throws UnmappableException if translation is not possible (usually due to unmappable property names)
+ * @throws FilterEvaluationException if the expression contains invalid {@link ValueReference}s
+ */
+ @Override
+ protected SQLOperation toProtoSQL( PropertyIsLike op )
+ throws UnmappableException, FilterEvaluationException {
+ return null;
+ }
+
+ @Override
+ protected SQLOperation toProtoSQL( SpatialOperator op )
+ throws UnmappableException, FilterEvaluationException {
+ return null;
+ }
+
+ @Override
+ protected void addExpression( SQLOperationBuilder builder, SQLExpression expr, Boolean matchCase ) {
+ }
+}
diff --git a/deegree-core/deegree-core-sqldialect/deegree-sqldialect-gpkg/src/main/resources/META-INF/services/org.deegree.db.dialect.SqlDialectProvider b/deegree-core/deegree-core-sqldialect/deegree-sqldialect-gpkg/src/main/resources/META-INF/services/org.deegree.db.dialect.SqlDialectProvider
new file mode 100644
index 0000000000..8b41e7124d
--- /dev/null
+++ b/deegree-core/deegree-core-sqldialect/deegree-sqldialect-gpkg/src/main/resources/META-INF/services/org.deegree.db.dialect.SqlDialectProvider
@@ -0,0 +1 @@
+org.deegree.sqldialect.gpkg.GpkgDialectProvider
diff --git a/deegree-core/deegree-core-sqldialect/pom.xml b/deegree-core/deegree-core-sqldialect/pom.xml
index a60c39c3de..10f800d07d 100644
--- a/deegree-core/deegree-core-sqldialect/pom.xml
+++ b/deegree-core/deegree-core-sqldialect/pom.xml
@@ -41,6 +41,7 @@