On my front end, I am using google maps JS api. I am adding markers, the google maps event gives me the lat/lng for where I add the marker.
I'm adding that marker into my postgres database:
INSERT INTO markers(created_by, title, description, lat, lng, geography)\
values($1, $2, $3, $4::decimal, $5::decimal, ST_SetSRID(ST_MakePoint($5::decimal, $4::decimal), $6))
Now, I have the marker added into my database and from the front end I can show the user which markers are within a mile or whatever of his current location.
However, I would like to start showing results by zip code or the city associated with the user's current location.
For example, let's say I am adding this latLng to my database: 37.555880, -122.325580
. In my table I'm just going to add these points and the geography. But, this is in the city of San Mateo, CA, and the zip code is 94402....
How can I add this information to my database given just the lat and long?
If it isn't possible, then I will look into using the reverse geocoding API from Google going forward for future points, so I can get this information from the front end itself and insert it.