maplibre / maplibre-tile-spec

Next generation vector tiles format
Apache License 2.0
137 stars 11 forks source link

MltConverter.convertMvt can fail with "Column mappings are required for nested property columns" #59

Closed springmeyer closed 1 month ago

springmeyer commented 2 months ago

Currently MltConverter.convertMvt succeeds with some tiles and fails with others with the error of:

java.lang.IllegalArgumentException: Column mappings are required for nested property columns.
    at com.mlt.converter.encodings.PropertyEncoder.encodePropertyColumns(PropertyEncoder.java:43)
    at com.mlt.converter.MltConverter.convertMvt(MltConverter.java:161)

For example, using the new CLI at https://github.com/maplibre/maplibre-tile-spec/pull/55, this works:

java -jar build/libs/mvt2mlt-1.0-SNAPSHOT.jar -mvt ../../test/fixtures/omt/mvt/3_4_5.mvt -output output

And this fails:

java -jar build/libs/mvt2mlt-1.0-SNAPSHOT.jar -mvt ../../test/fixtures/omt/mvt/10_530_682.mvt -output output
java.lang.IllegalArgumentException: Column mappings are required for nested property columns.
    at com.mlt.converter.encodings.PropertyEncoder.encodePropertyColumns(PropertyEncoder.java:43)
    at com.mlt.converter.MltConverter.convertMvt(MltConverter.java:161)
    at com.mlt.converter.MltCliAdapter.main(MltCliAdapter.java:78)

Is the issue that the CLI is hardcoding (like the tests) specific properties which may or may not be present in the tiles?

EDIT: no longer hardcoding, removed in https://github.com/maplibre/maplibre-tile-spec/pull/55/commits/920f1b21b305d1a522596fd5c6351880cc508c49

       var columnMapping = new ColumnMapping("name", ":", true);
       var columnMappings = Optional.of(List.of(columnMapping));

@mactrem @nyurik @ebrelsford

springmeyer commented 1 month ago

This was fixed by https://github.com/maplibre/maplibre-tile-spec/commit/db3e06780c9d38f573d1d013827dd9db5ada8e3c