Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase length of housenumber? #194

Open
sypets opened this issue Jun 18, 2024 · 3 comments
Open

Increase length of housenumber? #194

sypets opened this issue Jun 18, 2024 · 3 comments

Comments

@sypets
Copy link
Contributor

sypets commented Jun 18, 2024

CREATE TABLE tx_odsosm_geocache (
       ....
	housenumber varchar(5) NOT NULL DEFAULT '',


https://github.com/bobosch/ods_osm/blob/master/ext_tables.sql#L40

When I add "Ammerländer Heerstraße 114-118" into the field "address", an exception is thrown:

An exception occurred while executing 
'INSERT INTO `tx_odsosm_geocache` (`search_city`, `country`, `state`, `city`, `zip`, `street`, `housenumber`, `tstamp`, `crdate`, `service_hit`, `lat`, `lon`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params ["Oldenburg", "De", "Niedersachsen", "Oldenburg", "26129", "Ammerl\u00e4nder Heerstra\u00dfe", "114-118", 1718702043, 1718702043, 1, "53.1488522", "8.1820344"]: 
Data too long for column 'housenumber' at row 1

114-118 is lengh 7, but field has length 5.

@albig
Copy link
Collaborator

albig commented Jun 19, 2024

Of course, we can rise this. in tt_address the equivalent would be building? It's varchar(255) for example. https://github.com/FriendsOfTYPO3/tt_address/blob/master/ext_tables.sql#L19C14-L19C26

@sypets
Copy link
Contributor Author

sypets commented Jun 21, 2024

@albig Do what you think is best. I am not so familiar with the internal DB structure and especially the mapping of tt_address and tx_odsosm_geocache.

The "114-118" was the only case I found in my DB which did not fit, I searched for housenumber with length 5 in DB.

@albig
Copy link
Collaborator

albig commented Jul 12, 2024

Nominatim (the address resolver service by OpenStreetMap which is used to georeference the address) uses TEXT for housenumber. So it's possible to get very long values.

https://nominatim.org/release-docs/latest/develop/Database-Layout/

So, we should increase the size in tx_odsosm_geocache.housenumber AND make sure, longer values get truncated before inserting in the cache database.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants