Skip to content

Commit

Permalink
Updating the indiaoutline.jl and Karmana.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
siddjain444 committed Jan 25, 2024
1 parent 035adcf commit 0545ab7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/Karmana.jl
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export get_HR_number, get_sentiment_props
############################################################



"""
Contains the State dataframe
"""
Expand Down Expand Up @@ -131,7 +132,7 @@ function __init__()
district_df[][302, :HR_Nmbr] = 3 # Kinnaur - district name not assigned HR_Name
district_df[][413, :HR_Nmbr] = 3 # North Sikkim - district not assigned HR_Name nor district name # 104
end
hr_df[] = _prepare_merged_geom_dataframe(district_df[], :HR_Nmbr, :ST_NM; capture_fields = (:ST_NM, :ST_CD, :HR_Name))
hr_df[] = _prepare_merged_geom_dataframe(district_df[], :HR_Nmbr, :ST_NM; capture_fields = (:ST_NM, :ST_CD, :HR_Name, :HR_Nmbr))
state_df[] = _prepare_merged_geom_dataframe(district_df[], :ST_NM; capture_fields = (:ST_CD,))

# finally, patch the loaded dataframes, to match the maps database
Expand Down
1 change: 0 additions & 1 deletion src/data.jl
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ function state_hr_district_dfs()
return district_table

end

# example code in R whose functionality this replicates
# read_the_map = st_read(dsn=dsn_for_maps, layer = aggregation.layer)

Expand Down
12 changes: 6 additions & 6 deletions src/plotting/indiaoutline.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function id_key_for_admin_level(admin_level::Symbol)
elseif admin_level == :HR
:hr_nmbr
elseif admin_level == :District
:dt_cen_cd
:censuscode
else
@error("The admin code `$admin_code` which you passed is invalid. Valid admin codes are `:State`, `:HR`, and `:District`.")
end
Expand Down Expand Up @@ -261,16 +261,16 @@ function Makie.plot!(plot::IndiaOutline)
end
notify(plot.converted[2])

state_plot = poly!(plot, plot.State, state_geoms; color = state_colors, colormap = plot.colormap, highclip = plot.highclip, lowclip = plot.lowclip)
hr_plot = poly!(plot, hr_geoms; color = hr_colors, colorrange = get(plot, :colorrange, (0, 1)), colormap = plot.colormap, highclip = plot.highclip, lowclip = plot.lowclip, plot.HR...)
district_plot = poly!(plot, district_geoms; color = district_colors, colormap = plot.colormap, colorrange = get(plot, :colorrange, (0, 1)), highclip = plot.highclip, lowclip = plot.lowclip, plot.District...)
river_plot = lines!(plot, GeoInterface.convert(GeometryBasics, Karmana.india_rivers[]); inspectable = false, xautolimits = false, yautolimits = false, plot.River...)
state_plot = poly!(plot, plot.State, state_geoms; color = state_colors, colormap = plot.colormap)#, highclip = plot.highclip, lowclip = plot.lowclip)
hr_plot = poly!(plot, hr_geoms; color = hr_colors, colorrange = get(plot, :colorrange, (0, 1)), colormap = plot.colormap)#, highclip = plot.highclip, lowclip = plot.lowclip, plot.HR...)
district_plot = poly!(plot, district_geoms; color = district_colors, colormap = plot.colormap, colorrange = get(plot, :colorrange, (0, 1)))#, highclip = plot.highclip, lowclip = plot.lowclip, plot.District...)
#river_plot = lines!(plot, GeoInterface.convert(GeometryBasics, Karmana.india_rivers[]); inspectable = false, xautolimits = false, yautolimits = false, plot.River...)


on(Base.Fix1(_set_plot_z, state_plot), plot.State.zlevel; update = true)
on(Base.Fix1(_set_plot_z, hr_plot), plot.HR.zlevel; update = true)
on(Base.Fix1(_set_plot_z, district_plot), plot.District.zlevel; update = true)
on(Base.Fix1(_set_plot_z, river_plot), plot.River.zlevel; update = true)
#on(Base.Fix1(_set_plot_z, river_plot), plot.River.zlevel; update = true)

return plot
end
Expand Down

0 comments on commit 0545ab7

Please sign in to comment.