Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify code and remove area filter for water features [#198] #215

Merged
merged 5 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Tiles v3.3.0
------
- Improve water generalization detail by doing area filtering post-merge [#198]

Tiles v3.2.0
------
- Add `village_green` and `allotments` to landuse layer via @lenalebt [#206]
Expand Down
14 changes: 14 additions & 0 deletions app/src/examples.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,19 @@
"tags": ["boundaries"],
"center": [37.382, -1.592],
"zoom": 7
},
{
"name": "colombia-rivers",
"description": "water features west of Bogota should not be broken",
"tags": ["water"],
"center": [-74.422, 4.62],
"zoom": 7.8
},
{
"name": "river-thames",
"description": "River Thames should not have pieces missing",
"tags": ["water"],
"center": [-0.3, 51.4],
"zoom": 8.9
}
]
2 changes: 1 addition & 1 deletion tiles/src/main/java/com/protomaps/basemap/Basemap.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public String description() {

@Override
public String version() {
return "3.2.0";
return "3.3.0";
}

@Override
Expand Down
13 changes: 1 addition & 12 deletions tiles/src/main/java/com/protomaps/basemap/layers/Water.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
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;

public class Water implements ForwardingProfile.FeatureProcessor, ForwardingProfile.FeaturePostProcessor {
Expand Down Expand Up @@ -144,7 +143,7 @@ public void processFeature(SourceFeature sf, FeatureCollector features) {
.setAttr("water", sf.getString("water"))
.setAttr("waterway", sf.getString("waterway"))
.setZoomRange(6, 15)
.setMinPixelSize(3.0)
.setMinPixelSize(1.0)
.setBufferPixels(8);

// Core Tilezen schema properties
Expand All @@ -168,16 +167,6 @@ public void processFeature(SourceFeature sf, FeatureCollector features) {

@Override
public List<VectorTile.Feature> postProcess(int zoom, List<VectorTile.Feature> items) throws GeometryException {
if (zoom == 15)
return items;

int minArea = 400 / (4096 * 4096) * (256 * 256);
if (zoom == 6)
minArea = 600 / (4096 * 4096) * (256 * 256);
else if (zoom <= 5)
minArea = 800 / (4096 * 4096) * (256 * 256);
items = Area.filterArea(items, minArea);

return FeatureMerge.mergeOverlappingPolygons(items, 1);
}
}
Loading