Fix TravelObfHelper getPointList()

This commit is contained in:
Dima-1 2021-01-11 18:03:11 +02:00
parent 0c6803533c
commit c01db4853f

View file

@ -217,9 +217,9 @@ public class TravelObfHelper implements TravelHelper {
@Override
public boolean publish(Amenity amenity) {
String amenityLang = amenity.getTagSuffix(Amenity.LANG_YES + ":");
if (lang != null && lang.equals(amenityLang)
&& Algorithms.stringsEqual(article.routeId, Algorithms.emptyIfNull(amenity.getTagContent(Amenity.ROUTE_ID, null)))
&& Algorithms.stringsEqual(article.routeSource, Algorithms.emptyIfNull(amenity.getTagContent(Amenity.ROUTE_SOURCE, null)))) {
if (Algorithms.stringsEqual(lang, amenityLang)
&& Algorithms.stringsEqual(article.routeId,
Algorithms.emptyIfNull(amenity.getTagContent(Amenity.ROUTE_ID, null)))) {
pointList.add(amenity);
}
return false;
@ -231,16 +231,11 @@ public class TravelObfHelper implements TravelHelper {
}
}, null);
if (!Double.isNaN(article.lat)) {
req.setBBoxRadius(article.lat, article.lon, ARTICLE_SEARCH_RADIUS);
if (!Algorithms.isEmpty(article.title)) {
reader.searchPoiByName(req);
} else {
reader.searchPoi(req);
}
} else {
reader.searchPoi(req);
}
} catch (Exception e) {
LOG.error(e.getMessage(), e);
}