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

commit d88eb0b434c57f7acb972c568dfac589a34c2546
Author: Bertil Chapuis <[email protected]>
AuthorDate: Sun May 21 20:10:26 2023 +0200

    Fix issues after rebase
---
 .run/ContourTileStore.run.xml                      | 16 -----
 .../java/org/apache/baremaps/cli/map/Contour.java  |  6 +-
 baremaps-core/pom.xml                              | 44 +++++++-------
 .../java/org/apache/baremaps/raster/AsterDem.java  | 70 ++++++++++++++++++++++
 .../apache/baremaps/raster/ContourTileStore.java   | 13 ++--
 .../java/org/apache/baremaps/raster/Image.java     | 35 +++++++----
 .../vectortile/{Tile.java => VectorTile.java}      |  6 +-
 .../baremaps/vectortile/VectorTileDecoder.java     | 20 +++----
 .../baremaps/vectortile/VectorTileEncoder.java     | 34 +++++------
 .../baremaps/vectortile/VectorTileFunctions.java   |  8 +--
 .../vectortile/VectorTileFunctionsTest.java        |  3 +-
 .../apache/baremaps/vectortile/VectorTileTest.java |  4 +-
 .../baremaps/vectortile/VectorTileViewer.java      |  4 +-
 13 files changed, 164 insertions(+), 99 deletions(-)

diff --git a/.run/ContourTileStore.run.xml b/.run/ContourTileStore.run.xml
deleted file mode 100644
index 307d971d..00000000
--- a/.run/ContourTileStore.run.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<component name="ProjectRunConfigurationManager">
-  <configuration default="false" name="ContourTileStore" type="Application" 
factoryName="Application" nameIsGenerated="true">
-    <option name="MAIN_CLASS_NAME" 
value="org.apache.baremaps.raster.ContourTileStore" />
-    <module name="baremaps-core" />
-    <option name="VM_PARAMETERS" 
value="-Djava.library.path=$PROJECT_DIR$/../../osgeo/gdal/build/swig/java" />
-    <extension name="coverage">
-      <pattern>
-        <option name="PATTERN" value="org.apache.baremaps.raster.*" />
-        <option name="ENABLED" value="true" />
-      </pattern>
-    </extension>
-    <method v="2">
-      <option name="Make" enabled="true" />
-    </method>
-  </configuration>
-</component>
\ No newline at end of file
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 055456d5..de4b9e94 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
@@ -13,17 +13,17 @@
 package org.apache.baremaps.cli.map;
 
 import static 
io.servicetalk.data.jackson.jersey.ServiceTalkJacksonSerializerFeature.contextResolverFor;
-import static 
org.apache.baremaps.server.DefaultObjectMapper.defaultObjectMapper;
 
 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.database.tile.TileStore;
 import org.apache.baremaps.raster.ContourTileStore;
 import org.apache.baremaps.server.CorsFilter;
 import org.apache.baremaps.server.ServerResources;
+import org.apache.baremaps.tilestore.TileStore;
+import org.apache.baremaps.utils.ObjectMapperUtils;
 import org.glassfish.hk2.utilities.binding.AbstractBinder;
 import org.glassfish.jersey.server.ResourceConfig;
 import org.slf4j.Logger;
