@Override protected boolean isCounted(final Edge edge) { return edge.containsKey(REF_KEYS); }
@Override protected boolean isCounted(final Edge edge) { if (edge.containsKey(EXACT_MATCHES)) { return true; } if (edge.containsKeyStartsWith(START_WITH_MATCHES)) { return true; } for (final Relation relation : edge.relations()) { final Map<String, String> tags = relation.getTags(); if (tags.containsKey("type") && "route".equals(tags.get("type")) && tags.containsKey("route") && "road".equals(tags.get("route"))) { if (relation.containsKey(RELATION_EXACT_MATCHES)) { return true; } if (relation.containsKeyStartsWith(RELATION_START_WITH_MATCHES)) { return true; } } } return false; }
@Test public void testNoSlicingNoRelationsConversion() { final File temp = File.temporaryFolder(); try { // Run OsmPbfToAtlasSubCommand final String[] args = { "pbf-to-atlas", String.format("-pbf=%s", PBF), String.format("-output=%s/%s", temp, ATLAS_NAME), String.format("-country-boundary-map=%s", COUNTRY_BOUNDARY_MAP_TEXT), "-country-codes=NAM,EUR", "-country-slicing=false", "-load-relations=false" }; new AtlasReader(args).runWithoutQuitting(args); // Load new atlas final Atlas atlas = new AtlasResourceLoader() .load(new File(String.format("%s/%s", temp, ATLAS_NAME))); // Test for country slicing Assert.assertFalse(atlas.edge(87185039000000L) .containsKey(Collections.singleton("iso_country_code"))); // Test no load relation Assert.assertFalse(atlas.relations().iterator().hasNext()); } finally { temp.deleteRecursively(); } }