diff --git a/src/FACT_jobs.jl b/src/FACT_jobs.jl index 22cf334519a41f55c3d865984a684a5a5897be0e..da921e5906b664e67ae8eb1732bcd92294347a56 100644 --- a/src/FACT_jobs.jl +++ b/src/FACT_jobs.jl @@ -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 diff --git a/src/FACT_road.jl b/src/FACT_road.jl index d9bbf22ebe27181788624488b9ab04ea21178321..e850f9f77afd25a630fdd0aa7577ab5d680e70bf 100644 --- a/src/FACT_road.jl +++ b/src/FACT_road.jl @@ -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[]