I am searching a database of all zipcodes / postal codes and the city districts (part of the cities) in the world. Is there some service like the GeoNames database? I spoke with GeoNames, but they don't have the relation between the zipcodes and the districts in their data.
GeoNames does indeed provide the relationship between parts of cities and their postal codes. A few examples:
- Parts of London with the postal code EC1
- Postal codes of districts in Austria called Innere Stadt (Inner City)
The data is licensed under Creative Commons Attribution 3.0.
The GADM database of Global Administrative Areas could be a good place to start.
If you saw a map of for example districts, and zipcodes, you would notice that they are more likely than not to have different borders.
For example my city shares a zipcode with another town (same county).
It shares a school district with a completely different town, in a different county.
The high school also hosts some classes for another town, that is in yet another county (mostly).
All three of those other towns are about the same distance away from my city, in almost completely opposite directions.
There was also an occurrence where a bunch of houses were in two school districts at the same time, in a nearby city.
( I know you weren't asking about school districts, but they are similar enough to hopefully get the point across )
So the problem you are facing is that the two pieces of data have almost no relation to one another.
The boundaries were most likely created by different governing bodies, at different times, who had different ideas about where to draw an arbitrary line.
You may get some overlap of lines, at a river for example, but such obvious places to put a line will be few and far between.
The best that you could do is find a high correlation between a set of places' districts, and their zipcodes. Also note that both can change over time.
Another option would be to get the coordinates of the boundaries, and figure it out that way.
There will however never be a definitive correlation.