Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
bdon committed Apr 6, 2024
1 parent bd07d83 commit 48b2050
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
5 changes: 3 additions & 2 deletions tiles/src/main/java/com/protomaps/basemap/Basemap.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import com.protomaps.basemap.layers.Boundaries;
import com.protomaps.basemap.layers.Buildings;
import com.protomaps.basemap.layers.Earth;
import com.protomaps.basemap.layers.Landuse;
import com.protomaps.basemap.layers.Landcover;
import com.protomaps.basemap.layers.Landuse;
import com.protomaps.basemap.layers.Natural;
import com.protomaps.basemap.layers.PhysicalLine;
import com.protomaps.basemap.layers.PhysicalPoint;
Expand Down Expand Up @@ -133,7 +133,8 @@ static void run(Arguments args) throws Exception {
"https://osmdata.openstreetmap.de/download/water-polygons-split-3857.zip")
.addShapefileSource("osm_land", sourcesDir.resolve("land-polygons-split-3857.zip"),
"https://osmdata.openstreetmap.de/download/land-polygons-split-3857.zip")
.addGeoPackageSource("landcover", sourcesDir.resolve("daylight-landcover.gpkg"), "https://r2-public.protomaps.com/datasets/daylight-landcover.gpkg");
.addGeoPackageSource("landcover", sourcesDir.resolve("daylight-landcover.gpkg"),
"https://r2-public.protomaps.com/datasets/daylight-landcover.gpkg");

// Downloader.create(planetiler.config()).add("ne", neUrl, nePath)
// .add("qrank", "https://qrank.wmcloud.org/download/qrank.csv.gz", sourcesDir.resolve("qrank.csv.gz")).run();
Expand Down
19 changes: 12 additions & 7 deletions tiles/src/main/java/com/protomaps/basemap/layers/Landcover.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,24 @@
import com.onthegomap.planetiler.geo.GeometryException;
import com.onthegomap.planetiler.reader.SourceFeature;
import com.protomaps.basemap.feature.FeatureId;

import java.util.List;

public class Landcover implements ForwardingProfile.FeaturePostProcessor {

public void processLandcover(SourceFeature sf, FeatureCollector features) {
String kind = sf.getString("class");
if (kind.equals("urban")) kind = "urban_area";
if (kind.equals("crop")) kind = "farmland";
if (kind.equals("grass")) kind = "grassland";
if (kind.equals("trees")) kind = "forest";
if (kind.equals("snow")) kind = "glacier";
if (kind.equals("shrub")) kind = "scrub";
if (kind.equals("urban"))
kind = "urban_area";
if (kind.equals("crop"))
kind = "farmland";
if (kind.equals("grass"))
kind = "grassland";
if (kind.equals("trees"))
kind = "forest";
if (kind.equals("snow"))
kind = "glacier";
if (kind.equals("shrub"))
kind = "scrub";
// barren is passed through

features.polygon(this.name())
Expand Down

0 comments on commit 48b2050

Please sign in to comment.