@Override
  public void processFeature(SourceFeature sourceFeature, FeatureCollector features) {
    if (sourceFeature.isPoint() && sourceFeature.hasTag("amenity", "toilets")) {
      features.point("toilets")
        .setZoomRange(0, 14)
        // to limit toilets displayed at lower zoom levels:
        // 1) set a sort key that defines a priority ordering of toilets. For mountains, you might use "elevation"
        // but for toilets we just set it to the order in which we see them.
        .setSortKey(toiletNumber.incrementAndGet())
        // 2) at lower zoom levels, divide each 256x256 px tile into 32x32 px squares and in each square only include
        // the toilets with the lowest sort key within that square
        .setPointLabelGridSizeAndLimit(
          12, // only limit at z12 and below
          32, // break the tile up into 32x32 px squares
          4 // any only keep the 4 nodes with lowest sort-key in each 32px square
        )
        // and also whenever you set a label grid size limit, make sure you increase the buffer size so no
        // label grid squares will be the consistent between adjacent tiles
        .setBufferPixelOverrides(ZoomFunction.maxZoom(12, 32));
    }
  }
Builds a map of toilets from OpenStreetMap nodes tagged with
<a href="https://wiki.openstreetmap.org/wiki/Tag:amenity%3Dtoilets">amenity=toilets</a>.
<p>
To run this example:
<ol>
<li>Download a .osm.pbf extract (see <a href="https://download.geofabrik.de/">Geofabrik download site</a></li>
<li>then build the examples: {@code mvn clean package}</li>
<li>then run this example:
{@code java -cp target/*-fatjar.jar com.onthegomap.planetiler.examples.ToiletsOverlay osm_path="path/to/data.osm.pbf" mbtiles="data/output.mbtiles"}</li>
<li>then run the demo tileserver: {@code tileserver-gl-light data/output.mbtiles}</li>
<li>and view the output at <a href="http://localhost:8080">localhost:8080</a></li>
</ol>
planetiler-examples/src/main/java/com/onthegomap/planetiler/examples/ToiletsOverlay.java