Skip to content

Commit b21bd76

Browse files
committed
remove pmap: prefixes (breaking change) [#282]
1 parent 60e7d48 commit b21bd76

27 files changed

+118
-118
lines changed

tiles/src/main/java/com/protomaps/basemap/layers/Boundaries.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,15 @@ public void processNe(SourceFeature sf, FeatureCollector features) {
143143

144144
var line = features.line(this.name())
145145
// Core Tilezen schema properties
146-
.setAttr("pmap:kind", kind)
146+
.setAttr("kind", kind)
147147
// Don't label lines to reduce file size (and they aren't shown in styles anyhow)
148148
//.setAttr("name", sf.getString("name"))
149149
// Preview v4 schema (disabled)
150-
//.setAttr("pmap:min_zoom", sf.getLong("min_zoom"))
151-
.setAttr("pmap:min_admin_level", adminLevel)
150+
//.setAttr("min_zoom", sf.getLong("min_zoom"))
151+
.setAttr("min_admin_level", adminLevel)
152152
// Reduce file size at low zooms
153-
//.setAttr("pmap:ne_id", sf.getString("ne_id"))
154-
.setAttr("pmap:brk_a3", sf.getString("brk_a3"))
153+
//.setAttr("ne_id", sf.getString("ne_id"))
154+
.setAttr("brk_a3", sf.getString("brk_a3"))
155155
.setZoomRange(
156156
sf.getString("min_zoom") == null ? themeMinZoom : (int) minZoom,
157157
themeMaxZoom)
@@ -161,7 +161,7 @@ public void processNe(SourceFeature sf, FeatureCollector features) {
161161

162162
// Core Tilezen schema properties
163163
if (!kindDetail.isEmpty()) {
164-
line.setAttr("pmap:kind_detail", kindDetail);
164+
line.setAttr("kind_detail", kindDetail);
165165
}
166166

167167
if (disputed) {
@@ -238,16 +238,16 @@ public void processOsm(SourceFeature sf, FeatureCollector features) {
238238
var line = features.line(this.name())
239239
.setId(FeatureId.create(sf))
240240
// Core Tilezen schema properties
241-
.setAttr("pmap:kind", kind)
242-
.setAttr("pmap:min_admin_level", minAdminLevel.getAsInt())
241+
.setAttr("kind", kind)
242+
.setAttr("min_admin_level", minAdminLevel.getAsInt())
243243
.setMinPixelSize(0)
244244
// Preview v4 schema (disabled)
245-
//.setAttr("pmap:min_zoom", min_zoom)
245+
//.setAttr("min_zoom", min_zoom)
246246
.setMinZoom(themeMinZoom);
247247

248248
// Core Tilezen schema properties
249249
if (!kindDetail.isEmpty()) {
250-
line.setAttr("pmap:kind_detail", kindDetail);
250+
line.setAttr("kind_detail", kindDetail);
251251
}
252252

253253
// Core Tilezen schema properties

tiles/src/main/java/com/protomaps/basemap/layers/Buildings.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public void processOsm(SourceFeature sf, FeatureCollector features) {
7676
var feature = features.polygon(this.name())
7777
.setId(FeatureId.create(sf))
7878
// Core Tilezen schema properties
79-
.setAttr("pmap:kind", kind)
79+
.setAttr("kind", kind)
8080
// Core OSM tags for different kinds of places
8181
.setAttrWithMinzoom("layer", Parse.parseIntOrNull(sf.getString("layer")), 13)
8282
// NOTE: Height is quantized by zoom in a post-process step
@@ -85,7 +85,7 @@ public void processOsm(SourceFeature sf, FeatureCollector features) {
8585

8686
if (kind.equals("building_part")) {
8787
// We don't need to set WithMinzoom because that's implicate with the ZoomRange
88-
feature.setAttr("pmap:kind_detail", sf.getString("building:part"));
88+
feature.setAttr("kind_detail", sf.getString("building:part"));
8989
feature.setAttr(MIN_HEIGHT_KEY, height.min_height());
9090
}
9191

tiles/src/main/java/com/protomaps/basemap/layers/Earth.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ public String name() {
1616

1717
public void processPreparedOsm(SourceFeature ignoredSf, FeatureCollector features) {
1818
features.polygon(this.name())
19-
.setAttr("pmap:kind", "earth")
19+
.setAttr("kind", "earth")
2020
.setZoomRange(6, 15).setBufferPixels(8);
2121
}
2222

2323
public void processNe(SourceFeature sf, FeatureCollector features) {
2424
var sourceLayer = sf.getSourceLayer();
2525
if (sourceLayer.equals("ne_50m_land")) {
26-
features.polygon(this.name()).setZoomRange(0, 4).setBufferPixels(8).setAttr("pmap:kind", "earth");
26+
features.polygon(this.name()).setZoomRange(0, 4).setBufferPixels(8).setAttr("kind", "earth");
2727
} else if (sourceLayer.equals("ne_10m_land")) {
28-
features.polygon(this.name()).setZoomRange(5, 5).setBufferPixels(8).setAttr("pmap:kind", "earth");
28+
features.polygon(this.name()).setZoomRange(5, 5).setBufferPixels(8).setAttr("kind", "earth");
2929
}
3030
}
3131

tiles/src/main/java/com/protomaps/basemap/layers/Landcover.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public void processLandcover(SourceFeature sf, FeatureCollector features) {
2626

2727
features.polygon(this.name())
2828
.setId(FeatureId.create(sf))
29-
.setAttr("pmap:kind", kind)
29+
.setAttr("kind", kind)
3030
.setZoomRange(0, 7)
3131
.setSortKey(sortKey)
3232
.setMinPixelSize(0.0);

tiles/src/main/java/com/protomaps/basemap/layers/Landuse.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public void processOsm(SourceFeature sf, FeatureCollector features) {
152152
features.polygon(this.name())
153153
.setId(FeatureId.create(sf))
154154
// Core Tilezen schema properties
155-
.setAttr("pmap:kind", kind)
155+
.setAttr("kind", kind)
156156
// NOTE: (nvkelso 20230622) Consider zoom 5 instead...
157157
// But to match Protomaps v2 we do earlier
158158
.setZoomRange(2, 15)

tiles/src/main/java/com/protomaps/basemap/layers/Natural.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public void processOsm(SourceFeature sf, FeatureCollector features) {
3030
features.polygon(this.name())
3131
//.setId(FeatureId.create(sf))
3232
// Core Tilezen schema properties
33-
.setAttr("pmap:kind", kind)
33+
.setAttr("kind", kind)
3434
// NOTE: (nvkelso 20230622) Consider zoom 5 instead...
3535
// But to match Protomaps v2 we do earlier
3636
.setZoomRange(2, 15)

tiles/src/main/java/com/protomaps/basemap/layers/PhysicalLine.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ public void processOsm(SourceFeature sf, FeatureCollector features) {
3333
var feat = features.line(this.name())
3434
.setId(FeatureId.create(sf))
3535
// Core Tilezen schema properties
36-
.setAttr("pmap:kind", kind)
36+
.setAttr("kind", kind)
3737
// Used for client-side label collisions
38-
.setAttr("pmap:min_zoom", minZoom + 1)
38+
.setAttr("min_zoom", minZoom + 1)
3939
// Add less common core Tilezen attributes only at higher zooms (will continue to v4)
4040
//.setAttrWithMinzoom("bridge", sf.getString("bridge"), 12)
4141
//.setAttrWithMinzoom("tunnel", sf.getString("tunnel"), 12)
@@ -51,13 +51,13 @@ public void processOsm(SourceFeature sf, FeatureCollector features) {
5151
// Because of MapLibre performance and draw order limitations, generally the boolean is sufficient
5252
// See also: "layer" for more complicated ±6 layering for more sophisticated graphics libraries
5353
if (sf.hasTag("bridge") && !sf.hasTag("bridge", "no")) {
54-
feat.setAttr("pmap:level", 1);
54+
feat.setAttr("level", 1);
5555
} else if (sf.hasTag("tunnel") && !sf.hasTag("tunnel", "no")) {
56-
feat.setAttr("pmap:level", -1);
56+
feat.setAttr("level", -1);
5757
} else if (sf.hasTag("layer", "-6", "-5", "-4", "-3", "-2", "-1")) {
58-
feat.setAttr("pmap:level", -1);
58+
feat.setAttr("level", -1);
5959
} else {
60-
feat.setAttr("pmap:level", 0);
60+
feat.setAttr("level", 0);
6161
}
6262

6363
// Server sort features so client label collisions are pre-sorted

tiles/src/main/java/com/protomaps/basemap/layers/PhysicalPoint.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ public void processNe(SourceFeature sf, FeatureCollector features) {
5151

5252
if (!kind.isEmpty() && sf.hasTag("min_label") && sf.hasTag("name") && sf.getTag("name") != null) {
5353
var waterLabelPosition = features.pointOnSurface(this.name())
54-
.setAttr("pmap:kind", kind)
55-
.setAttr("pmap:min_zoom", minZoom + 1)
54+
.setAttr("kind", kind)
55+
.setAttr("min_zoom", minZoom + 1)
5656
.setZoomRange(sf.getString("min_label") == null ? themeMinZoom :
5757
(int) Double.parseDouble(sf.getString("min_label")) + 1, themeMaxZoom)
5858
.setBufferPixels(128);
@@ -88,9 +88,9 @@ public void processOsm(SourceFeature sf, FeatureCollector features) {
8888

8989
var feat = features.point(this.name())
9090
.setId(FeatureId.create(sf))
91-
.setAttr("pmap:kind", kind)
91+
.setAttr("kind", kind)
9292
// Used for client-side label collisions
93-
.setAttr("pmap:min_zoom", minZoom + 1)
93+
.setAttr("min_zoom", minZoom + 1)
9494
.setAttr("place", sf.getString("place"))
9595
.setAttr("natural", sf.getString("natural"))
9696
.setAttr("ele", sf.getString("ele"))
@@ -181,12 +181,12 @@ public void processOsm(SourceFeature sf, FeatureCollector features) {
181181

182182
var waterLabelPosition = features.pointOnSurface(this.name())
183183
// Core Tilezen schema properties
184-
.setAttr("pmap:kind", kind)
185-
.setAttr("pmap:kind_detail", kindDetail)
184+
.setAttr("kind", kind)
185+
.setAttr("kind_detail", kindDetail)
186186
// While other layers don't need min_zoom, physical point labels do for more
187187
// predictable client-side label collisions
188188
// 512 px zooms versus 256 px logical zooms
189-
.setAttr("pmap:min_zoom", nameMinZoom + 1)
189+
.setAttr("min_zoom", nameMinZoom + 1)
190190
// Add less common core Tilezen attributes only at higher zooms (will continue to v4)
191191
.setAttrWithMinzoom("bridge", sf.getString("bridge"), 12)
192192
.setAttrWithMinzoom("tunnel", sf.getString("tunnel"), 12)
@@ -196,7 +196,7 @@ public void processOsm(SourceFeature sf, FeatureCollector features) {
196196

197197
// Add less common core Tilezen attributes only at higher zooms (will continue to v4)
198198
if (!kindDetail.isEmpty()) {
199-
waterLabelPosition.setAttr("pmap:kind_detail", kindDetail);
199+
waterLabelPosition.setAttr("kind_detail", kindDetail);
200200
}
201201
if (sf.hasTag("water", "reservoir") || reservoir) {
202202
waterLabelPosition.setAttr("reservoir", true);

tiles/src/main/java/com/protomaps/basemap/layers/Places.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,13 +268,13 @@ public void processOsm(SourceFeature sf, FeatureCollector features) {
268268
var feat = features.point(this.name())
269269
.setId(FeatureId.create(sf))
270270
// Core Tilezen schema properties
271-
.setAttr("pmap:kind", kind)
272-
.setAttr("pmap:kind_detail", place)
273-
.setAttr("pmap:min_zoom", minZoom + 1)
271+
.setAttr("kind", kind)
272+
.setAttr("kind_detail", place)
273+
.setAttr("min_zoom", minZoom + 1)
274274
// Core OSM tags for different kinds of places
275275
.setAttr("capital", sf.getString("capital"))
276276
.setAttr("population", population)
277-
.setAttr("pmap:population_rank", populationRank)
277+
.setAttr("population_rank", populationRank)
278278
// Generally we use NE and low zooms, and OSM at high zooms
279279
// With exceptions for country and region labels
280280
.setZoomRange((int) minZoom, (int) maxZoom);

tiles/src/main/java/com/protomaps/basemap/layers/Pois.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -441,13 +441,13 @@ public void processOsm(SourceFeature sf, FeatureCollector features) {
441441
// (there is no merging of POIs like with lines and polygons in other layers)
442442
.setId(FeatureId.create(sf))
443443
// Core Tilezen schema properties
444-
.setAttr("pmap:kind", kind)
444+
.setAttr("kind", kind)
445445
// While other layers don't need min_zoom, POIs do for more predictable client-side label collisions
446446
// 512 px zooms versus 256 px logical zooms
447-
.setAttr("pmap:min_zoom", minZoom + 1)
447+
.setAttr("min_zoom", minZoom + 1)
448448
//
449449
// DEBUG
450-
//.setAttr("pmap:area_debug", wayArea)
450+
//.setAttr("area_debug", wayArea)
451451
//
452452
// Core OSM tags for different kinds of places
453453
// Special airport only tag (to indicate if it's an airport with regular commercial flights)
@@ -459,7 +459,7 @@ public void processOsm(SourceFeature sf, FeatureCollector features) {
459459

460460
// Core Tilezen schema properties
461461
if (!kindDetail.isEmpty()) {
462-
polyLabelPosition.setAttr("pmap:kind_detail", kindDetail);
462+
polyLabelPosition.setAttr("kind_detail", kindDetail);
463463
}
464464

465465
OsmNames.setOsmNames(polyLabelPosition, sf, 0);
@@ -482,10 +482,10 @@ public void processOsm(SourceFeature sf, FeatureCollector features) {
482482
// (there is no merging of POIs like with lines and polygons in other layers)
483483
.setId(FeatureId.create(sf))
484484
// Core Tilezen schema properties
485-
.setAttr("pmap:kind", kind)
485+
.setAttr("kind", kind)
486486
// While other layers don't need min_zoom, POIs do for more predictable client-side label collisions
487487
// 512 px zooms versus 256 px logical zooms
488-
.setAttr("pmap:min_zoom", minZoom + 1)
488+
.setAttr("min_zoom", minZoom + 1)
489489
// Core OSM tags for different kinds of places
490490
// Special airport only tag (to indicate if it's an airport with regular commercial flights)
491491
.setAttr("iata", sf.getString("iata"))
@@ -494,7 +494,7 @@ public void processOsm(SourceFeature sf, FeatureCollector features) {
494494

495495
// Core Tilezen schema properties
496496
if (!kindDetail.isEmpty()) {
497-
pointFeature.setAttr("pmap:kind_detail", kindDetail);
497+
pointFeature.setAttr("kind_detail", kindDetail);
498498
}
499499

500500
OsmNames.setOsmNames(pointFeature, sf, 0);
@@ -510,7 +510,7 @@ public void processOsm(SourceFeature sf, FeatureCollector features) {
510510
sf.hasTag("historic", "landmark", "wayside_cross") ||
511511
sf.hasTag("leisure", "dog_park", "firepit", "fishing", "pitch", "playground", "slipway", "swimming_area") ||
512512
sf.hasTag("tourism", "alpine_hut", "information", "picnic_site", "viewpoint", "wilderness_hut"))) {
513-
pointFeature.setAttr("pmap:min_zoom", 17);
513+
pointFeature.setAttr("min_zoom", 17);
514514
}
515515

516516
if (sf.hasTag("amenity", "clinic", "dentist", "doctors", "social_facility", "baby_hatch", "childcare",
@@ -527,7 +527,7 @@ public void processOsm(SourceFeature sf, FeatureCollector features) {
527527
"travel_agency") ||
528528
sf.hasTag("tourism", "artwork", "hanami", "trail_riding_station", "bed_and_breakfast", "chalet",
529529
"guest_house", "hostel")) {
530-
pointFeature.setAttr("pmap:min_zoom", 17);
530+
pointFeature.setAttr("min_zoom", 17);
531531
}
532532

533533
// Server sort features so client label collisions are pre-sorted
@@ -548,7 +548,7 @@ public void processOsm(SourceFeature sf, FeatureCollector features) {
548548
@Override
549549
public List<VectorTile.Feature> postProcess(int zoom, List<VectorTile.Feature> items) throws GeometryException {
550550

551-
// TODO: (nvkelso 20230623) Consider adding a "pmap:rank" here for POIs, like for Places
551+
// TODO: (nvkelso 20230623) Consider adding a "rank" here for POIs, like for Places
552552

553553
return items;
554554
}

tiles/src/main/java/com/protomaps/basemap/layers/Roads.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,9 @@ public void processOsm(SourceFeature sf, FeatureCollector features) {
135135
var feat = features.line("roads")
136136
.setId(FeatureId.create(sf))
137137
// Core Tilezen schema properties
138-
.setAttr("pmap:kind", kind)
138+
.setAttr("kind", kind)
139139
// To power better client label collisions
140-
.setAttr("pmap:min_zoom", minZoom + 1)
140+
.setAttr("min_zoom", minZoom + 1)
141141
.setAttrWithMinzoom("ref", shield.text(), minZoomShieldText)
142142
.setAttrWithMinzoom("shield_text_length", shieldTextLength, minZoomShieldText)
143143
.setAttrWithMinzoom("network", shield.network(), minZoomShieldText)
@@ -152,9 +152,9 @@ public void processOsm(SourceFeature sf, FeatureCollector features) {
152152

153153
// Core Tilezen schema properties
154154
if (!kindDetail.isEmpty()) {
155-
feat.setAttr("pmap:kind_detail", kindDetail);
155+
feat.setAttr("kind_detail", kindDetail);
156156
} else {
157-
feat.setAttr("pmap:kind_detail", highway);
157+
feat.setAttr("kind_detail", highway);
158158
}
159159

160160
// Core OSM tags for different kinds of places
@@ -164,18 +164,18 @@ public void processOsm(SourceFeature sf, FeatureCollector features) {
164164

165165
if (sf.hasTag("highway", "motorway_link", "trunk_link", "primary_link", "secondary_link",
166166
"tertiary_link")) {
167-
feat.setAttr("pmap:link", 1);
167+
feat.setAttr("link", 1);
168168
}
169169

170170
// Set "brunnel" (bridge / tunnel) property where "level" = 1 is a bridge, 0 is ground level, and -1 is a tunnel
171171
// Because of MapLibre performance and draw order limitations, generally the boolean is sufficent
172172
// See also: "layer" for more complicated ±6 layering for more sophisticated graphics libraries
173173
if (sf.hasTag("bridge") && !sf.hasTag("bridge", "no")) {
174-
feat.setAttrWithMinzoom("pmap:level", 1, 12);
174+
feat.setAttrWithMinzoom("level", 1, 12);
175175
} else if (sf.hasTag("tunnel") && !sf.hasTag("tunnel", "no")) {
176-
feat.setAttrWithMinzoom("pmap:level", -1, 12);
176+
feat.setAttrWithMinzoom("level", -1, 12);
177177
} else {
178-
feat.setAttrWithMinzoom("pmap:level", 0, 12);
178+
feat.setAttrWithMinzoom("level", 0, 12);
179179
}
180180

181181
// Server sort features so client label collisions are pre-sorted
@@ -198,8 +198,8 @@ public List<VectorTile.Feature> postProcess(int zoom, List<VectorTile.Feature> i
198198

199199
for (var item : items) {
200200
item.attrs().remove("highway");
201-
if (!item.attrs().containsKey("pmap:level")) {
202-
item.attrs().put("pmap:level", 0);
201+
if (!item.attrs().containsKey("level")) {
202+
item.attrs().put("level", 0);
203203
}
204204
}
205205

tiles/src/main/java/com/protomaps/basemap/layers/Transit.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ public void processOsm(SourceFeature sf, FeatureCollector features) {
7777
var feature = features.line(this.name())
7878
.setId(FeatureId.create(sf))
7979
// Core Tilezen schema properties
80-
.setAttr("pmap:kind", kind)
80+
.setAttr("kind", kind)
8181
// Used for client-side label collisions
82-
.setAttr("pmap:min_zoom", minZoom + 1)
82+
.setAttr("min_zoom", minZoom + 1)
8383
// Core OSM tags for different kinds of places
8484
.setAttr("layer", Parse.parseIntOrNull(sf.getString("layer")))
8585
.setAttr("network", sf.getString("network"))
@@ -90,18 +90,18 @@ public void processOsm(SourceFeature sf, FeatureCollector features) {
9090

9191
// Core Tilezen schema properties
9292
if (!kindDetail.isEmpty()) {
93-
feature.setAttr("pmap:kind_detail", kindDetail);
93+
feature.setAttr("kind_detail", kindDetail);
9494
}
9595

9696
// Set "brunnel" (bridge / tunnel) property where "level" = 1 is a bridge, 0 is ground level, and -1 is a tunnel
9797
// Because of MapLibre performance and draw order limitations, generally the boolean is sufficent
9898
// See also: "layer" for more complicated ±6 layering for more sophisticated graphics libraries
9999
if (sf.hasTag("bridge") && !sf.hasTag("bridge", "no")) {
100-
feature.setAttr("pmap:level", 1);
100+
feature.setAttr("level", 1);
101101
} else if (sf.hasTag("tunnel") && !sf.hasTag("tunnel", "no")) {
102-
feature.setAttr("pmap:level", -1);
102+
feature.setAttr("level", -1);
103103
} else {
104-
feature.setAttr("pmap:level", 0);
104+
feature.setAttr("level", 0);
105105
}
106106

107107
// Too many small pier lines otherwise

0 commit comments

Comments
 (0)