@@ -55,7 +55,7 @@ public class Contour implements Callable<Integer> {
 
   @Override
   public Integer call() throws Exception {
-    var objectMapper = defaultObjectMapper();
+    var objectMapper = ObjectMapperUtils.objectMapper();
     var tileStore = new ContourTileStore();
 
     // Configure the application
diff --git a/baremaps-core/pom.xml b/baremaps-core/pom.xml
index e38f2be1..7649671e 100644
--- a/baremaps-core/pom.xml
+++ b/baremaps-core/pom.xml
@@ -25,29 +25,7 @@ limitations under the License.
 
   <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>
@@ -88,6 +66,16 @@ limitations under the License.
       <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>
@@ -132,6 +120,11 @@ limitations under the License.
       <groupId>org.apache.lucene</groupId>
       <artifactId>lucene-spatial-extras</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.apache.sis.storage</groupId>
+      <artifactId>sis-geotiff</artifactId>
+      <version>1.3</version>
+    </dependency>
     <dependency>
       <groupId>org.gdal</groupId>
       <artifactId>gdal</artifactId>
@@ -172,6 +165,13 @@ limitations under the License.
     </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
new file mode 100644
index 00000000..8ce28143
--- /dev/null
+++ b/baremaps-core/src/main/java/org/apache/baremaps/raster/AsterDem.java
@@ -0,0 +1,70 @@
+/*
+ * 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;
+import java.io.IOException;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.nio.file.StandardCopyOption;
+import java.util.ArrayList;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class AsterDem {
+
+  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();
+    }
+
+    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 bce42cd5..5eeb5855 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
@@ -24,6 +24,7 @@ import org.apache.baremaps.tilestore.TileStoreException;
 import org.apache.baremaps.utils.GeometryUtils;
 import org.apache.baremaps.vectortile.Feature;
 import org.apache.baremaps.vectortile.Layer;
+import org.apache.baremaps.vectortile.VectorTile;
 import org.apache.baremaps.vectortile.VectorTileFunctions;
 import org.gdal.gdal.Dataset;
 import org.gdal.gdal.WarpOptions;
@@ -32,7 +33,6 @@ import org.gdal.gdalconst.gdalconstConstants;
 import org.gdal.ogr.ogr;
 import org.gdal.osr.SpatialReference;
 import org.locationtech.jts.geom.Envelope;
-import org.locationtech.jts.geom.GeometryFactory;
 import org.locationtech.proj4j.ProjCoordinate;
 
 public class ContourTileStore implements TileStore, AutoCloseable {
@@ -45,7 +45,7 @@ public class ContourTileStore implements TileStore, 
AutoCloseable {
   private final Dataset sourceDataset;
 
   public ContourTileStore() {
-    var dem = 
Paths.get("examples/contour/dem.xml").toAbsolutePath().toString();
+    var dem = Paths.get("dem.xml").toAbsolutePath().toString();
     sourceDataset = gdal.Open(dem, gdalconstConstants.GA_ReadOnly);
   }
 
@@ -84,13 +84,13 @@ public class ContourTileStore implements TileStore, 
AutoCloseable {
         .mapToObj(vectorLayer::GetFeature)
         .map(feature -> feature.GetGeometryRef())
         .map(geometry -> GeometryUtils.deserialize(geometry.ExportToWkb()))
-        .map(geometry -> VectorTileFunctions.asVectorTileGeom(geometry, 
targetEnvelope, 4096, 0, true))
+        .map(geometry -> VectorTileFunctions.asVectorTileGeom(geometry, 
targetEnvelope, 4096, 0,
+            true))
         .map(geometry -> new Feature(null, Map.of(), geometry))
         .toList();
 
-    var vectorTile = VectorTileFunctions.asVectorTile(
-        new org.apache.baremaps.vectortile.Tile(List.of(new Layer("contours", 
4096, features))));
-
+    var vectorTile = VectorTileFunctions
+        .asVectorTile(new VectorTile(List.of(new Layer("contours", 4096, 
features))));
 
     rasterBand.delete();
     rasterDataset.delete();
@@ -117,7 +117,6 @@ public class ContourTileStore implements TileStore, 
AutoCloseable {
   public static void main(String[] args) throws Exception {
     var store = new ContourTileStore();
     store.read(new TileCoord(8492, 5792, 14).parent());
-
   }
 
 }
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/vectortile/Tile.java 
b/baremaps-core/src/main/java/org/apache/baremaps/vectortile/VectorTile.java
similarity index 93%
rename from baremaps-core/src/main/java/org/apache/baremaps/vectortile/Tile.java
rename to 
baremaps-core/src/main/java/org/apache/baremaps/vectortile/VectorTile.java
index 12ea826d..bb37b33c 100644
--- a/baremaps-core/src/main/java/org/apache/baremaps/vectortile/Tile.java
+++ b/baremaps-core/src/main/java/org/apache/baremaps/vectortile/VectorTile.java
@@ -23,14 +23,14 @@ import java.util.List;
 /**
  * A vector tile layer.
  */
-public class Tile {
+public class VectorTile {
 
   private List<Layer> layers;
 
   /**
    * Creates a new tile.
    */
-  public Tile(List<Layer> layers) {
+  public VectorTile(List<Layer> layers) {
     this.layers = layers;
   }
 
@@ -58,7 +58,7 @@ public class Tile {
       return true;
     if (o == null || getClass() != o.getClass())
       return false;
-    Tile tile = (Tile) o;
+    VectorTile tile = (VectorTile) o;
     return Objects.equal(layers, tile.layers);
   }
 
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 c76f502c..52f55892 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
@@ -24,7 +24,7 @@ import java.io.IOException;
 import java.nio.ByteBuffer;
 import java.util.*;
 import java.util.stream.Collectors;
-import org.apache.baremaps.mvt.binary.VectorTile;
+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;
 import org.locationtech.jts.geom.*;
@@ -57,9 +57,9 @@ public class VectorTileDecoder {
    * @return The decoded vector tile
    * @throws IOException If an error occurs while decoding the vector tile
    */
-  public Tile decodeTile(ByteBuffer buffer) throws IOException {
+  public VectorTile decodeTile(ByteBuffer buffer) throws IOException {
     try {
-      VectorTile.Tile tile = VectorTile.Tile.parseFrom(buffer);
+      org.apache.baremaps.mvt.binary.VectorTile.Tile tile = 
Tile.parseFrom(buffer);
       return decodeTile(tile);
     } catch (InvalidProtocolBufferException e) {
       throw new IOException(e);
@@ -72,11 +72,11 @@ public class VectorTileDecoder {
    * @param tile The vector tile to decode
    * @return The decoded vector tile
    */
-  public Tile decodeTile(VectorTile.Tile tile) {
+  public VectorTile decodeTile(Tile tile) {
     List<Layer> layers = tile.getLayersList().stream()
         .map(this::decodeLayer)
         .collect(Collectors.toList());
-    return new Tile(layers);
+    return new VectorTile(layers);
   }
 
   /**
@@ -88,7 +88,7 @@ public class VectorTileDecoder {
    */
   public Layer decodeLayer(ByteBuffer buffer) throws IOException {
     try {
-      VectorTile.Tile.Layer layer = VectorTile.Tile.Layer.parseFrom(buffer);
+      Tile.Layer layer = Tile.Layer.parseFrom(buffer);
       return decodeLayer(layer);
     } catch (InvalidProtocolBufferException e) {
       throw new IOException(e);
@@ -101,7 +101,7 @@ public class VectorTileDecoder {
    * @param layer The vector tile layer
    * @return The decoded layer
    */
-  public Layer decodeLayer(VectorTile.Tile.Layer layer) {
+  public Layer decodeLayer(Tile.Layer layer) {
     String name = layer.getName();
     int extent = layer.getExtent();
 
@@ -152,7 +152,7 @@ public class VectorTileDecoder {
    * @param feature The vector tile feature to decode
    * @return The decoded feature
    */
-  protected Feature decodeFeature(VectorTile.Tile.Feature feature) {
+  protected Feature decodeFeature(Tile.Feature feature) {
 
     cx = 0;
     cy = 0;
@@ -169,7 +169,7 @@ public class VectorTileDecoder {
    * @param feature The feature to decode
    * @return The tags of the feature
    */
-  protected Map<String, Object> decodeTags(VectorTile.Tile.Feature feature) {
+  protected Map<String, Object> decodeTags(Tile.Feature feature) {
     Map<String, Object> tags = new HashMap<>();
     List<Integer> encoding = feature.getTagsList();
     for (int i = 0; i < encoding.size(); i += 2) {
@@ -186,7 +186,7 @@ public class VectorTileDecoder {
    * @param feature The vector tile feature
    * @return The decoded geometry
    */
-  protected Geometry decodeGeometry(VectorTile.Tile.Feature feature) {
+  protected Geometry decodeGeometry(Tile.Feature feature) {
     GeomType type = feature.getType();
     List<Integer> encoding = feature.getGeometryList();
     switch (type) {
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 0a679303..45a1d6d0 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
@@ -25,7 +25,7 @@ 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;
+import org.apache.baremaps.mvt.binary.VectorTile.Tile;
 import org.locationtech.jts.geom.*;
 
 /**
@@ -56,8 +56,8 @@ public class VectorTileEncoder {
    * @param tile The tile to encode
    * @return The vector tile
    */
-  public VectorTile.Tile encodeTile(Tile tile) {
-    VectorTile.Tile.Builder builder = VectorTile.Tile.newBuilder();
+  public Tile encodeTile(VectorTile tile) {
+    Tile.Builder builder = Tile.newBuilder();
     tile.getLayers().forEach(layer -> builder.addLayers(encodeLayer(layer)));
     return builder.build();
   }
@@ -68,11 +68,11 @@ public class VectorTileEncoder {
    * @param layer The layer to encode
    * @return The vector tile layer
    */
-  public VectorTile.Tile.Layer encodeLayer(Layer layer) {
+  public Tile.Layer encodeLayer(Layer layer) {
     keys = new ArrayList<>();
     values = new ArrayList<>();
 
-    VectorTile.Tile.Layer.Builder builder = VectorTile.Tile.Layer.newBuilder();
+    Tile.Layer.Builder builder = Tile.Layer.newBuilder();
     builder.setName(layer.getName());
     builder.setVersion(2);
     builder.setExtent(layer.getExtent());
@@ -94,8 +94,8 @@ public class VectorTileEncoder {
    * @param object The object to encode
    * @return The vector tile value
    */
-  protected VectorTile.Tile.Value encodeValue(Object object) {
-    VectorTile.Tile.Value.Builder builder = VectorTile.Tile.Value.newBuilder();
+  protected Tile.Value encodeValue(Object object) {
+    Tile.Value.Builder builder = Tile.Value.newBuilder();
 
     // Encode the value based on its type
     if (object instanceof String value) {
@@ -120,11 +120,11 @@ public class VectorTileEncoder {
    *
    * @param feature The feature to encode.
    */
-  protected void encodeFeature(Feature feature, 
Consumer<VectorTile.Tile.Feature> consumer) {
+  protected void encodeFeature(Feature feature, Consumer<Tile.Feature> 
consumer) {
     cx = 0;
     cy = 0;
 
-    VectorTile.Tile.Feature.Builder builder = 
VectorTile.Tile.Feature.newBuilder();
+    Tile.Feature.Builder builder = Tile.Feature.newBuilder();
     if (feature.getId() != null) {
       builder.setId(feature.getId());
     }
@@ -135,21 +135,21 @@ public class VectorTileEncoder {
     consumer.accept(builder.build());
   }
 
-  protected VectorTile.Tile.GeomType encodeGeometryType(Geometry geometry) {
+  protected Tile.GeomType encodeGeometryType(Geometry geometry) {
     if (geometry instanceof Point) {
-      return VectorTile.Tile.GeomType.POINT;
+      return Tile.GeomType.POINT;
     } else if (geometry instanceof MultiPoint) {
-      return VectorTile.Tile.GeomType.POINT;
+      return Tile.GeomType.POINT;
     } else if (geometry instanceof LineString) {
-      return VectorTile.Tile.GeomType.LINESTRING;
+      return Tile.GeomType.LINESTRING;
     } else if (geometry instanceof MultiLineString) {
-      return VectorTile.Tile.GeomType.LINESTRING;
+      return Tile.GeomType.LINESTRING;
     } else if (geometry instanceof Polygon) {
-      return VectorTile.Tile.GeomType.POLYGON;
+      return Tile.GeomType.POLYGON;
     } else if (geometry instanceof MultiPolygon) {
-      return VectorTile.Tile.GeomType.POLYGON;
+      return Tile.GeomType.POLYGON;
     } else {
-      return VectorTile.Tile.GeomType.UNKNOWN;
+      return Tile.GeomType.UNKNOWN;
     }
   }
 
diff --git 
a/baremaps-core/src/main/java/org/apache/baremaps/vectortile/VectorTileFunctions.java
 
b/baremaps-core/src/main/java/org/apache/baremaps/vectortile/VectorTileFunctions.java
index 59a45654..7f3dd2d5 100644
--- 
a/baremaps-core/src/main/java/org/apache/baremaps/vectortile/VectorTileFunctions.java
+++ 
b/baremaps-core/src/main/java/org/apache/baremaps/vectortile/VectorTileFunctions.java
@@ -92,11 +92,11 @@ public class VectorTileFunctions {
    * @param vectorTile The tile to transform
    * @return The transformed tile
    */
-  public static ByteBuffer asVectorTile(Tile vectorTile) {
+  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
     clone.put(original);
diff --git 
a/baremaps-core/src/test/java/org/apache/baremaps/vectortile/VectorTileFunctionsTest.java
 
b/baremaps-core/src/test/java/org/apache/baremaps/vectortile/VectorTileFunctionsTest.java
index 181d493a..10f4860a 100644
--- 
a/baremaps-core/src/test/java/org/apache/baremaps/vectortile/VectorTileFunctionsTest.java
+++ 
b/baremaps-core/src/test/java/org/apache/baremaps/vectortile/VectorTileFunctionsTest.java
@@ -45,7 +45,8 @@ class VectorTileFunctionsTest {
 
     // Transform the input geometry into a vector tile geometry
     var outputGeom =
-        VectorTileFunctions.asVectorTileGeom(inputGeom, 
envelope.getEnvelopeInternal(), extent, buffer, clipGeom);
+        VectorTileFunctions.asVectorTileGeom(inputGeom, 
envelope.getEnvelopeInternal(), extent,
+            buffer, clipGeom);
 
     // Check if the output geometry is not null
     assertNotNull(outputGeom);
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 2f2394a9..c3ed530a 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
@@ -20,7 +20,6 @@ package org.apache.baremaps.vectortile;
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import java.awt.*;
 import java.io.IOException;
 import java.nio.ByteBuffer;
 import java.nio.file.Files;
@@ -28,7 +27,6 @@ import java.nio.file.Path;
 import java.util.List;
 import java.util.Map;
 import java.util.zip.GZIPInputStream;
-import javax.swing.*;
 import org.junit.jupiter.api.Test;
 import org.locationtech.jts.geom.Coordinate;
 import org.locationtech.jts.geom.GeometryFactory;
@@ -39,7 +37,7 @@ public class VectorTileTest {
 
   @Test
   public void endToEnd() {
-    var tile = new Tile(List.of(
+    var tile = new VectorTile(List.of(
         new Layer("layer", 256, List.of(
             new Feature(1l, Map.of("a", 1.0, "b", "2"),
                 GEOMETRY_FACTORY.createPoint(new Coordinate(1, 2))),
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 a4f75369..dbdc6978 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
@@ -53,11 +53,11 @@ public class VectorTileViewer {
 
   static class TilePanel extends JPanel {
 
-    private final Tile tile;
+    private final VectorTile tile;
 
     private final int extent;
 
-    public TilePanel(Tile tile, int extent) {
+    public TilePanel(VectorTile tile, int extent) {
       this.tile = tile;
       this.extent = extent;
     }

Reply via email to