Skip to content

Commit

Permalink
Merge pull request #45 from govlt/boundaries-optimization
Browse files Browse the repository at this point in the history
Boundaries optimization
  • Loading branch information
vycius authored Apr 15, 2024
2 parents 42df546 + 2fdf305 commit 7e756e3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions vector/src/main/java/lt/lrv/basemap/layers/Boundary.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,22 @@ public void processFeature(SourceFeature sf, FeatureCollector features) {
var code = sf.getString("GKODAS");

switch (code) {
case "as1", "fas1" -> addBoundaryFeature(2, sf, features);
case "as2" -> addBoundaryFeature(4, sf, features);
case "as3" -> addBoundaryFeature(5, sf, features);
case "as51" -> addBoundaryFeature(8, sf, features);
case "as1" -> addBoundaryFeature(2, 0, sf, features);
case "as2" -> addBoundaryFeature(4, 5, sf, features);
case "as3" -> addBoundaryFeature(5, 8, sf, features);
case "as51" -> addBoundaryFeature(8, 10, sf, features);
}
}
}

void addBoundaryFeature(int adminLevel, SourceFeature sf, FeatureCollector features) {
void addBoundaryFeature(int adminLevel, int minZoom, SourceFeature sf, FeatureCollector features) {
features.line(this.name())
.setBufferPixels(BUFFER_SIZE)
.setAttr(Fields.ADMIN_LEVEL, adminLevel)
.setAttr(Fields.DISPUTED, 0)
// TODO determine if border is maritime or not
.setAttr(Fields.MARITIME, 0)
.setMinZoom(minZoom)
.putAttrs(LanguageUtils.getNames(sf.tags()));
}

Expand Down

0 comments on commit 7e756e3

Please sign in to comment.