From a4f74b0c768f8dd381ebb7da462c84cb5b0a3782 Mon Sep 17 00:00:00 2001 From: Bertil Chapuis Date: Sun, 12 Nov 2023 19:44:03 +0100 Subject: [PATCH] Fix minor issues --- .../database/collection/DataCollectionAdapter.java | 2 +- .../baremaps/storage/postgres/PostgresDataSchema.java | 9 +-------- .../storage/shapefile/internal/ShapefileByteReader.java | 8 ++++---- basemap/import.js | 1 + 4 files changed, 7 insertions(+), 13 deletions(-) diff --git a/baremaps-core/src/main/java/org/apache/baremaps/database/collection/DataCollectionAdapter.java b/baremaps-core/src/main/java/org/apache/baremaps/database/collection/DataCollectionAdapter.java index f202ed9f1..be04534d4 100644 --- a/baremaps-core/src/main/java/org/apache/baremaps/database/collection/DataCollectionAdapter.java +++ b/baremaps-core/src/main/java/org/apache/baremaps/database/collection/DataCollectionAdapter.java @@ -45,7 +45,7 @@ public DataCollectionAdapter(DataCollection collection, Function transf * {@inheritDoc} */ @Override - public Iterator iterator() { + public Iterator iterator() { return collection.stream().map(this.transformer).iterator(); } diff --git a/baremaps-core/src/main/java/org/apache/baremaps/storage/postgres/PostgresDataSchema.java b/baremaps-core/src/main/java/org/apache/baremaps/storage/postgres/PostgresDataSchema.java index 242e03d94..55e6c7411 100644 --- a/baremaps-core/src/main/java/org/apache/baremaps/storage/postgres/PostgresDataSchema.java +++ b/baremaps-core/src/main/java/org/apache/baremaps/storage/postgres/PostgresDataSchema.java @@ -261,19 +261,12 @@ protected BaseValueHandler getHandler(Type type) { case LONG -> new LongValueHandler(); case FLOAT -> new FloatValueHandler(); case DOUBLE -> new DoubleValueHandler(); - case GEOMETRY -> new GeometryValueHandler(); - case POINT -> new GeometryValueHandler(); - case MULTIPOINT -> new GeometryValueHandler(); - case LINESTRING -> new GeometryValueHandler(); - case MULTILINESTRING -> new GeometryValueHandler(); - case POLYGON -> new GeometryValueHandler(); - case MULTIPOLYGON -> new GeometryValueHandler(); - case GEOMETRYCOLLECTION -> new GeometryValueHandler(); case INET4_ADDRESS -> new Inet4AddressValueHandler(); case INET6_ADDRESS -> new Inet6AddressValueHandler(); case LOCAL_DATE -> new LocalDateValueHandler(); case LOCAL_TIME -> new LocalTimeValueHandler(); case LOCAL_DATE_TIME -> new LocalDateTimeValueHandler(); + case GEOMETRY, POINT, MULTIPOINT, LINESTRING, MULTILINESTRING, POLYGON, MULTIPOLYGON, GEOMETRYCOLLECTION -> new GeometryValueHandler(); default -> throw new IllegalArgumentException("Unsupported type: " + type); }; } diff --git a/baremaps-core/src/main/java/org/apache/baremaps/storage/shapefile/internal/ShapefileByteReader.java b/baremaps-core/src/main/java/org/apache/baremaps/storage/shapefile/internal/ShapefileByteReader.java index 62b3cc266..45af573e6 100644 --- a/baremaps-core/src/main/java/org/apache/baremaps/storage/shapefile/internal/ShapefileByteReader.java +++ b/baremaps-core/src/main/java/org/apache/baremaps/storage/shapefile/internal/ShapefileByteReader.java @@ -327,10 +327,10 @@ private void loadPointRow(DataRow row) { * @param row the row to fill. */ private void loadPolygonRow(DataRow row) { - double xmin = getByteBuffer().getDouble(); - double ymin = getByteBuffer().getDouble(); - double xmax = getByteBuffer().getDouble(); - double ymax = getByteBuffer().getDouble(); + /* double xmin = */ getByteBuffer().getDouble(); + /* double ymin = */ getByteBuffer().getDouble(); + /* double xmax = */ getByteBuffer().getDouble(); + /* double ymax = */ getByteBuffer().getDouble(); int numParts = getByteBuffer().getInt(); int numPoints = getByteBuffer().getInt(); diff --git a/basemap/import.js b/basemap/import.js index 4338bd7f6..fec1e00a5 100644 --- a/basemap/import.js +++ b/basemap/import.js @@ -132,6 +132,7 @@ export default { "database": config.database, "databaseSrid": 3857, "replaceExisting": true, + "cleanCache": true, }, ] },