mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 21:48:20 +02:00
Don't copy building part or indoor tags to node when extracting point from a way or relation (close #7862)
This commit is contained in:
@@ -50,7 +50,18 @@ export function actionExtract(entityID) {
|
||||
extractedLoc = entity.extent(graph).center();
|
||||
}
|
||||
|
||||
var isBuilding = entity.tags.building && entity.tags.building !== 'no';
|
||||
var indoorAreaValues = {
|
||||
area: true,
|
||||
corridor: true,
|
||||
elevator: true,
|
||||
level: true,
|
||||
room: true
|
||||
};
|
||||
|
||||
var isBuilding = (entity.tags.building && entity.tags.building !== 'no') ||
|
||||
(entity.tags['building:part'] && entity.tags['building:part'] !== 'no');
|
||||
|
||||
var isIndoorArea = fromGeometry === 'area' && entity.tags.indoor && indoorAreaValues[entity.tags.indoor];
|
||||
|
||||
var entityTags = Object.assign({}, entity.tags); // shallow copy
|
||||
var pointTags = {};
|
||||
@@ -71,6 +82,10 @@ export function actionExtract(entityID) {
|
||||
key.match(/^building:.{1,}/) ||
|
||||
key.match(/^roof:.{1,}/)) continue;
|
||||
}
|
||||
// leave `indoor` tag on the area
|
||||
if (isIndoorArea && key === 'indoor') {
|
||||
continue;
|
||||
}
|
||||
|
||||
// copy the tag from the entity to the point
|
||||
pointTags[key] = entityTags[key];
|
||||
@@ -79,13 +94,16 @@ export function actionExtract(entityID) {
|
||||
if (keysToCopyAndRetain.indexOf(key) !== -1 ||
|
||||
key.match(/^addr:.{1,}/)) {
|
||||
continue;
|
||||
} else if (isIndoorArea && key === 'level') {
|
||||
// leave `level` on both features
|
||||
continue;
|
||||
}
|
||||
|
||||
// remove the tag from the entity
|
||||
delete entityTags[key];
|
||||
}
|
||||
|
||||
if (!isBuilding && fromGeometry === 'area') {
|
||||
if (!isBuilding && !isIndoorArea && fromGeometry === 'area') {
|
||||
// ensure that areas keep area geometry
|
||||
entityTags.area = 'yes';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user