Skip to content

Commit

Permalink
tileset: fix population parsing of commas. (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdon authored Jun 2, 2023
1 parent f802d0d commit a3c55e5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tiles/src/main/java/com/protomaps/basemap/layers/Places.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.protomaps.basemap.layers;

import static com.onthegomap.planetiler.util.Parse.parseIntOrNull;

import com.onthegomap.planetiler.FeatureCollector;
import com.onthegomap.planetiler.ForwardingProfile;
import com.onthegomap.planetiler.VectorTile;
Expand Down Expand Up @@ -78,7 +80,7 @@ public void processFeature(SourceFeature sf, FeatureCollector features) {
if (sf.isPoint() &&
(sf.hasTag("place", "suburb", "town", "village", "neighbourhood", "city", "country", "state", "province"))) {
Integer population =
sf.getString("population") == null ? 0 : (int) Double.parseDouble(sf.getString("population"));
sf.getString("population") == null ? 0 : parseIntOrNull(sf.getString("population"));
var feat = features.point(this.name())
.setId(FeatureId.create(sf))
.setAttr("place", sf.getString("place"))
Expand Down

0 comments on commit a3c55e5

Please sign in to comment.