Standardize on lon/lat not lat/lon
This commit is contained in:
parent
bf11f90a34
commit
31cd14cd86
|
@ -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="")
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue