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