Skip to content

Commit

Permalink
improvement: teryt: show additional unknown digit of terc code as 'x'…
Browse files Browse the repository at this point in the history
… character
  • Loading branch information
chilek committed Feb 15, 2023
1 parent b3118a0 commit 0d3e0fa
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bin/lms-teryt.php
Original file line number Diff line number Diff line change
Expand Up @@ -1448,9 +1448,9 @@ function stream_notification_callback($notification_code, $severity, $message, $
$v['NUMER'] = preg_replace('/\.$/', '', dbf_to_utf8($v['NUMER']));
if (!preg_match('#^[0-9a-zA-Z-, /\pL]*$#u', $v['NUMER'])) {
if (strlen($simc)) {
fwrite($stderr, 'Warning: house number contains incorrect characters (TERC: ' . $terc . ', SIMC: ' . $simc . ', CITY: ' . $address['SIMC_NAZWA'] . ', ULIC: ' . $ulic . ', STREET: ' . $address['ULIC_NAZWA'] . ', NR: ' . $v['NUMER'] . ')!' . PHP_EOL);
fwrite($stderr, 'Warning: house number contains incorrect characters (TERC: ' . $terc . 'x, SIMC: ' . $simc . ', CITY: ' . $address['SIMC_NAZWA'] . ', ULIC: ' . $ulic . ', STREET: ' . $address['ULIC_NAZWA'] . ', NR: ' . $v['NUMER'] . ')!' . PHP_EOL);
} else {
fwrite($stderr, 'Warning: house number contains incorrect characters (TERC: ' . $terc . ', SIMC: ' . $simc . ', CITY: ' . $address['SIMC_NAZWA'] . ', NR: ' . $v['NUMER'] . ')!' . PHP_EOL);
fwrite($stderr, 'Warning: house number contains incorrect characters (TERC: ' . $terc . 'x, SIMC: ' . $simc . ', CITY: ' . $address['SIMC_NAZWA'] . ', NR: ' . $v['NUMER'] . ')!' . PHP_EOL);
}
continue;
}
Expand All @@ -1459,9 +1459,9 @@ function stream_notification_callback($notification_code, $severity, $message, $

if (!$city) {
if (strlen($simc)) {
fwrite($stderr, 'Warning: building was not found in TERYT database (TERC: ' . $terc . ', SIMC: ' . $simc . ', CITY: ' . $address['SIMC_NAZWA'] . ', ULIC: ' . $ulic . ', STREET: ' . $address['ULIC_NAZWA'] . ', NR: ' . $v['NUMER'] . ')!' . PHP_EOL);
fwrite($stderr, 'Warning: building was not found in TERYT database (TERC: ' . $terc . 'x, SIMC: ' . $simc . ', CITY: ' . $address['SIMC_NAZWA'] . ', ULIC: ' . $ulic . ', STREET: ' . $address['ULIC_NAZWA'] . ', NR: ' . $v['NUMER'] . ')!' . PHP_EOL);
} else {
fwrite($stderr, 'Warning: building was not found in TERYT database (TERC: ' . $terc . ', SIMC: ' . $simc . ', CITY: ' . $address['SIMC_NAZWA'] . ', NR: ' . $v['NUMER'] . ')!' . PHP_EOL);
fwrite($stderr, 'Warning: building was not found in TERYT database (TERC: ' . $terc . 'x, SIMC: ' . $simc . ', CITY: ' . $address['SIMC_NAZWA'] . ', NR: ' . $v['NUMER'] . ')!' . PHP_EOL);
}
continue;
}
Expand All @@ -1471,7 +1471,7 @@ function stream_notification_callback($notification_code, $severity, $message, $
} else {
$street = $location_cache->getStreetByIdent($city['id'], $ulic);
if (empty($street)) {
fwrite($stderr, 'Warning: building was not found in TERYT database (TERC: ' . $terc . ', SIMC: ' . $simc . ', CITY: ' . $address['SIMC_NAZWA'] . ', ULIC: ' . $ulic . ', STREET: ' . $address['ULIC_NAZWA'] . ', NR: ' . $v['NUMER'] . ')!' . PHP_EOL);
fwrite($stderr, 'Warning: building was not found in TERYT database (TERC: ' . $terc . 'x, SIMC: ' . $simc . ', CITY: ' . $address['SIMC_NAZWA'] . ', ULIC: ' . $ulic . ', STREET: ' . $address['ULIC_NAZWA'] . ', NR: ' . $v['NUMER'] . ')!' . PHP_EOL);
continue;
}
}
Expand Down

0 comments on commit 0d3e0fa

Please sign in to comment.