Skip to content

Commit

Permalink
Bumping atlas version (osmlab#482)
Browse files Browse the repository at this point in the history
* Bumping atlas version

* fix build breakers from new atlas version

Co-authored-by: Sean Coulter <[email protected]>
  • Loading branch information
ameliaewatts and Sean Coulter authored Jan 27, 2021
1 parent c22774a commit 84557d4
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 12 deletions.
2 changes: 1 addition & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
project.ext.versions = [
checkstyle: '8.18',
jacoco: '0.8.3',
atlas: '6.3.4',
atlas: '6.4.0',
commons:'2.6',
atlas_generator: '5.2.3',
atlas_checkstyle: '5.6.9',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.openstreetmap.atlas.checks.distributed;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
Expand All @@ -9,6 +10,7 @@
import java.util.stream.Collectors;

import org.apache.hadoop.fs.PathFilter;
import org.locationtech.jts.geom.Polygon;
import org.openstreetmap.atlas.checks.atlas.CountrySpecificAtlasFilePathFilter;
import org.openstreetmap.atlas.checks.atlas.OsmPbfFilePathFilter;
import org.openstreetmap.atlas.generator.tools.spark.utilities.SparkFileHelper;
Expand All @@ -19,8 +21,9 @@
import org.openstreetmap.atlas.geography.atlas.multi.MultiAtlas;
import org.openstreetmap.atlas.geography.atlas.pbf.AtlasLoadingOption;
import org.openstreetmap.atlas.geography.atlas.raw.creation.RawAtlasGenerator;
import org.openstreetmap.atlas.geography.atlas.raw.sectioning.WaySectionProcessor;
import org.openstreetmap.atlas.geography.atlas.raw.sectioning.AtlasSectionProcessor;
import org.openstreetmap.atlas.geography.boundary.CountryBoundaryMap;
import org.openstreetmap.atlas.geography.converters.jts.JtsMultiPolygonConverter;
import org.openstreetmap.atlas.streaming.resource.FileSuffix;
import org.openstreetmap.atlas.streaming.resource.Resource;
import org.openstreetmap.atlas.utilities.configuration.Configuration;
Expand Down Expand Up @@ -205,10 +208,12 @@ private Logger getLogger()
private Atlas loadPbf(final Resource input, final String country)
{
// Setting the CountryBoundaryMap to the polygon boundary
final List<Polygon> boundaries = new ArrayList<>(
new JtsMultiPolygonConverter().convert(this.polygon));
final CountryBoundaryMap map = CountryBoundaryMap
.fromBoundaryMap(Collections.singletonMap(country, this.polygon));
.fromBoundaryMap(Collections.singletonMap(country, boundaries));
final AtlasLoadingOption option = AtlasLoadingOption.createOptionWithAllEnabled(map);
final Atlas raw = new RawAtlasGenerator(input, option, this.polygon).build();
return new WaySectionProcessor(raw, option).run();
return new AtlasSectionProcessor(raw, option).run();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import org.openstreetmap.atlas.geography.geojson.parser.domain.feature.FeatureCollection;
import org.openstreetmap.atlas.geography.geojson.parser.domain.geometry.MultiPolygon;
import org.openstreetmap.atlas.geography.geojson.parser.domain.geometry.Point;
import org.openstreetmap.atlas.geography.geojson.parser.impl.gson.GeoJsonParserGsonImpl;
import org.openstreetmap.atlas.geography.geojson.parser.impl.jackson.GeoJsonParserJacksonImpl;

import com.google.common.collect.Lists;
import com.google.gson.Gson;
Expand All @@ -66,7 +66,7 @@ public class CheckFlagDeserializer implements JsonDeserializer<CheckFlag>
private static final String POSITION = "position";
private static final String AFTER_VIEW = "afterView";

private static final GeoJsonParser GEOJSON_PARSER_GSON = GeoJsonParserGsonImpl.instance;
private static final GeoJsonParser GEOJSON_PARSER_JACKSON = GeoJsonParserJacksonImpl.INSTANCE;
private static final Gson GSON = new Gson();
private static final WKTReader WKT_READER = new WKTReader();
private static final JtsCoordinateArrayConverter COORDINATE_ARRAY_CONVERTER = new JtsCoordinateArrayConverter();
Expand Down Expand Up @@ -114,7 +114,7 @@ public CheckFlag deserialize(final JsonElement json, final Type typeOfT,
flag.addInstructions(instructions);
flag.setChallengeName(checkName);

final GeoJsonItem geojsonItem = GEOJSON_PARSER_GSON.deserialize(GSON.toJson(json));
final GeoJsonItem geojsonItem = GEOJSON_PARSER_JACKSON.deserialize(GSON.toJson(json));

// This should never be the case
if (!(geojsonItem instanceof FeatureCollection))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@ private static Relation convertRelation(final Feature feature)
{
final Map<String, Object> memberMap = (Map<String, Object>) member;
members.add(new RelationBean.RelationBeanItem(
((Double) memberMap.get(GeoJsonUtils.IDENTIFIER)).longValue(),
memberMap.get(GeoJsonUtils.IDENTIFIER) instanceof Integer
? Long.valueOf((Integer) memberMap.get(GeoJsonUtils.IDENTIFIER))
: (Long) memberMap.get(GeoJsonUtils.IDENTIFIER),
(String) memberMap.get("role"),
ItemType.valueOf((String) memberMap.get(GeoJsonUtils.ITEM_TYPE))));
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
import org.openstreetmap.atlas.tags.JunctionTag;
import org.openstreetmap.atlas.tags.LayerTag;
import org.openstreetmap.atlas.tags.LevelTag;
import org.openstreetmap.atlas.tags.OneWayTag;
import org.openstreetmap.atlas.tags.RelationTypeTag;
import org.openstreetmap.atlas.tags.oneway.OneWayTag;
import org.openstreetmap.atlas.utilities.collections.Iterables;
import org.openstreetmap.atlas.utilities.collections.StringList;
import org.openstreetmap.atlas.utilities.configuration.Configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
import org.openstreetmap.atlas.geography.atlas.items.Edge;
import org.openstreetmap.atlas.tags.FootTag;
import org.openstreetmap.atlas.tags.HighwayTag;
import org.openstreetmap.atlas.tags.OneWayTag;
import org.openstreetmap.atlas.tags.SidewalkTag;
import org.openstreetmap.atlas.tags.annotations.validation.Validators;
import org.openstreetmap.atlas.tags.names.NameTag;
import org.openstreetmap.atlas.tags.oneway.OneWayTag;
import org.openstreetmap.atlas.utilities.configuration.Configuration;
import org.openstreetmap.atlas.utilities.direction.EdgeDirectionComparator;
import org.slf4j.Logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
import org.openstreetmap.atlas.geography.atlas.walker.OsmWayWalker;
import org.openstreetmap.atlas.tags.HighwayTag;
import org.openstreetmap.atlas.tags.JunctionTag;
import org.openstreetmap.atlas.tags.OneWayTag;
import org.openstreetmap.atlas.tags.annotations.validation.Validators;
import org.openstreetmap.atlas.tags.oneway.OneWayTag;
import org.openstreetmap.atlas.utilities.configuration.Configuration;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ public void innerOuterOverlapTest()
{
this.verifyCheck(this.setup.innerOuterOverlapAtlas(),
ConfigurationResolver.emptyConfiguration(), 1,
Collections.singletonList(String.format(PARTIAL_OVERLAP_INSTRUCTION, "1")));
Collections.singletonList(
String.format(referenceDefaultLocaleCheck.getLocalizedInstruction(
InvalidMultiPolygonRelationCheck.INNER_MISSING_OUTER_INSTRUCTION_FORMAT_INDEX,
1), "1")));
}

@Test
Expand Down

0 comments on commit 84557d4

Please sign in to comment.