"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "modules/plugin/geopkg/src/main/java/org/geotools/geopkg/GeoPkgDialect.java" between
geotools-24.0-project.zip and geotools-24.1-project.zip

About: GeoTools (The Open Source Java GIS Toolkit) is a Java code library which provides standards compliant methods for the manipulation of geospatial data.

GeoPkgDialect.java  (geotools-24.0-project):GeoPkgDialect.java  (geotools-24.1-project)
skipping to change at line 204 skipping to change at line 204
} }
@Override @Override
public String getGeometryTypeName(Integer type) { public String getGeometryTypeName(Integer type) {
return Geometries.getForSQLType(type).getName(); return Geometries.getForSQLType(type).getName();
} }
@Override @Override
public void registerSqlTypeNameToClassMappings(Map<String, Class<?>> mapping s) { public void registerSqlTypeNameToClassMappings(Map<String, Class<?>> mapping s) {
super.registerSqlTypeNameToClassMappings(mappings); super.registerSqlTypeNameToClassMappings(mappings);
// preserve SQLite full precision when dealing with a GeoPackage:
mappings.put("FLOAT", Double.class);
mappings.put("DOUBLE", Double.class); mappings.put("DOUBLE", Double.class);
mappings.put("REAL", Double.class);
mappings.put("BOOLEAN", Boolean.class); mappings.put("BOOLEAN", Boolean.class);
mappings.put("DATE", java.sql.Date.class); mappings.put("DATE", java.sql.Date.class);
mappings.put("TIMESTAMP", java.sql.Timestamp.class); mappings.put("TIMESTAMP", java.sql.Timestamp.class);
mappings.put("TIME", java.sql.Time.class); mappings.put("TIME", java.sql.Time.class);
mappings.put("DATETIME", java.sql.Timestamp.class); mappings.put("DATETIME", java.sql.Timestamp.class);
} }
@Override @Override
public void registerClassToSqlMappings(Map<Class<?>, Integer> mappings) { public void registerClassToSqlMappings(Map<Class<?>, Integer> mappings) {
super.registerClassToSqlMappings(mappings); super.registerClassToSqlMappings(mappings);
// add geometry mappings // add geometry mappings
for (Geometries g : Geometries.values()) { for (Geometries g : Geometries.values()) {
mappings.put(g.getBinding(), g.getSQLType()); mappings.put(g.getBinding(), g.getSQLType());
} }
// override some internal defaults // override some internal defaults
mappings.put(Byte.class, Types.TINYINT); mappings.put(Byte.class, Types.TINYINT);
mappings.put(Short.class, Types.SMALLINT); mappings.put(Short.class, Types.SMALLINT);
mappings.put(Long.class, Types.BIGINT); mappings.put(Long.class, Types.BIGINT);
mappings.put(Integer.class, Types.INTEGER); mappings.put(Integer.class, Types.INTEGER);
mappings.put(Double.class, Types.REAL); mappings.put(Float.class, Types.FLOAT);
mappings.put(Double.class, Types.DOUBLE);
mappings.put(Boolean.class, Types.INTEGER); mappings.put(Boolean.class, Types.INTEGER);
} }
@Override @Override
public void registerSqlTypeToSqlTypeNameOverrides(Map<Integer, String> overr ides) { public void registerSqlTypeToSqlTypeNameOverrides(Map<Integer, String> overr ides) {
super.registerSqlTypeToSqlTypeNameOverrides(overrides); super.registerSqlTypeToSqlTypeNameOverrides(overrides);
// The following SQL Data Types are just decorative in SQLite // The following SQL Data Types are just decorative in SQLite
// (see https://www.sqlite.org/datatype3.html), // (see https://www.sqlite.org/datatype3.html),
// but will allow GeoTools to handle some usual java.sql.Types // but will allow GeoTools to handle some usual java.sql.Types
// not mapped to raw SQL types by org.sqlite.jdbc3.JDBC3DatabaseMetaData .getTypeInfo() // not mapped to raw SQL types by org.sqlite.jdbc3.JDBC3DatabaseMetaData .getTypeInfo()
// Numbers // Numbers
overrides.put(Types.BOOLEAN, "BOOLEAN"); overrides.put(Types.BOOLEAN, "BOOLEAN");
overrides.put(Types.TINYINT, "TINYINT"); overrides.put(Types.TINYINT, "TINYINT");
overrides.put(Types.SMALLINT, "SMALLINT"); overrides.put(Types.SMALLINT, "SMALLINT");
overrides.put(Types.INTEGER, "MEDIUMINT"); overrides.put(Types.INTEGER, "MEDIUMINT");
overrides.put(Types.BIGINT, "INTEGER"); overrides.put(Types.BIGINT, "INTEGER");
overrides.put(Types.FLOAT, "FLOAT");
overrides.put(Types.DOUBLE, "DOUBLE"); overrides.put(Types.DOUBLE, "DOUBLE");
overrides.put(Types.NUMERIC, "NUMERIC"); overrides.put(Types.NUMERIC, "NUMERIC");
// Temporal // Temporal
overrides.put(Types.DATE, "DATE"); overrides.put(Types.DATE, "DATE");
overrides.put(Types.TIME, "TIME"); overrides.put(Types.TIME, "TIME");
overrides.put(Types.TIMESTAMP, "TIMESTAMP"); overrides.put(Types.TIMESTAMP, "TIMESTAMP");
} }
@Override @Override
 End of changes. 4 change blocks. 
1 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)