Anthrax, a zoonotic disease affecting both livestock and humans globally, is caused by Bacillus anthracis. The objectives of this study were the following: (1) to identify environmental risk factors for anthrax and use this information to develop an improved predictive risk map, and (2) to estimate spatial variation in basic reproduction number (Ro) and herd immunity threshold at the village level, which can be used to optimize vaccination policies within high-risk regions. Based on the anthrax incidences from 2000–2023 and vaccine administration figures between 2008 and 2022 in Karnataka, this study depicted spatiotemporal pattern analysis to derive a risk map employing machine learning algorithms and estimate Ro and herd immunity threshold for better vaccination coverage. Risk factors considered were key meteorological, remote sensing, soil, and geographical parameters. Spatial autocorrelation and SaTScan analysis revealed the presence of hotspots and clusters predominantly in the southern, central, and uppermost northern districts of Karnataka and temporal cluster distribution between June and September. Factors significantly associated with anthrax were air temperature, surface pressure, land surface temperature (LST), enhanced vegetation index (EVI), potential evapotranspiration (PET), soil temperature, soil moisture, pH, available potassium, sulphur, and boron, elevation, and proximity to waterbodies and waterways. Ensemble technique with random forest and classification tree models were used to improve the prediction accuracy of anthrax. High-risk areas are expected in villages in the southern, central, and extreme northern districts of Karnataka. The estimated Ro revealed 11 high-risk districts with Ro > 1.50 and respective herd immunity thresholds ranging from 11.24% to 55.47%, and the assessment of vaccination coverage at the 70%, 80%, and 90% vaccine efficacy levels, all serving for need-based strategic vaccine allocation. A comparison analysis of vaccinations administered and vaccination coverage estimated in this study is used to illustrate difference in the supply and vaccine force. The findings from the present study may support in planning preventive interventions, resource allocation, especially of vaccines, and other control strategies against anthrax across Karnataka, specifically focusing on predicted high-risk regions.