Where to get worldwide City name, State/Province name, Postal/Zip code, Country, Latitude, Longitude data for free - geo

For this site "http://download.geonames.org/export/zip/" I cant get only 85 countries.
I referred "www.maxmind.com" they not provide postal/zip code.

openaddresses.io (provides street address data too)
OpenstreetMap Has more complete coverage. You can build queries to extraxt the data you need.

Related

Retrieve US population by zipcode

I am trying to use Census Bureau API to retrieve the United States population by zipcode.
I have a valid key and followed this link but I wasn't able to retrieve population result, it kept fails with 404.
Could anyone please help me to draft correct API URL to GET population response via zipcode input?
to retrieve population result via zipcode

What is the industry standard way to store country / state / city in a database of web APP?

For country and state, there are ISO numbers. With City, there is not.
Method 1:
Store in one column:
[Country ISO]-[State ISO]-[City Name]
Method 2:
Store in 3 separate columns.
Also, how to handle city names if there is no unique identifier?
First and foremost, three separate columns to keep your data. If you want to create a unique identifier, the easiest way would be giving a random 3-10 digit code depending on the size of your data set. However, I would suggest concatenating [country-code]-[state-code]-[code] if you have a small data set and if you want human readability to a certain point. code can be several things. Here are some ideas:
of course a random id or even a database row id
licence plate number/code if there is for a city
phone area code of the city or the code of the center
same logic may apply to zip codes
combination of latitude and longitude of the city center up to certain degree
Here are also more references that can be used:
ISO 3166 is a country codes. In there you can find codes for states or cities depending on the country.
As mentioned IATA has both Airport and City codes list but they are hard to obtain.
UN Location list is a good mention but it can be difficult to gather the levels of differentiation, like the airport code or city code or a borough code can be on the same list, but eventually the UN/LOCODE must be unique. (Airport codes are used for ICAO, similar to IATA but not the same)
there are several data sets out there like OpenTravelData or GeoNames that can be used for start but may require digging and converting. They provide unique codes for locations. And many others can be found.
Bonus:
I would suggest checking Schema.org's City Schema and other Place Schemas for a conscious setup.

MaxMind Geolite2-City doesn't show city and region information

I am using Geolite2-City Database for Geolocation. In some cases not possible to get city, region except the country. For the IP - 205.145.64.6, the database provides the below details only (city, region details are missing).
Which Maxmind database have to use to get all the information including city, region details?
Not all IP addresses will resolve to city level. In this case, there is no city information for 205.145.64.6

How to fetch the country name based on latitude and longitude in codename one..?

I am trying to retrieve the country name using Lat and Long I fetched using locationmanager in codename one... How to get country, state, city, zip based on these parameters..??
You need to use a webservice that will translate location data to location meta data e.g. this one https://www.codenameone.com/blog/dynamic-autocomplete.html
Notice that the sample above uses a different feature of that webservice but the same concept applies.

API for Address -> School District Lookup?

Is there a way to programmatically determine what School District a given physical street address in the US is tied to?
The US Census Bureau coordinates with local school districts from each state to understand boundaries along with any changes. This information is published every other year by the Census Bureau itself in their "Tiger" data:
http://www.census.gov/did/www/schooldistricts/data/boundaries.html
(A relatively easy way to read the data is using PostGIS under PostgreSQL)
But before all of that, you need to make sure you're working with a correct address. The reason is that the address may not even exist at all or may be formatted incorrectly such that you are unable to determine a match. Furthermore, if the ZIP Code is wrong or street information is misspelled, or the person accidentally reversed the "North" or "South" part of an address, e.g. 123 North Main Street, that could put the coordinate in the wrong school district. So as a precursor to running your addresses through PostGIS, you'll definitely want to look at using an address verification service to make sure you've got good data to start with. (Full disclosure: I'm the founder of SmartyStreets, we do address verification.)