r0man / geonames-clj

Clojure API for GeoNames.
Eclipse Public License 1.0
8 stars 4 forks source link

add support for downloading and parsing the GeoNames cities15000 table #2

Closed algal closed 10 years ago

algal commented 10 years ago

This table gives the name, country, population, etc.. of every city with a population over 15,000.

The code for this is almost exactly like the for the countries namespace, except the file needs to be unzipped and the column names are different.

Also bumped the minor version number to reflect this new functionality. Should not affect anything else.

r0man commented 10 years ago

Hey algal, could you name the function cities-15000, and remove the ^:private meta data? Then I would merge it ;)

r0man commented 10 years ago

Ah, and please don't bump the version.

algal commented 10 years ago

Sure, except... The ^:private is in there because otherwise doing a (use 'geonames.countries) and (use 'geonames.cities) will produce a name collision for the symbols header and parse-line.

Is there another solution you'd suggest?

r0man commented 10 years ago

Don't use "use". Use require with :as or :refer.

(require '[geonames.countries :as countries])
(require '[geonames.countries :refer [countries]])

And the same with cities.

r0man commented 10 years ago

One more thing. Can you use keywords in the header with "-" and not "_". And :geoname-id, :ascii-name and :alternate-names similar to:

https://github.com/r0man/geonames-clj/blob/master/src/geonames/countries.clj#L9

algal commented 10 years ago

Done. Be aware, tho, that in the cases of geoname-id, ascii-name, and alternate-names this introduces a separator into field name that GeoNames readme.txt file treats as unbroken. I'm not sure if this matters or not, for interop with something else down the road. Probably not.

algal commented 10 years ago

done

r0man commented 10 years ago

Thanks, merged into 0.6.7.