diff --git a/.run/overture-serve.run.xml b/.run/overture-serve.run.xml
new file mode 100644
index 000000000..374bdab4d
--- /dev/null
+++ b/.run/overture-serve.run.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.run/overture-workflow.run.xml b/.run/overture-workflow.run.xml
new file mode 100644
index 000000000..80cccb25f
--- /dev/null
+++ b/.run/overture-workflow.run.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/baremaps-cli/src/main/resources/log4j.properties b/baremaps-cli/src/main/resources/log4j.properties
new file mode 100644
index 000000000..9109d40f8
--- /dev/null
+++ b/baremaps-cli/src/main/resources/log4j.properties
@@ -0,0 +1,8 @@
+# Root logger option
+log4j.rootLogger=INFO, stdout
+
+# Direct log messages to console
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.Target=System.out
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
\ No newline at end of file
diff --git a/baremaps-core/src/main/java/org/apache/baremaps/storage/geoparquet/GeoParquetDataStore.java b/baremaps-core/src/main/java/org/apache/baremaps/storage/geoparquet/GeoParquetDataStore.java
index 05874cf91..46283391f 100644
--- a/baremaps-core/src/main/java/org/apache/baremaps/storage/geoparquet/GeoParquetDataStore.java
+++ b/baremaps-core/src/main/java/org/apache/baremaps/storage/geoparquet/GeoParquetDataStore.java
@@ -30,22 +30,24 @@
public class GeoParquetDataStore implements DataStore {
private final URI uri;
+ private final String tableName;
- public GeoParquetDataStore(URI uri) {
+ public GeoParquetDataStore(URI uri, String tableName) {
this.uri = uri;
+ this.tableName = tableName;
}
@Override
public List list() throws DataStoreException {
- return List.of(uri.toString());
+ return List.of(tableName);
}
@Override
public DataTable get(String name) throws DataStoreException {
- if (!uri.toString().equals(name)) {
+ if (!tableName.equals(name)) {
throw new DataStoreException("Table not found");
}
- return new GeoParquetDataTable(uri);
+ return new GeoParquetDataTable(uri, tableName);
}
@Override
diff --git a/baremaps-core/src/main/java/org/apache/baremaps/storage/geoparquet/GeoParquetDataTable.java b/baremaps-core/src/main/java/org/apache/baremaps/storage/geoparquet/GeoParquetDataTable.java
index 0d05f680b..dcfa43838 100644
--- a/baremaps-core/src/main/java/org/apache/baremaps/storage/geoparquet/GeoParquetDataTable.java
+++ b/baremaps-core/src/main/java/org/apache/baremaps/storage/geoparquet/GeoParquetDataTable.java
@@ -32,12 +32,15 @@ public class GeoParquetDataTable implements DataTable {
private final URI path;
+ private final String name;
+
private DataSchema schema;
private GeoParquetReader reader;
- public GeoParquetDataTable(URI path) {
+ public GeoParquetDataTable(URI path, String name) {
this.path = path;
+ this.name = name;
}
private GeoParquetReader reader() {
@@ -75,7 +78,7 @@ public Stream stream() {
public Stream parallelStream() {
try {
return reader().read().map(group -> new DataRowImpl(
- GeoParquetTypeConversion.asSchema(path.toString(), group.getSchema()),
+ GeoParquetTypeConversion.asSchema(name, group.getSchema()),
GeoParquetTypeConversion.asRowValues(group)));
} catch (IOException | URISyntaxException e) {
throw new GeoParquetException("Fail to read() the reader", e);
@@ -98,12 +101,20 @@ public DataSchema schema() {
if (schema == null) {
try {
Schema schema = reader().getGeoParquetSchema();
- this.schema = GeoParquetTypeConversion.asSchema(path.toString(), schema);
+ this.schema = GeoParquetTypeConversion.asSchema(name, schema);
return this.schema;
} catch (URISyntaxException e) {
- throw new GeoParquetException("Fail toe get the schema.", e);
+ throw new GeoParquetException("Failed to get the schema.", e);
}
}
return schema;
}
+
+ public int srid(String column) {
+ try {
+ return reader().getGeoParquetMetadata().getSrid(column);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
}
diff --git a/baremaps-core/src/main/java/org/apache/baremaps/storage/geoparquet/GeoParquetTypeConversion.java b/baremaps-core/src/main/java/org/apache/baremaps/storage/geoparquet/GeoParquetTypeConversion.java
index 78be70624..1d802673a 100644
--- a/baremaps-core/src/main/java/org/apache/baremaps/storage/geoparquet/GeoParquetTypeConversion.java
+++ b/baremaps-core/src/main/java/org/apache/baremaps/storage/geoparquet/GeoParquetTypeConversion.java
@@ -46,9 +46,9 @@ private static List asDataColumns(Schema field) {
private static DataColumn asDataColumn(Field field) {
Cardinality cardinality = switch (field.cardinality()) {
- case REQUIRED -> Cardinality.REQUIRED;
+ case REQUIRED -> Cardinality.OPTIONAL;
case OPTIONAL -> Cardinality.OPTIONAL;
- case REPEATED -> Cardinality.REPEATED;
+ case REPEATED -> Cardinality.OPTIONAL;
};
return switch (field.type()) {
case BINARY -> new DataColumnFixed(field.name(), cardinality, Type.BINARY);
@@ -71,6 +71,10 @@ public static List