Set feature IDs in boundary and agg_stop features. (#148)

This commit is contained in:
Michael Barry
2024-01-15 11:54:51 -05:00
committed by GitHub
parent 1e60f45639
commit f038d69af1
2 changed files with 8 additions and 5 deletions

View File

@@ -269,6 +269,7 @@ public class Boundary implements
// save for later
try {
CountryBoundaryComponent component = new CountryBoundaryComponent(
feature.id(),
minAdminLevel,
disputed,
maritime,
@@ -323,7 +324,7 @@ public class Boundary implements
if (merged instanceof LineString lineString) {
BorderingRegions borderingRegions = getBorderingRegions(countryBoundaries, key.regions, lineString);
var features = featureCollectors.get(SimpleFeature.fromWorldGeometry(lineString));
var features = featureCollectors.get(SimpleFeature.fromWorldGeometry(lineString, key.id));
var newFeature = features.line(LAYER_NAME).setBufferPixels(BUFFER_SIZE)
.setAttr(Fields.ADMIN_LEVEL, key.adminLevel)
.setAttr(Fields.DISPUTED, key.disputed ? 1 : 0)
@@ -471,6 +472,7 @@ public class Boundary implements
* Information to hold onto from processing a way in a boundary relation to determine the left/right region ID later.
*/
private record CountryBoundaryComponent(
long id,
int adminLevel,
boolean disputed,
boolean maritime,
@@ -482,7 +484,7 @@ public class Boundary implements
) {
CountryBoundaryComponent groupingKey() {
return new CountryBoundaryComponent(adminLevel, disputed, maritime, minzoom, null, regions, claimedBy, name);
return new CountryBoundaryComponent(id, adminLevel, disputed, maritime, minzoom, null, regions, claimedBy, name);
}
}
}