From 31cd14cd86ee83c6f74166494fff34b1284b9cff Mon Sep 17 00:00:00 2001 From: Chandler Swift Date: Fri, 1 Mar 2024 19:18:40 -0600 Subject: [PATCH] Standardize on lon/lat not lat/lon --- get_data.py | 4 ++-- index.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/get_data.py b/get_data.py index 7df10f1..8a2280c 100644 --- a/get_data.py +++ b/get_data.py @@ -34,8 +34,8 @@ for state in states[:51]: # Just the 50 and DC, not Guam/American Samoa/PR/etc for feature in data['features']: # {"type": "Feature", "properties": {"STATEFP": "01", "PLACEFP": "02260", "PLACENS": "02405163", "GEOID": "0102260", "NAME": "Ardmore", "NAMELSAD": "Ardmore town", "LSAD": "43", "CLASSFP": "C1", "PCICBSA": "N", "PCINECTA": "N", "MTFCC": "G4110", "FUNCSTAT": "A", "ALAND": 5289895, "AWATER": 21830, "INTPTLAT": "+34.9878376", "INTPTLON": "-086.8290225"}, "geometry": {"type": "Polygon", "coordinates": [[[-86.856689, 34.992046], [-86.855354, 34.992044], [-86.855101, 34.99204] state_place = (feature['properties']['STATEFP'], feature['properties']['PLACEFP']) - lat_lon = (float(feature['properties']['INTPTLAT']), float(feature['properties']['INTPTLON'])) - place_locations[state_place] = lat_lon + lon_lat = (float(feature['properties']['INTPTLON']), float(feature['properties']['INTPTLAT'])) + place_locations[state_place] = lon_lat print("done") print("Fetching population data for all states…", flush=True, end="") diff --git a/index.html b/index.html index d24b864..1f87ae2 100644 --- a/index.html +++ b/index.html @@ -184,7 +184,7 @@ for (let city of cities) { if (city.guessed) { ctx.beginPath(); - const c = transform([city.location[1], city.location[0]]) + const c = transform(city.location) console.log(city.location, c) ctx.arc(c[0], c[1], 2, 0, 2*Math.PI, true); ctx.fill();