nextcloud / maps

🌍🌏🌎 The whole world fits inside your cloud!
https://apps.nextcloud.com/apps/maps
GNU Affero General Public License v3.0
504 stars 89 forks source link

[Feature Suggest] Parsing USA/Canada addresses (and maybe others) #136

Open WNYmathGuy opened 5 years ago

WNYmathGuy commented 5 years ago

I'm noticing a pattern of things that don't make the map where most of my content does as expected.

This first thingie is more of a bug than an enhancement but it's related. I was having fun populating the location search textbox for driving directions by typing in names of my contacts and discovered some that were not found and were not rendered on the map. My contacts who live in apartments were omitted from both. Standardization for the US Postal System is to have the pound sign stuck to the apartment number immediately after the building street address without a comma separator. e.g. 145748 Main St #B14, Big City, ST(ate) ZIPCODE Apparently, the thing that renders them is choking on the pound sign and discarding the item.

The main point of this issue is that the USA & Canada (and maybe Mexico and the UK), all that is needed to geolocate a place on the map is the street number street name and ZipCode. It can just be the first 5 digits of the USA zip instead of the newer +4 digits, for Canada you need all 6 characters. The reason this is true is that municipalities work with the post office when naming streets and numbering them. A zip code's first 5 digits are identifying a post office building. They sort on street address at that level to load trucks. They make sure that if two streets in their delivery territory have the same name that they don't have overlapping house/building numbers. Google maps has this working for them. So if you are pulling a USA address into the search thingie, you only need the field for the street address (with any apartment stripped off) and the zip code field.

tacruc commented 5 years ago

Basically the same problem as #144, hence we do not parse the address our self. We just send the string to OSM. This process might be improved, right now we just send the sting, but it is possible to provide the city the street and the county and more as different arguments. I'm against to write parsing code our self, hence we will not make it bedder than OSM and I guess what improves one region will just brake others.

nordcomputer commented 5 years ago

In germany, addresses are normally written:

streetname number
postcode city

Seems like the app is trying to find a number first, when reading address data from contacts...