You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@baremaps.apache.org by bc...@apache.org on 2023/05/22 15:06:18 UTC

[incubator-baremaps] branch gdal updated: Some fixes

This is an automated email from the ASF dual-hosted git repository.

bchapuis pushed a commit to branch gdal
in repository https://gitbox.apache.org/repos/asf/incubator-baremaps.git


The following commit(s) were added to refs/heads/gdal by this push:
     new c6b2fe0b Some fixes
c6b2fe0b is described below

commit c6b2fe0bdfa24577fdc7d71c993248252e330799
Author: Bertil Chapuis <bc...@gmail.com>
AuthorDate: Mon May 22 17:06:11 2023 +0200

    Some fixes
---
 .../java/org/apache/baremaps/cli/map/Contour.java  | 10 +--
 .../main/java/org/apache/baremaps/cli/map/Map.java |  3 +-
 baremaps-core/pom.xml                              | 48 ++++++------
 .../java/org/apache/baremaps/raster/AsterDem.java  | 90 ++++++++++++----------
 .../apache/baremaps/raster/ContourTileStore.java   | 45 ++++++-----
 .../java/org/apache/baremaps/raster/Image.java     | 35 ++++++---
 .../main/java/org/apache/baremaps/raster/Main.java | 26 +++----
 .../baremaps/vectortile/VectorTileDecoder.java     |  1 -
 .../baremaps/vectortile/VectorTileEncoder.java     |  1 -
 .../baremaps/vectortile/VectorTileUtils.java       | 10 +--
 .../apache/baremaps/vectortile/VectorTileTest.java |  1 -
 .../baremaps/vectortile/VectorTileViewer.java      |  8 +-
 .../apache/baremaps/server/ServerResources.java    |  3 +-
 13 files changed, 153 insertions(+), 128 deletions(-)

diff --git a/baremaps-cli/src/main/java/org/apache/baremaps/cli/map/Contour.java b/baremaps-cli/src/main/java/org/apache/baremaps/cli/map/Contour.java
index 32b4482b..c2505c4f 100644
--- a/baremaps-cli/src/main/java/org/apache/baremaps/cli/map/Contour.java
+++ b/baremaps-cli/src/main/java/org/apache/baremaps/cli/map/Contour.java
@@ -12,9 +12,13 @@
 
 package org.apache.baremaps.cli.map;
 
+import static io.servicetalk.data.jackson.jersey.ServiceTalkJacksonSerializerFeature.contextResolverFor;
+
 import com.fasterxml.jackson.databind.ObjectMapper;
 import io.servicetalk.http.netty.HttpServers;
 import io.servicetalk.http.router.jersey.HttpJerseyRouterBuilder;
+import java.nio.file.Path;
+import java.util.concurrent.Callable;
 import org.apache.baremaps.raster.ContourTileStore;
 import org.apache.baremaps.server.CorsFilter;
 import org.apache.baremaps.server.ServerResources;
@@ -27,11 +31,6 @@ import org.slf4j.LoggerFactory;
 import picocli.CommandLine.Command;
 import picocli.CommandLine.Option;
 
-import java.nio.file.Path;
-import java.util.concurrent.Callable;
-
-import static io.servicetalk.data.jackson.jersey.ServiceTalkJacksonSerializerFeature.contextResolverFor;
-
 @Command(name = "contour", description = "Start a tile server with caching capabilities.")
 public class Contour implements Callable<Integer> {
 
@@ -78,6 +77,7 @@ public class Contour implements Callable<Integer> {
     logger.info("Listening on {}", serverContext.listenAddress());
 
     serverContext.awaitShutdown();
+
     return 0;
   }
 }
