up has address logic on set of tags

This commit is contained in:
Tykayn 2025-11-25 23:08:45 +01:00 committed by tykayn
parent 6560b20f16
commit b323c2fe9f

View file

@ -285,10 +285,25 @@ class Place
$this->setHasOpeningHours(!empty($tags['opening_hours']));
$this->setHasWheelchair(!empty($tags['wheelchair']));
// has address logic
// has address logic, we set it as complete if there is a set of street AND housenumber in tags, it could be with addr prefix or contact prefix.
$this->setHasAddress(
!empty($this->getStreet()) && !empty($this->getHousenumber())
||
(
isset($tags['addr:street']) &&
isset($tags['addr:housenumber']) &&
$tags['addr:street'] != '' &&
$tags['addr:housenumber'] != ''
)
||
(
isset($tags['contact:street']) &&
isset($tags['contact:housenumber']) &&
$tags['contact:street'] != '' &&
$tags['contact:housenumber'] != ''
)
$this->setHasAddress(!empty($this->getStreet()) && !empty($this->getHousenumber())
| (isset($tags['addr:street']) && isset($tags['addr:housenumber'])));
);
// has website logic (with multiple possible tags)
$websiteTags = ['website', 'contact:website', 'url', 'contact:url'];