Move attribution into weather_stations.csv
This commit is contained in:
parent
d7456c6ff9
commit
a094d07925
@ -1,3 +1,4 @@
|
|||||||
|
# Adapted from https://simplemaps.com/data/world-cities
|
||||||
Tokyo;35.6897
|
Tokyo;35.6897
|
||||||
Jakarta;-6.1750
|
Jakarta;-6.1750
|
||||||
Delhi;28.6100
|
Delhi;28.6100
|
||||||
|
Can't render this file because it is too large.
|
@ -69,8 +69,8 @@ public class CreateMeasurements3 {
|
|||||||
// Use a public list of city names and concatenate them all into a long string,
|
// Use a public list of city names and concatenate them all into a long string,
|
||||||
// which we'll use as a "source of city name randomness"
|
// which we'll use as a "source of city name randomness"
|
||||||
var bigName = new StringBuilder(1 << 20);
|
var bigName = new StringBuilder(1 << 20);
|
||||||
// Source: https://simplemaps.com/data/world-cities
|
|
||||||
try (var rows = new BufferedReader(new FileReader("data/weather_stations.csv"));) {
|
try (var rows = new BufferedReader(new FileReader("data/weather_stations.csv"));) {
|
||||||
|
rows.readLine(); // Skip the attribution line
|
||||||
while (true) {
|
while (true) {
|
||||||
var row = rows.readLine();
|
var row = rows.readLine();
|
||||||
if (row == null) {
|
if (row == null) {
|
||||||
@ -84,6 +84,7 @@ public class CreateMeasurements3 {
|
|||||||
var minLen = Integer.MAX_VALUE;
|
var minLen = Integer.MAX_VALUE;
|
||||||
var maxLen = Integer.MIN_VALUE;
|
var maxLen = Integer.MIN_VALUE;
|
||||||
try (var rows = new BufferedReader(new FileReader("data/weather_stations.csv"))) {
|
try (var rows = new BufferedReader(new FileReader("data/weather_stations.csv"))) {
|
||||||
|
rows.readLine(); // Skip the attribution line
|
||||||
final var nameSource = new StringReader(bigName.toString());
|
final var nameSource = new StringReader(bigName.toString());
|
||||||
final var buf = new char[MAX_NAME_LEN];
|
final var buf = new char[MAX_NAME_LEN];
|
||||||
final var rnd = ThreadLocalRandom.current();
|
final var rnd = ThreadLocalRandom.current();
|
||||||
|
Loading…
Reference in New Issue
Block a user