Skip to content
Snippets Groups Projects
Commit 27236e60 authored by Riccardo Boero's avatar Riccardo Boero :innocent:
Browse files

Fixed jobs for states and Hawaai unreachable by road.

parent 0613630f
No related branches found
No related tags found
No related merge requests found
......@@ -88,8 +88,15 @@ function us_qcew(conn::MySQL.Connection, selection::Dict)
end
# infer Agglvl_code -- because of Agglvl_code codification:
agglvl_code += (agg_level+2)
# fix id for states
if length(id) == 2
full_id = string(id, "000")
else
full_id = id
end
# prepare query
query = "SELECT Naics as industry, (Jan_jobs+Feb_jobs+Mar_jobs+Apr_jobs+May_jobs+Jun_jobs+Jul_jobs+Aug_jobs+Sep_jobs+Oct_jobs+Nov_jobs+Dec_jobs)/12 as jobs FROM QCEW WHERE Year = "*string(year)*" AND GeoID = '"*id*"' AND Agglvl_code = "*string(agglvl_code)*";"
query = "SELECT Naics as industry, (Jan_jobs+Feb_jobs+Mar_jobs+Apr_jobs+May_jobs+Jun_jobs+Jul_jobs+Aug_jobs+Sep_jobs+Oct_jobs+Nov_jobs+Dec_jobs)/12 as jobs FROM QCEW WHERE Year = "*string(year)*" AND GeoID = '"*full_id*"' AND Agglvl_code = "*string(agglvl_code)*";"
# execute
result = query_connection(conn, query)
# add geo_id col
......
......@@ -27,6 +27,18 @@ function travel_time_in_minutes(ws_host_port::String, selection::Dict)
# getting valuable info from dictionary
geo_id = selection["geo_id"]
shape_obj = selection["shape_obj"]
# filter out Hawaii
# Convert geo_id to integers
geo_id_int = parse.(Int, geo_id)
# Apply the range condition
condition = (geo_id_int .>= 15000) .& (geo_id_int .< 16000)
# Overwrite the original arrays with the filtered results
geo_id = geo_id[.!condition]
shape_obj = shape_obj[.!condition]
# Arrays to store column data
o_geo_ids = String[]
d_geo_ids = String[]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment