mirror of
https://github.com/cfpwastaken/planetiler-openmaptiles.git
synced 2026-02-04 20:41:09 +00:00
Set feature IDs in boundary and agg_stop features. (#148)
This commit is contained in:
@@ -176,7 +176,8 @@ public class Poi implements
|
||||
private void processAggStop(Tables.OsmPoiPoint element, FeatureCollector.Factory featureCollectors,
|
||||
Consumer<FeatureCollector.Feature> emit, Integer aggStop) {
|
||||
try {
|
||||
var features = featureCollectors.get(SimpleFeature.fromWorldGeometry(element.source().worldGeometry()));
|
||||
var features =
|
||||
featureCollectors.get(SimpleFeature.fromWorldGeometry(element.source().worldGeometry(), element.source().id()));
|
||||
setupPoiFeature(element, features.point(LAYER_NAME), aggStop);
|
||||
for (var feature : features) {
|
||||
emit.accept(feature);
|
||||
@@ -209,7 +210,6 @@ public class Poi implements
|
||||
processAggStop(aggStopSet.getFirst(), featureCollectors, emit, 1);
|
||||
continue;
|
||||
}
|
||||
|
||||
Tables.OsmPoiPoint nearest = null;
|
||||
try {
|
||||
// find most important stops based on subclass
|
||||
@@ -228,7 +228,8 @@ public class Poi implements
|
||||
double minDistance = Double.MAX_VALUE;
|
||||
for (var aggStop : topAggStops) {
|
||||
double distance = aggStopCentroid.distance(aggStop.source().worldGeometry());
|
||||
if (distance < minDistance) {
|
||||
if (distance < minDistance || nearest == null ||
|
||||
(distance == minDistance && aggStop.source().id() < nearest.source().id())) {
|
||||
minDistance = distance;
|
||||
nearest = aggStop;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user