You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LUA script to get geocode of a place qsv luau map "Geo" file:geolookup.luau place.csv | qsv table
BEGIN {
csv_indexed = qsv_autoindex();
geoid_lookup_headers = qsv_register_lookup("places_geoid", "dathere://places_geoid.csv", 10000)
}!
local city_name = col["NAME"]
for geoid, details in pairs(places_geoid) do
if details["NAME"] == city_name then
geoid_result = geoid
break
end
end
-- Return the geoid for the given city name
return {geoid_result};
LUA script to get population of a state qsv luau map "population" file:populationlookup2.luau state.csv | qsv table
BEGIN {
csv_indexed = qsv_autoindex();
us_states_lookup_headers = qsv_register_lookup("us_states", "dathere://us-states-example.csv", 1000000)
}!
local state_name = col["Name"]:match("^%s*(.-)%s*$")
for abbreviation, details in pairs(us_states) do
if details["Name"] == state_name then
-- Remove commas from the population string and convert it to a number
population_result = details["Population (2019)"]
break
end
end
-- Return the population for the given state name
return {population_result};
LUA script to get area of a state qsv luau map "area" file:arealookup.luau state.csv | qsv table
BEGIN {
csv_indexed = qsv_autoindex();
us_states_lookup_headers = qsv_register_lookup("us_states", "dathere://us-states-example.csv", 1000000)
}!
local state_name = col["Name"]:match("^%s*(.-)%s*$")
for abbreviation, details in pairs(us_states) do
if details["Name"] == state_name then
-- Remove commas from the population string and convert it to a number
area_result = details["area (square miles)"];
break
end
end
-- Return the area for the given state name
return {area_result};
The text was updated successfully, but these errors were encountered:
LUA script to get geocode of a place
qsv luau map "Geo" file:geolookup.luau place.csv | qsv table
LUA script to get population of a state
qsv luau map "population" file:populationlookup2.luau state.csv | qsv table
LUA script to get area of a state
qsv luau map "area" file:arealookup.luau state.csv | qsv table
The text was updated successfully, but these errors were encountered: