1 ! Copyright (C) 2009 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: combinators combinators.smart csv io.encodings.8-bit
4 math.parser memoize sequences kernel unicode.categories money
5 io.encodings.8-bit.latin1 ;
8 ! GeoBytes is not free software.
9 ! Please read their license should you choose to use it.
10 ! This is just a binding to the GeoBytes CSV files.
11 ! Download and install GeoBytes yourself should you wish to use it.
12 ! http://www.geobytes.com/GeoWorldMap.zip
14 CONSTANT: geobytes-cities-path "resource:GeoWorldMap/Cities.txt"
15 CONSTANT: geobytes-countries-path "resource:GeoWorldMap/Countries.txt"
16 CONSTANT: geobytes-regions-path "resource:GeoWorldMap/Regions.txt"
17 CONSTANT: geobytes-version-path "resource:GeoWorldMap/version.txt"
19 TUPLE: country country-id country fips104 iso2 iso3 ison internet capital map-reference
20 nationality-singular nationality-plural currency currency-code population title
23 TUPLE: region region-id country-id region code adm1-code ;
25 TUPLE: city city-id country-id region-id city longitude latitude timezone code ;
27 TUPLE: version component version rows ;
29 MEMO: load-countries ( -- seq )
30 geobytes-countries-path latin1 file>csv rest-slice [
53 MEMO: load-regions ( -- seq )
54 geobytes-regions-path latin1 file>csv rest-slice [
66 MEMO: load-cities ( -- seq )
67 geobytes-cities-path latin1 file>csv rest-slice [
82 MEMO: load-version ( -- seq )
83 geobytes-version-path latin1 file>csv rest-slice [