Skip to content

Commit

Permalink
layer tags are all integers [#72] (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdon authored Aug 21, 2023
1 parent d4e92a4 commit 2d6d000
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.onthegomap.planetiler.VectorTile;
import com.onthegomap.planetiler.geo.GeometryException;
import com.onthegomap.planetiler.reader.SourceFeature;
import com.onthegomap.planetiler.util.Parse;
import com.protomaps.basemap.feature.FeatureId;
import com.protomaps.basemap.postprocess.Area;
import java.util.List;
Expand Down Expand Up @@ -57,7 +58,7 @@ public void processFeature(SourceFeature sf, FeatureCollector features) {
// Core Tilezen schema properties
.setAttr("pmap:kind", kind)
// Core OSM tags for different kinds of places
.setAttrWithMinzoom("layer", sf.getString("layer"), 13)
.setAttrWithMinzoom("layer", Parse.parseIntOrNull(sf.getString("layer")), 13)
// NOTE: Height is quantized by zoom in a post-process step
.setAttr("height", height)
.setZoomRange(minZoom, 15);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.onthegomap.planetiler.ForwardingProfile;
import com.onthegomap.planetiler.VectorTile;
import com.onthegomap.planetiler.reader.SourceFeature;
import com.onthegomap.planetiler.util.Parse;
import com.protomaps.basemap.feature.FeatureId;
import com.protomaps.basemap.names.OsmNames;
import java.util.List;
Expand Down Expand Up @@ -44,7 +45,7 @@ public void processFeature(SourceFeature sf, FeatureCollector features) {
// Add less common core Tilezen attributes only at higher zooms (will continue to v4)
//.setAttrWithMinzoom("bridge", sf.getString("bridge"), 12)
//.setAttrWithMinzoom("tunnel", sf.getString("tunnel"), 12)
.setAttrWithMinzoom("layer", sf.getString("layer"), 12)
.setAttrWithMinzoom("layer", Parse.parseIntOrNull(sf.getString("layer")), 12)
.setZoomRange(minZoom, 15);

// Add less common core Tilezen attributes only at higher zooms (will continue to v4)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.onthegomap.planetiler.geo.GeoUtils;
import com.onthegomap.planetiler.geo.GeometryException;
import com.onthegomap.planetiler.reader.SourceFeature;
import com.onthegomap.planetiler.util.Parse;
import com.protomaps.basemap.feature.FeatureId;
import com.protomaps.basemap.names.NeNames;
import com.protomaps.basemap.names.OsmNames;
Expand Down Expand Up @@ -201,7 +202,7 @@ public void processFeature(SourceFeature sf, FeatureCollector features) {
// Add less common core Tilezen attributes only at higher zooms (will continue to v4)
.setAttrWithMinzoom("bridge", sf.getString("bridge"), 12)
.setAttrWithMinzoom("tunnel", sf.getString("tunnel"), 12)
.setAttrWithMinzoom("layer", sf.getString("layer"), 12)
.setAttrWithMinzoom("layer", Parse.parseIntOrNull(sf.getString("layer")), 12)
.setZoomRange(nameMinZoom, 15)
.setBufferPixels(128);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.onthegomap.planetiler.ForwardingProfile;
import com.onthegomap.planetiler.VectorTile;
import com.onthegomap.planetiler.reader.SourceFeature;
import com.onthegomap.planetiler.util.Parse;
import com.protomaps.basemap.feature.FeatureId;
import com.protomaps.basemap.names.OsmNames;
import java.util.List;
Expand Down Expand Up @@ -80,7 +81,7 @@ public void processFeature(SourceFeature sf, FeatureCollector features) {
// Used for client-side label collisions
.setAttr("pmap:min_zoom", minZoom + 1)
// Core OSM tags for different kinds of places
.setAttr("layer", sf.getString("layer"))
.setAttr("layer", Parse.parseIntOrNull(sf.getString("layer")))
.setAttr("network", sf.getString("network"))
.setAttr("ref", sf.getString("ref"))
.setAttr("route", sf.getString("route"))
Expand Down
3 changes: 2 additions & 1 deletion tiles/src/main/java/com/protomaps/basemap/layers/Water.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.onthegomap.planetiler.VectorTile;
import com.onthegomap.planetiler.geo.GeometryException;
import com.onthegomap.planetiler.reader.SourceFeature;
import com.onthegomap.planetiler.util.Parse;
import com.protomaps.basemap.postprocess.Area;
import java.util.List;
import org.locationtech.jts.geom.Envelope;
Expand Down Expand Up @@ -145,7 +146,7 @@ public void processFeature(SourceFeature sf, FeatureCollector features) {
// Add less common attributes only at higher zooms
.setAttrWithMinzoom("bridge", sf.getString("bridge"), 12)
.setAttrWithMinzoom("tunnel", sf.getString("tunnel"), 12)
.setAttrWithMinzoom("layer", sf.getString("layer"), 12)
.setAttrWithMinzoom("layer", Parse.parseIntOrNull(sf.getString("layer")), 12)
// DEPRECATION WARNING: Marked for deprecation in v4 schema, do not use these for styling
// If an explicate value is needed it should bea kind, or included in kind_detail
.setAttr("natural", sf.getString("natural"))
Expand Down

0 comments on commit 2d6d000

Please sign in to comment.