4 ms·
Show HN: Import openaddresses.io zipcodes longitude and latitude data
This is a screenshot of all the USA data from https://openaddresses.io/
https://i.imgur.com/nHIYtap.png
It's about 80GB un-compressed. I wanted a postgres table like:
zip | integer
location | geometry(Point,4326)
"zip_locations_zip_index" UNIQUE, btree (zip)
The following takes hours and hours to run:
https://github.com/andrewarrow/feedback/blob/main/location/zip.go
But you end up with a nice way to get an approximate postgis geometry for any zip code in the USA. (For free.) Anyone know of a faster way?
My favorite part of this code is buffer := make([]byte, 1). By making the buffer just a single byte, I can look for "\n" so much easier than if I was reading in 1024 bytes or 2,048 bytes etc and then I have to find that \n in the middle.
- mtmail 3y agohttps://github.com/osm-search/TIGER-data/ https://github.com/osm-search/TIGER-data/ produces a postcode file from US Census data. The code is not as clever maybe, but it's reasonable fast. 2023 should be available sometime this month, at least in previous years it was September. I have a cronjob that checks for new data. https://gis.stackexchange.com/ https://gis.stackexchange.com/ is a forum more focussed on geographic datasets.