Skip to content

Commit

Permalink
Add attribution into weather_stations.csv
Browse files Browse the repository at this point in the history
  • Loading branch information
mtopolnik committed Jan 5, 2024
1 parent b675437 commit e461749
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions data/weather_stations.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Source: https://simplemaps.com/data/world-cities
Tokyo;35.6897
Jakarta;-6.1750
Delhi;28.6100
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/dev/morling/onebrc/CreateMeasurements3.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ private static ArrayList<WeatherStation> generateWeatherStations() throws Except
var bigName = new StringBuilder(1 << 20);
// Source: https://simplemaps.com/data/world-cities
try (var rows = new BufferedReader(new FileReader("data/weather_stations.csv"));) {
rows.readLine(); // Skip the attribution line
while (true) {
var row = rows.readLine();
if (row == null) {
Expand All @@ -84,6 +85,7 @@ private static ArrayList<WeatherStation> generateWeatherStations() throws Except
var minLen = Integer.MAX_VALUE;
var maxLen = Integer.MIN_VALUE;
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 buf = new char[MAX_NAME_LEN];
final var rnd = ThreadLocalRandom.current();
Expand Down

0 comments on commit e461749

Please sign in to comment.