I downloaded the Geonames database (cities1000) and wrote a small Ruby program to import them into my table (geo_cities
). I then added geography column called geog
.
Then I converted all of the lat/lon numbers into the geog column using:
update public.geo_cities set geog = st_GeogFromText('SRID=4326;POINT(' || longitude || ' ' || latitude || ')');
Things are looking good. Now what I want to do is find all cities within 100 miles of Prague.
So I can get Prague like:
select * from geo_cities where asciiname = 'Prague' and countrycode = 'CZ';
I'm still learning GIS and Postgres so could someone help me with the simple query?