diff --git a/baremaps-cli/src/main/java/org/apache/baremaps/cli/map/Map.java b/baremaps-cli/src/main/java/org/apache/baremaps/cli/map/Map.java
index e1d1a3e5..e3be1030 100644
--- a/baremaps-cli/src/main/java/org/apache/baremaps/cli/map/Map.java
+++ b/baremaps-cli/src/main/java/org/apache/baremaps/cli/map/Map.java
@@ -18,7 +18,8 @@ import picocli.CommandLine;
 import picocli.CommandLine.Command;
 
 @Command(name = "map", description = "Map commands.",
-    subcommands = {Init.class, Export.class, Serve.class, Dev.class, Contour.class}, sortOptions = false)
+    subcommands = {Init.class, Export.class, Serve.class, Dev.class, Contour.class},
+    sortOptions = false)
 public class Map implements Runnable {
 
   @Override
diff --git a/baremaps-core/pom.xml b/baremaps-core/pom.xml
index ae470399..62705d8e 100644
--- a/baremaps-core/pom.xml
+++ b/baremaps-core/pom.xml
@@ -20,29 +20,7 @@
 
   <artifactId>baremaps-core</artifactId>
 
-  <repositories>
-    <repository>
-      <id>twelvemonkeys</id>
-      <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
-    </repository>
-  </repositories>
-
   <dependencies>
-    <dependency>
-      <groupId>com.twelvemonkeys.imageio</groupId>
-      <artifactId>imageio-tiff</artifactId>
-      <version>3.10.0-SNAPSHOT</version>
-    </dependency>
-    <dependency>
-      <groupId>com.twelvemonkeys.imageio</groupId>
-      <artifactId>imageio-metadata</artifactId>
-      <version>3.9.4</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.sis.storage</groupId>
-      <artifactId>sis-geotiff</artifactId>
-      <version>1.3</version>
-    </dependency>
     <dependency>
       <groupId>com.fasterxml.jackson.core</groupId>
       <artifactId>jackson-annotations</artifactId>
@@ -83,6 +61,16 @@
       <groupId>com.google.protobuf</groupId>
       <artifactId>protobuf-java</artifactId>
     </dependency>
+    <dependency>
+      <groupId>com.twelvemonkeys.imageio</groupId>
+      <artifactId>imageio-metadata</artifactId>
+      <version>3.9.4</version>
+    </dependency>
+    <dependency>
+      <groupId>com.twelvemonkeys.imageio</groupId>
+      <artifactId>imageio-tiff</artifactId>
+      <version>3.10.0-SNAPSHOT</version>
+    </dependency>
     <dependency>
       <groupId>com.zaxxer</groupId>
       <artifactId>HikariCP</artifactId>
@@ -124,13 +112,18 @@
       <artifactId>lucene-spatial-extras</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.graalvm.sdk</groupId>
-      <artifactId>graal-sdk</artifactId>
+      <groupId>org.apache.sis.storage</groupId>
+      <artifactId>sis-geotiff</artifactId>
+      <version>1.3</version>
     </dependency>
     <dependency>
       <groupId>org.gdal</groupId>
       <artifactId>gdal</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.graalvm.sdk</groupId>
+      <artifactId>graal-sdk</artifactId>
+    </dependency>
     <dependency>
       <groupId>org.locationtech.jts</groupId>
       <artifactId>jts-core</artifactId>
@@ -163,6 +156,13 @@
     </dependency>
   </dependencies>
 
+  <repositories>
+    <repository>
+      <id>twelvemonkeys</id>
+      <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
+    </repository>
+  </repositories>
+
   <build>
     <plugins>
       <plugin>
diff --git a/baremaps-core/src/main/java/org/apache/baremaps/raster/AsterDem.java b/baremaps-core/src/main/java/org/apache/baremaps/raster/AsterDem.java
index 47f9a363..8ce28143 100644
--- a/baremaps-core/src/main/java/org/apache/baremaps/raster/AsterDem.java
+++ b/baremaps-core/src/main/java/org/apache/baremaps/raster/AsterDem.java
@@ -1,3 +1,15 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
 package org.apache.baremaps.raster;
 
 import java.io.BufferedInputStream;
@@ -13,46 +25,46 @@ import java.util.regex.Pattern;
 
 public class AsterDem {
 
-    public static void main(String[] args) throws IOException {
+  public static void main(String[] args) throws IOException {
 
-        var target = Paths.get("/Volumes/Data/data/ASTGTMV003");
-        if (Files.notExists(target)) {
-            Files.createDirectories(target);
-        }
-        var baseUrl = "https://e4ftl01.cr.usgs.gov/ASTT/ASTGTM.003/2000.03.01/";
-        var token = "...";
-
-        var directoryUrl = new URL(baseUrl);
-        var directoryConnection = (HttpURLConnection) directoryUrl.openConnection();
-
-        var files = new ArrayList<String>();
-        try(var stream = new BufferedInputStream(directoryConnection.getInputStream())) {
-            var bytes = stream.readAllBytes();
-            var html = new String(bytes);
-            Pattern p = Pattern.compile("href=\"(ASTGTMV003_.*?)\"");
-            Matcher m = p.matcher(html);
-            while (m.find()) {
-                files.add(m.group(1));
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
+    var target = Paths.get("/Volumes/Data/data/ASTGTMV003");
+    if (Files.notExists(target)) {
+      Files.createDirectories(target);
+    }
+    var baseUrl = "https://e4ftl01.cr.usgs.gov/ASTT/ASTGTM.003/2000.03.01/";
+    var token = "...";
 
-        files.parallelStream().forEach(file -> {
-            try {
-                if (Files.exists(target.resolve(file))) {
-                    return;
-                }
-                System.out.println("Downloading " + file);
-                var fileUrl = new URL(baseUrl + file);
-                var fileConnection = (HttpURLConnection) fileUrl.openConnection();
-                fileConnection.setRequestProperty("Authorization", "Bearer " + token);
-                try(var stream = new BufferedInputStream(fileConnection.getInputStream())) {
-                    Files.copy(stream, target.resolve(file), StandardCopyOption.REPLACE_EXISTING);
-                }
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-        });
+    var directoryUrl = new URL(baseUrl);
+    var directoryConnection = (HttpURLConnection) directoryUrl.openConnection();
+
+    var files = new ArrayList<String>();
+    try (var stream = new BufferedInputStream(directoryConnection.getInputStream())) {
+      var bytes = stream.readAllBytes();
+      var html = new String(bytes);
+      Pattern p = Pattern.compile("href=\"(ASTGTMV003_.*?)\"");
+      Matcher m = p.matcher(html);
+      while (m.find()) {
+        files.add(m.group(1));
+      }
+    } catch (Exception e) {
+      e.printStackTrace();
     }
+
+    files.parallelStream().forEach(file -> {
+      try {
+        if (Files.exists(target.resolve(file))) {
+          return;
+        }
+        System.out.println("Downloading " + file);
+        var fileUrl = new URL(baseUrl + file);
+        var fileConnection = (HttpURLConnection) fileUrl.openConnection();
+        fileConnection.setRequestProperty("Authorization", "Bearer " + token);
+        try (var stream = new BufferedInputStream(fileConnection.getInputStream())) {
+          Files.copy(stream, target.resolve(file), StandardCopyOption.REPLACE_EXISTING);
+        }
+      } catch (Exception e) {
+        e.printStackTrace();
+      }
+    });
+  }
 }
diff --git a/baremaps-core/src/main/java/org/apache/baremaps/raster/ContourTileStore.java b/baremaps-core/src/main/java/org/apache/baremaps/raster/ContourTileStore.java
index 2f2f9455..67012b9a 100644
--- a/baremaps-core/src/main/java/org/apache/baremaps/raster/ContourTileStore.java
+++ b/baremaps-core/src/main/java/org/apache/baremaps/raster/ContourTileStore.java
@@ -12,6 +12,12 @@
 
 package org.apache.baremaps.raster;
 
+import java.nio.ByteBuffer;
+import java.nio.file.Paths;
+import java.util.List;
+import java.util.Map;
+import java.util.Vector;
+import java.util.stream.LongStream;
 import org.apache.baremaps.tilestore.TileCoord;
 import org.apache.baremaps.tilestore.TileStore;
 import org.apache.baremaps.tilestore.TileStoreException;
@@ -29,13 +35,6 @@ import org.gdal.osr.SpatialReference;
 import org.locationtech.jts.geom.Envelope;
 import org.locationtech.proj4j.ProjCoordinate;
 
-import java.nio.ByteBuffer;
-import java.nio.file.Paths;
-import java.util.List;
-import java.util.Map;
-import java.util.Vector;
-import java.util.stream.LongStream;
-
 public class ContourTileStore implements TileStore, AutoCloseable {
 
   static {
@@ -57,16 +56,19 @@ public class ContourTileStore implements TileStore, AutoCloseable {
 
     // Transform the extent to the source projection
     var transformer = GeometryUtils.coordinateTransform(4326, 3857);
-    var min = transformer.transform(new ProjCoordinate(envelope.getMinX(), envelope.getMinY()), new ProjCoordinate());
-    var max = transformer.transform(new ProjCoordinate(envelope.getMaxX(), envelope.getMaxY()), new ProjCoordinate());
+    var min = transformer.transform(new ProjCoordinate(envelope.getMinX(), envelope.getMinY()),
+        new ProjCoordinate());
+    var max = transformer.transform(new ProjCoordinate(envelope.getMaxX(), envelope.getMaxY()),
+        new ProjCoordinate());
     var targetEnvelope = new Envelope(min.x, max.x, min.y, max.y);
 
     // Warp the raster to the requested extent
     var rasterOptions = new WarpOptions(new Vector<>(List.of(
-            "-of", "MEM",
-            "-te", Double.toString(envelope.getMinX()), Double.toString(envelope.getMinY()), Double.toString(envelope.getMaxX()), Double.toString(envelope.getMaxY()),
-            "-te_srs", "EPSG:4326")));
-    var rasterDataset = gdal.Warp("", new Dataset[]{sourceDataset}, rasterOptions);
+        "-of", "MEM",
+        "-te", Double.toString(envelope.getMinX()), Double.toString(envelope.getMinY()),
+        Double.toString(envelope.getMaxX()), Double.toString(envelope.getMaxY()),
+        "-te_srs", "EPSG:4326")));
+    var rasterDataset = gdal.Warp("", new Dataset[] {sourceDataset}, rasterOptions);
     var rasterBand = rasterDataset.GetRasterBand(1);
 
     // Generate the contours
@@ -79,14 +81,15 @@ public class ContourTileStore implements TileStore, AutoCloseable {
 
     // return the contours
     var features = LongStream.range(0, vectorLayer.GetFeatureCount())
-            .mapToObj(vectorLayer::GetFeature)
-            .map(feature -> feature.GetGeometryRef())
-            .map(geometry -> GeometryUtils.deserialize(geometry.ExportToWkb()))
-            .map(geometry -> VectorTileUtils.asVectorTileGeom(geometry, targetEnvelope, 4096, 0, true))
-            .map(geometry -> new Feature(null, Map.of(), geometry))
-            .toList();
-
-    var vectorTile = VectorTileUtils.asVectorTile(new VectorTile(List.of(new Layer("contours", 4096, features))));
+        .mapToObj(vectorLayer::GetFeature)
+        .map(feature -> feature.GetGeometryRef())
+        .map(geometry -> GeometryUtils.deserialize(geometry.ExportToWkb()))
+        .map(geometry -> VectorTileUtils.asVectorTileGeom(geometry, targetEnvelope, 4096, 0, true))
+        .map(geometry -> new Feature(null, Map.of(), geometry))
+        .toList();
+
+    var vectorTile = VectorTileUtils
+        .asVectorTile(new VectorTile(List.of(new Layer("contours", 4096, features))));
 
     rasterBand.delete();
     rasterDataset.delete();
diff --git a/baremaps-core/src/main/java/org/apache/baremaps/raster/Image.java b/baremaps-core/src/main/java/org/apache/baremaps/raster/Image.java
index 896304be..b26e3a53 100644
--- a/baremaps-core/src/main/java/org/apache/baremaps/raster/Image.java
+++ b/baremaps-core/src/main/java/org/apache/baremaps/raster/Image.java
@@ -1,22 +1,35 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
 package org.apache.baremaps.raster;
 
-import javax.imageio.ImageIO;
 import java.awt.image.BufferedImage;
 import java.io.IOException;
 import java.net.URL;
+import javax.imageio.ImageIO;
 
 
 public class Image {
 
-    public static void main(String[] args) throws IOException {
-        String urlString = String.format("https://s3.amazonaws.com/elevation-tiles-prod/geotiff/%s/%s/%s.tif", 14, 8492, 5792);
-        URL url = new URL(urlString);
-        BufferedImage tiffImage = ImageIO.read(url);
-        var raster = tiffImage.getRaster();
-        for (int x = 0; x < raster.getWidth(); x++) {
-            for (int y = 0; y < raster.getHeight(); y++) {
-                System.out.println(raster.getSampleFloat(y, y, 0));
-            }
-        }
+  public static void main(String[] args) throws IOException {
+    String urlString = String.format(
+        "https://s3.amazonaws.com/elevation-tiles-prod/geotiff/%s/%s/%s.tif", 14, 8492, 5792);
+    URL url = new URL(urlString);
+    BufferedImage tiffImage = ImageIO.read(url);
+    var raster = tiffImage.getRaster();
+    for (int x = 0; x < raster.getWidth(); x++) {
+      for (int y = 0; y < raster.getHeight(); y++) {
+        System.out.println(raster.getSampleFloat(y, y, 0));
+      }
     }
+  }
 }
diff --git a/baremaps-core/src/main/java/org/apache/baremaps/raster/Main.java b/baremaps-core/src/main/java/org/apache/baremaps/raster/Main.java
index f447f5c5..e7dbd691 100644
--- a/baremaps-core/src/main/java/org/apache/baremaps/raster/Main.java
+++ b/baremaps-core/src/main/java/org/apache/baremaps/raster/Main.java
@@ -26,15 +26,15 @@ import org.gdal.osr.SpatialReference;
 public class Main {
 
   public static void main(String[] args) {
-     var sourceFilename = Paths.get("examples/contour/liecthenstein-aster-dem-v2-3857.tif")
-     .toAbsolutePath().toString();
-     var hillshadeFilename =
-     Paths.get("examples/contour/liecthenstein-aster-dem-v2-3857-hillshade.tif").toAbsolutePath()
-     .toString();
-     var outputFilename = Paths.get("examples/contour/liecthenstein-aster-dem-v2-3857.shp")
-     .toAbsolutePath().toString();
-     var warpFilename = Paths.get("examples/contour/liecthenstein-aster-dem-v2-3857-warp.tif")
-     .toAbsolutePath().toString();
+    var sourceFilename = Paths.get("examples/contour/liecthenstein-aster-dem-v2-3857.tif")
+        .toAbsolutePath().toString();
+    var hillshadeFilename =
+        Paths.get("examples/contour/liecthenstein-aster-dem-v2-3857-hillshade.tif").toAbsolutePath()
+            .toString();
+    var outputFilename = Paths.get("examples/contour/liecthenstein-aster-dem-v2-3857.shp")
+        .toAbsolutePath().toString();
+    var warpFilename = Paths.get("examples/contour/liecthenstein-aster-dem-v2-3857-warp.tif")
+        .toAbsolutePath().toString();
 
     var dem = Paths.get("examples/contour/dem.xml")
         .toAbsolutePath().toString();
@@ -44,10 +44,10 @@ public class Main {
 
     planetContour();
 
-   hillshade(sourceFilename, 1, hillshadeFilename, 45d, 315d);
-   contourEx(hillshadeFilename, 1, outputFilename, 50, 0);
-   warp(sourceFilename, warpFilename);
-   shadow(hillshadeFilename, outputFilename);
+    hillshade(sourceFilename, 1, hillshadeFilename, 45d, 315d);
+    contourEx(hillshadeFilename, 1, outputFilename, 50, 0);
+    warp(sourceFilename, warpFilename);
+    shadow(hillshadeFilename, outputFilename);
   }
 
   public static void planetContour() {
diff --git a/baremaps-core/src/main/java/org/apache/baremaps/vectortile/VectorTileDecoder.java b/baremaps-core/src/main/java/org/apache/baremaps/vectortile/VectorTileDecoder.java
index 5b90747e..0202a83e 100644
--- a/baremaps-core/src/main/java/org/apache/baremaps/vectortile/VectorTileDecoder.java
+++ b/baremaps-core/src/main/java/org/apache/baremaps/vectortile/VectorTileDecoder.java
@@ -19,7 +19,6 @@ import java.io.IOException;
 import java.nio.ByteBuffer;
 import java.util.*;
 import java.util.stream.Collectors;
-
 import org.apache.baremaps.mvt.binary.VectorTile.Tile;
 import org.apache.baremaps.mvt.binary.VectorTile.Tile.GeomType;
 import org.apache.baremaps.mvt.binary.VectorTile.Tile.Value;
diff --git a/baremaps-core/src/main/java/org/apache/baremaps/vectortile/VectorTileEncoder.java b/baremaps-core/src/main/java/org/apache/baremaps/vectortile/VectorTileEncoder.java
index 715bcf25..d37081c5 100644
--- a/baremaps-core/src/main/java/org/apache/baremaps/vectortile/VectorTileEncoder.java
+++ b/baremaps-core/src/main/java/org/apache/baremaps/vectortile/VectorTileEncoder.java
@@ -20,7 +20,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.function.Consumer;
-
 import org.apache.baremaps.mvt.binary.VectorTile.Tile;
 import org.locationtech.jts.geom.*;
 
diff --git a/baremaps-core/src/main/java/org/apache/baremaps/vectortile/VectorTileUtils.java b/baremaps-core/src/main/java/org/apache/baremaps/vectortile/VectorTileUtils.java
index 3bab5c83..bbf54ab4 100644
--- a/baremaps-core/src/main/java/org/apache/baremaps/vectortile/VectorTileUtils.java
+++ b/baremaps-core/src/main/java/org/apache/baremaps/vectortile/VectorTileUtils.java
@@ -89,11 +89,11 @@ public class VectorTileUtils {
    */
   public static ByteBuffer asVectorTile(VectorTile vectorTile) {
     ByteBuffer original = new VectorTileEncoder()
-            .encodeTile(vectorTile)
-            .toByteString()
-            .asReadOnlyByteBuffer();
+        .encodeTile(vectorTile)
+        .toByteString()
+        .asReadOnlyByteBuffer();
     ByteBuffer clone = ByteBuffer.allocate(original.capacity());
-    original.rewind();//copy from the beginning
+    original.rewind();// copy from the beginning
     clone.put(original);
     original.rewind();
     clone.flip();
@@ -113,7 +113,7 @@ public class VectorTileUtils {
         .asReadOnlyByteBuffer();
 
     ByteBuffer clone = ByteBuffer.allocate(original.capacity());
-    original.rewind();//copy from the beginning
+    original.rewind();// copy from the beginning
     clone.put(original);
     original.rewind();
     clone.flip();
diff --git a/baremaps-core/src/test/java/org/apache/baremaps/vectortile/VectorTileTest.java b/baremaps-core/src/test/java/org/apache/baremaps/vectortile/VectorTileTest.java
index d8c91e7b..fa5320a4 100644
--- a/baremaps-core/src/test/java/org/apache/baremaps/vectortile/VectorTileTest.java
+++ b/baremaps-core/src/test/java/org/apache/baremaps/vectortile/VectorTileTest.java
@@ -22,7 +22,6 @@ import java.nio.file.Path;
 import java.util.List;
 import java.util.Map;
 import java.util.zip.GZIPInputStream;
-
 import org.junit.jupiter.api.Test;
 import org.locationtech.jts.geom.Coordinate;
 import org.locationtech.jts.geom.GeometryFactory;
diff --git a/baremaps-core/src/test/java/org/apache/baremaps/vectortile/VectorTileViewer.java b/baremaps-core/src/test/java/org/apache/baremaps/vectortile/VectorTileViewer.java
index 844367ad..ac7a3f53 100644
--- a/baremaps-core/src/test/java/org/apache/baremaps/vectortile/VectorTileViewer.java
+++ b/baremaps-core/src/test/java/org/apache/baremaps/vectortile/VectorTileViewer.java
@@ -27,10 +27,10 @@ import org.locationtech.jts.geom.Polygon;
 public class VectorTileViewer {
 
   public static void main(String... args) throws Exception {
-//    String arg =
-//        args.length > 0 ? args[0] : "baremaps-core/src/test/resources/vectortile/14-8493-5795.mvt";
-//    var path = Path.of(arg);
-//    try (var input = new GZIPInputStream(Files.newInputStream(path))) {
+    // String arg =
+    // args.length > 0 ? args[0] : "baremaps-core/src/test/resources/vectortile/14-8493-5795.mvt";
+    // var path = Path.of(arg);
+    // try (var input = new GZIPInputStream(Files.newInputStream(path))) {
 
     var url = new URL("http://localhost:9000/tiles/14/8628/5750.mvt");
 
diff --git a/baremaps-server/src/main/java/org/apache/baremaps/server/ServerResources.java b/baremaps-server/src/main/java/org/apache/baremaps/server/ServerResources.java
index f6312649..781dbf68 100644
--- a/baremaps-server/src/main/java/org/apache/baremaps/server/ServerResources.java
+++ b/baremaps-server/src/main/java/org/apache/baremaps/server/ServerResources.java
@@ -13,7 +13,6 @@
 package org.apache.baremaps.server;
 
 import static com.google.common.net.HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN;
-import static com.google.common.net.HttpHeaders.CONTENT_ENCODING;
 import static com.google.common.net.HttpHeaders.CONTENT_TYPE;
 
 import com.fasterxml.jackson.databind.ObjectMapper;
@@ -90,7 +89,7 @@ public class ServerResources {
         return Response.status(200) // lgtm [java/xss]
             .header(ACCESS_CONTROL_ALLOW_ORIGIN, "*")
             .header(CONTENT_TYPE, TILE_TYPE)
-            //.header(CONTENT_ENCODING, TILE_ENCODING)
+            // .header(CONTENT_ENCODING, TILE_ENCODING)
             .entity(array).build();
       } else {
         return Response.status(204).build();