make sure PHP and Python reverse code does the same

The only allowable difference is precision of coordinates. Python uses
a precision of 7 digits where possible, which corresponds to the
precision of OSM data.

Also fixes some smaller bugs found by the BDD tests.
This commit is contained in:
Sarah Hoffmann
2023-03-26 12:22:34 +02:00
parent 300921a93e
commit 86b43dc605
20 changed files with 235 additions and 162 deletions

View File

@@ -255,6 +255,7 @@ def create_from_tiger_row(row: Optional[SaRow],
res = class_type(source_table=SourceTable.TIGER,
place_id=row.place_id,
osm_object=(row.osm_type, row.osm_id),
category=('place', 'houses' if hnr is None else 'house'),
postcode=row.postcode,
country_code='us',
@@ -315,8 +316,8 @@ def _result_row_to_address_row(row: SaRow) -> AddressLine:
""" Create a new AddressLine from the results of a datbase query.
"""
extratags: Dict[str, str] = getattr(row, 'extratags', {})
if 'place_type' in row:
extratags['place_type'] = row.place_type
if hasattr(row, 'place_type') and row.place_type:
extratags['place'] = row.place_type
names = row.name
if getattr(row, 'housenumber', None) is not None: