Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Tiles 4.7.1
------
- adjust vector tile feature IDs to start at id=1 [#420]

Tiles 4.7.0
------
- port water, earth and landcover to use Matchers [#416]
Expand Down
2 changes: 1 addition & 1 deletion tiles/src/main/java/com/protomaps/basemap/Basemap.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public String description() {

@Override
public String version() {
return "4.7.0";
return "4.7.1";
}

@Override
Expand Down
3 changes: 2 additions & 1 deletion tiles/src/main/java/com/protomaps/basemap/layers/Earth.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public String name() {

public void processPreparedOsm(SourceFeature ignoredSf, FeatureCollector features) {
features.polygon(LAYER_NAME)
.setId(0)
.setId(1)
.setAttr("kind", "earth")
.setPixelTolerance(PIXEL_TOLERANCE)
.setMinPixelSize(1.0)
Expand All @@ -44,6 +44,7 @@ public void processNe(SourceFeature sf, FeatureCollector features) {
int maxZoom = sourceLayer.equals("ne_50m_land") ? 4 : 5;

features.polygon(LAYER_NAME)
.setId(1)
.setAttr("kind", "earth")
.setZoomRange(minZoom, maxZoom)
.setPixelTolerance(PIXEL_TOLERANCE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public void processNe(SourceFeature sf, FeatureCollector features) {
// Web Mercator Y = 0.7 is roughly 60 deg South, i.e., Antarctica.
if (centroid.getY() > 0.7) {
features.polygon(LAYER_NAME)
.setId(0)
.setId(1)
.setAttr("kind", "glacier")
.setMaxZoom(7)
.setMinPixelSize(1.0)
Expand All @@ -49,7 +49,7 @@ public void processLandcover(SourceFeature sf, FeatureCollector features) {
Integer sortKey = sortKeyMapping.getOrDefault(daylightClass, 6);

features.polygon(LAYER_NAME)
.setId(0)
.setId(1L + sortKey)
.setAttr("kind", kind)
.setZoomRange(0, 7)
.setSortKey(sortKey)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ public String name() {

public void processPreparedOsm(SourceFeature ignoredSf, FeatureCollector features) {
features.polygon(LAYER_NAME)
.setId(0)
.setId(1)
.setAttr("kind", "ocean")
.setAttr("sort_rank", 200)
.setPixelTolerance(Earth.PIXEL_TOLERANCE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class EarthTest extends LayerTest {
@Test
void simple() {
assertFeatures(15,
List.of(Map.of("_id", 0L, "kind", "earth")),
List.of(Map.of("_id", 1L, "kind", "earth")),
process(SimpleFeature.create(
newPolygon(0, 0, 0, 1, 1, 1, 0, 0),
new HashMap<>(Map.of()),
Expand All @@ -41,6 +41,7 @@ void cliff() {
void testNe() {
assertFeatures(15,
List.of(Map.of("kind", "earth",
"_id", 1L,
"_minzoom", 0,
"_maxzoom", 4)),
process(SimpleFeature.create(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class LandcoverTest extends LayerTest {
})
void simple(String daylightClassString, String expectedString, Integer expectedSortKey) {
assertFeatures(7,
List.of(Map.of("kind", expectedString, "_sortkey", expectedSortKey)),
List.of(Map.of("kind", expectedString, "_sortkey", expectedSortKey, "_id", 1L + expectedSortKey)),
process(SimpleFeature.create(
newPolygon(0, 0, 0, 1, 1, 1, 0, 0),
new HashMap<>(Map.of("class", daylightClassString)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class WaterTest extends LayerTest {
@Test
void preparedOsm() {
assertFeatures(15,
List.of(Map.of("_id", 0L, "kind", "ocean")),
List.of(Map.of("_id", 1L, "kind", "ocean")),
process(SimpleFeature.create(
newPolygon(0, 0, 0, 1, 1, 1, 0, 0),
new HashMap<>(Map.of()),
Expand Down
Loading