Skip to content
Commits on Source (4)
mkgmap-splitter (0.0.0+svn591-5) UNRELEASED; urgency=medium
mkgmap-splitter (0.0.0+svn592-1) unstable; urgency=medium
* New upstream SVN snapshot.
* Bump Standards-Version to 4.3.0, no changes.
-- Bas Couwenberg <sebastic@debian.org> Tue, 25 Dec 2018 22:40:03 +0100
-- Bas Couwenberg <sebastic@debian.org> Tue, 01 Jan 2019 10:59:19 +0100
mkgmap-splitter (0.0.0+svn591-4) unstable; urgency=medium
......
svn.version: 591
build.timestamp: 2018-03-09T14:31:20+0000
svn.version: 592
build.timestamp: 2018-12-13T08:19:25+0000
......@@ -55,6 +55,7 @@ class ProblemListProcessor extends AbstractMapProcessor {
private final HashSet<String> wantedBoundaryAdminLevels = new HashSet<>();
private final HashSet<String> wantedBoundaryTagValues;
private final HashSet<String> wantedRouteTagValues;
ProblemListProcessor(DataStorer dataStorer, int areaOffset,
int numAreasThisPass, SplitterParams mainOptions) {
......@@ -83,6 +84,13 @@ class ProblemListProcessor extends AbstractMapProcessor {
wantedBoundaryTagValues = new HashSet<>(Arrays.asList(boundaryTags));
}
setWantedAdminLevel(mainOptions.getWantedAdminLevel());
String routeRelationValuesParm = mainOptions.getRouteRelValues();
if (routeRelationValuesParm.isEmpty()) {
wantedRouteTagValues = null;
} else {
String[] routeValues = routeRelationValuesParm.split(Pattern.quote(","));
wantedRouteTagValues = new HashSet<>(Arrays.asList(routeValues));
}
}
public void setWantedAdminLevel(int adminLevel) {
......@@ -205,6 +213,8 @@ class ProblemListProcessor extends AbstractMapProcessor {
boolean isMPRelType = false;
boolean hasBoundaryTag = false;
boolean isWantedBoundary = (wantedBoundaryTagValues == null) ? true:false;
boolean isRouteRelType = false;
boolean isWantedRoute = (wantedRouteTagValues == null) ? false : true;
Iterator<Element.Tag> tags = rel.tagsIterator();
String admin_level = null;
while(tags.hasNext()) {
......@@ -214,6 +224,8 @@ class ProblemListProcessor extends AbstractMapProcessor {
useThis= true; // no need to check other tags
else if ("multipolygon".equals((t.value)) || "boundary".equals((t.value)))
isMPRelType= true;
else if ("route".equals(t.value))
isRouteRelType = true;
else if ("associatedStreet".equals((t.value)) || "street".equals((t.value)))
useThis= true; // no need to check other tags
} else if ("boundary".equals(t.key)){
......@@ -228,7 +240,12 @@ class ProblemListProcessor extends AbstractMapProcessor {
} else if ("admin_level".equals(t.key)){
admin_level = t.value;
}
if ("route".equals((t.value))) {
if (wantedRouteTagValues != null) {
if (wantedRouteTagValues.contains(t.value))
isWantedRoute = true;
}
}
if (useThis)
break;
}
......@@ -237,7 +254,8 @@ class ProblemListProcessor extends AbstractMapProcessor {
else if (isMPRelType && hasBoundaryTag && admin_level != null){
if (wantedBoundaryAdminLevels.contains(admin_level))
useThis = true;
}
} else if (isRouteRelType && isWantedRoute)
useThis = true;
if (!useThis){
return;
}
......
......@@ -113,7 +113,6 @@ public interface SplitterParams {
int getWantedAdminLevel();
@Option(defaultValue = "200000", description = "Search limit in split algo. Higher values may find better splits, but will take longer.")
int getSearchLimit();
......@@ -123,4 +122,8 @@ public interface SplitterParams {
@Option(defaultValue = "false", description = "Specify if splitter should ignore bounds tags in input files")
boolean getIgnoreOsmBounds();
@Option(defaultValue="", description = "A comma separated list of tag values for route relations. "
+ "Can be used to keep route relations of the given type complete. Only route values listed are kept complete. Default is empty.")
String getRouteRelValues();
}